<commit_before><commit_msg>Yol Genişlik<commit_after>﻿<?php   
ini_set('display_errors','0'); error_reporting(0); 
header("content-type:application/json"); 
$gelenYolId=$_GET['yolid']; 
 
$db_handle =  "host=localhost port=5432 dbname=postgis20 user=postgres password=<PASSWORD>"; 
$dbconn = pg_connect($db_handle);  

$sorgu1="SELECT ST_AsText(foo) as xxx FROM
(
SELECT ST_LineMerge(geom) as foo from genislikyol_900913  WHERE  gid='$gelenYolId'  ) as xxx";
$linestring="";
$tranformedXY="";
$XY=""; 
   
  $result2 = pg_query($dbconn, $sorgu1); 
  
   while ($row = pg_fetch_array($result2)) { 
   
   //Multilinestring linestringe dönüştürülüyor. Böylece  ST_Line_Interpolate_Point fonksiyonu çalışabiliyor
   $linestring=  $row["xxx"];
   //echo $linestring;
    }
	
	 $result3 = pg_query($dbconn, "SELECT Box2D(ST_GeomFromText('$linestring')) as xy"); 
//echo "SELECT Box2D(ST_GeomFromText('$linestring')) as xy";
 	
	// $result3 = pg_query($dbconn, "SELECT ST_AsEWKT(ST_Line_Interpolate_Point(ST_GeomFromText('$linestring'),'$basla')) as xy"); 
	 //,GELEN KM değerine göre noktanın xysi hesaplanıyor
    while ($row = pg_fetch_array($result3)) { 
   $XY=$row["xy"]; 
  
   // echo $XY;
    }
	 echo  json_encode($XY)
	 
?>
{'fraction_non_alphanumeric': 0.16042345276872963, 'fraction_numerical': 0.018729641693811076, 'mean_word_length': 5.175879396984925, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3690125', 'n_tokens_mistral': 533, 'n_tokens_neox': 498, 'n_words': 81}