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

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Tue Sep 4 01:59:53 PDT 2012


Author: verenadiewald
Date: 2012-09-04 01:59:52 -0700 (Tue, 04 Sep 2012)
New Revision: 8480

Modified:
   trunk/mapbender/http/classes/class_kml_line.php
Log:
added function transform for kml lines

Modified: trunk/mapbender/http/classes/class_kml_line.php
===================================================================
--- trunk/mapbender/http/classes/class_kml_line.php	2012-09-04 08:58:38 UTC (rev 8479)
+++ trunk/mapbender/http/classes/class_kml_line.php	2012-09-04 08:59:52 UTC (rev 8480)
@@ -115,6 +115,19 @@
 		return $this->pointArray;
 	}
 	
+    public function transform($targetEpsg){
+        $numberOfPoints = count($this->pointArray);
+		if ($numberOfPoints > 0) {
+			for ($i=0; $i < $numberOfPoints; $i++) {
+			    $pt = new Mapbender_point($this->pointArray[$i]["x"], $this->pointArray[$i]["y"], $this->pointArray[$i]["z"], 4326);
+				$pt->transform($targetEpsg);
+				$this->pointArray[$i]["x"] = $pt->x;
+				$this->pointArray[$i]["y"] = $pt->y;
+				$this->pointArray[$i]["z"] = $pt->z;
+	        }
+		}
+	}
+	
 	/**
 	 * An array of points, with a point being an associative 
 	 * array consisting of attributes "x" and "y" and "z"



More information about the Mapbender_commits mailing list