[Mapbender-commits] r8291 - trunk/mapbender/http/classes

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Tue Mar 27 08:41:40 EDT 2012


Author: verenadiewald
Date: 2012-03-27 05:41:40 -0700 (Tue, 27 Mar 2012)
New Revision: 8291

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

Modified: trunk/mapbender/http/classes/class_gml_2_factory.php
===================================================================
--- trunk/mapbender/http/classes/class_gml_2_factory.php	2012-03-27 12:39:56 UTC (rev 8290)
+++ trunk/mapbender/http/classes/class_gml_2_factory.php	2012-03-27 12:41:40 UTC (rev 8291)
@@ -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