[Mapbender-commits] r7813 - trunk/mapbender/http/php

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Wed May 11 11:01:41 EDT 2011


Author: apour
Date: 2011-05-11 08:01:41 -0700 (Wed, 11 May 2011)
New Revision: 7813

Modified:
   trunk/mapbender/http/php/mod_digitize_splitLine.php
Log:
@todo The first select needs a sorting!!!

Modified: trunk/mapbender/http/php/mod_digitize_splitLine.php
===================================================================
--- trunk/mapbender/http/php/mod_digitize_splitLine.php	2011-05-11 14:18:54 UTC (rev 7812)
+++ trunk/mapbender/http/php/mod_digitize_splitLine.php	2011-05-11 15:01:41 UTC (rev 7813)
@@ -56,12 +56,17 @@
 }
 
 
+
 // if the two lines don't intersect, we just do nothing, and return the first line
 if(count($points) == 0){
 	$lineArray[] = $line1Text;
 }else{
-	$points = array_merge(array($startPoint),$points,array($endPoint));
-	
+	$points = array_merge(array($startPoint),array_reverse($points),array($endPoint));
+
+//	header("Content-type:application/x-json; charset=utf-8");
+//	die($json->encode(array("geometries" => $points)));
+
+
 	// go through the point array in pairs, cut into segment, and add each segment onto resultArray
 	for($i = 0; $i < count($points)-1; $i++){
 
@@ -75,7 +80,7 @@
 					."ST_Line_Locate_Point('%s'::geometry,'%s'::geometry),"
 					."1.0"
 				.")))));",
-				$line1Text,$line1Text,$pointStartText,$line1Text,$pointEndText);		
+				$line1Text,$line1Text,$pointStartText);		
 		} else {
 			$nthSegment_sql = sprintf("SELECT ST_AsText(ST_multi(geom)) AS substring FROM "
 				." ST_Dump((SELECT ST_AsText(ST_FORCE_COLLECTION(ST_Line_Substring("
@@ -94,12 +99,7 @@
 	}
 }
 
-
-
 // OUTPUT
-$data = array("geometries" => $lineArray);
-$output = $json->encode($data);
 header("Content-type:application/x-json; charset=utf-8");
-
-echo $output;
+echo $json->encode(array("geometries" => $lineArray));
 ?>



More information about the Mapbender_commits mailing list