[Mapbender-commits] r4654 - branches/2.6/http/classes

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Thu Sep 17 13:31:59 EDT 2009


Author: christoph
Date: 2009-09-17 13:31:58 -0400 (Thu, 17 Sep 2009)
New Revision: 4654

Modified:
   branches/2.6/http/classes/class_gml_3_factory.php
Log:


Modified: branches/2.6/http/classes/class_gml_3_factory.php
===================================================================
--- branches/2.6/http/classes/class_gml_3_factory.php	2009-09-17 17:11:19 UTC (rev 4653)
+++ branches/2.6/http/classes/class_gml_3_factory.php	2009-09-17 17:31:58 UTC (rev 4654)
@@ -151,7 +151,7 @@
 
 		$simpleXMLNode->registerXPathNamespace('gml', 'http://www.opengis.net/gml');
 		
-		$allCoords = $simpleXMLNode->xpath("gml:lineStringMember/gml:LineString/gml:coordinates");
+		$allCoords = $simpleXMLNode->xpath("gml:lineStringMember/gml:LineString/gml:poslist");
 			
 		$cnt=0;
 		foreach ($allCoords as $Coords) {
@@ -160,15 +160,13 @@
 			
 			$coordsDom = dom_import_simplexml($Coords);
 				
-//			$name = $coordsDom->nodeName;
-//			$value = $coordsDom->nodeValue;				
-//			echo "===> name: ".$name. ", Value: ".$value."<br>";
-			
-			foreach(explode(' ',$coordsDom->nodeValue) as $pointCoords){
-				list($x,$y,$z) = explode(' ',$pointCoords);
+			$dim = self::getDimensionFromNode($coordsDom);
+			$coordArray = explode(' ', trim($coordsDom->nodeValue));
+			for ($i = 0; $i < count($coordArray); $i += $dim) {
+				$x = $coordArray[$i];
+				$y = $coordArray[$i+1];
 				$gmlMultiLine->addPoint($x, $y, $cnt);
-				}
-			
+			}			
 			$cnt++;
 		}
 		return $gmlMultiLine;



More information about the Mapbender_commits mailing list