[Mapbender-commits] r8290 - branches/2.7/http/classes

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Tue Mar 27 08:39:56 EDT 2012


Author: verenadiewald
Date: 2012-03-27 05:39:56 -0700 (Tue, 27 Mar 2012)
New Revision: 8290

Modified:
   branches/2.7/http/classes/class_gml_2_factory.php
Log:
trim for $coordsDom->nodeValue for valid geoJSON

Modified: branches/2.7/http/classes/class_gml_2_factory.php
===================================================================
--- branches/2.7/http/classes/class_gml_2_factory.php	2012-03-21 10:49:30 UTC (rev 8289)
+++ branches/2.7/http/classes/class_gml_2_factory.php	2012-03-27 12:39:56 UTC (rev 8290)
@@ -66,7 +66,7 @@
 		$currentSibling = $domNode->firstChild;
 		while ($currentSibling) {
 			
-			foreach(explode(' ',$currentSibling->nodeValue) as $cords){
+			foreach(explode(' ',trim($currentSibling->nodeValue)) as $cords){
 				list($x,$y,$z) = explode(',',$cords);
 				$gmlLine->addPoint($x, $y);
 			}
@@ -105,7 +105,7 @@
 				foreach ($coordinates as $coordinate) {
 					$coordsDom = dom_import_simplexml($coordinate);
 						
-					foreach(explode(' ',$coordsDom->nodeValue) as $pointCoords){
+					foreach(explode(' ',trim($coordsDom->nodeValue)) as $pointCoords){
 		
 						list($x,$y,$z) = explode(',',$pointCoords);
 						$gmlPolygon->addPointToRing($ringCount, $x, $y);
@@ -137,7 +137,7 @@
 //			$value = $coordsDom->nodeValue;				
 //			echo "===> name: ".$name. ", Value: ".$value."<br>";
 			
-			foreach(explode(' ',$coordsDom->nodeValue) as $pointCoords){
+			foreach(explode(' ',trim($coordsDom->nodeValue)) as $pointCoords){
 				list($x,$y,$z) = explode(',',$pointCoords);
 				$gmlMultiLine->addPoint($x, $y, $cnt);
 				}
@@ -165,7 +165,7 @@
 				
 				$coordsDom = dom_import_simplexml($Coords);
 					
-				foreach (explode(' ',$coordsDom->nodeValue) as $pointCoords) {
+				foreach (explode(' ',trim($coordsDom->nodeValue)) as $pointCoords) {
 					list($x,$y,$z) = explode(',',$pointCoords);
 					$gmlMultiPolygon->addPoint($x, $y, $cnt);
 				}
@@ -182,7 +182,7 @@
 						foreach ($coordinates as $coordinate) {
 							$coordsDom = dom_import_simplexml($coordinate);
 								
-							foreach(explode(' ',$coordsDom->nodeValue) as $pointCoords){
+							foreach(explode(' ',trim($coordsDom->nodeValue)) as $pointCoords){
 				
 								list($x,$y,$z) = explode(',',$pointCoords);
 								$gmlMultiPolygon->addPointToRing($cnt, $ringCount, $x, $y);



More information about the Mapbender_commits mailing list