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

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Thu Oct 7 14:15:11 EDT 2010


Author: christoph
Date: 2010-10-07 18:15:11 +0000 (Thu, 07 Oct 2010)
New Revision: 7033

Modified:
   branches/2.6/http/classes/class_gml_multiline.php
   branches/2.6/http/classes/class_gml_multipoint.php
   branches/2.6/http/classes/class_gml_polygon.php
Log:
bugfixes from trunk

Modified: branches/2.6/http/classes/class_gml_multiline.php
===================================================================
--- branches/2.6/http/classes/class_gml_multiline.php	2010-10-07 17:24:14 UTC (rev 7032)
+++ branches/2.6/http/classes/class_gml_multiline.php	2010-10-07 18:15:11 UTC (rev 7033)
@@ -31,11 +31,14 @@
 	}
 	
 	public function addPoint ($x, $y, $i) {
-		array_push($this->lineArray[$i], array("x" => $x, "y" => $y));
+            if (!is_array($this->lineArray[$i])) {
+                $this->lineArray[$i] = array();
+            }
+            array_push($this->lineArray[$i], array("x" => $x, "y" => $y));
 	}
 	
 	public function toGml2 () {
-		$str = "<gml:MultiLineString srsName='$srsName'>";
+		$str = "<gml:MultiLineString srsName='$this->srs'>";
 		foreach ($this->lineArray as $line) {
 			$str .=	"<gml:lineStringMember><gml:LineString><gml:coordinates>";
 			$ptArray = array();
@@ -43,14 +46,14 @@
 				$ptArray[] = $point["x"] . "," . $point["y"];
 			}
 			$str .= implode(" ", $ptArray);
-			$str .= "</gml:coordinates></gml:LineString>";
+			$str .= "</gml:coordinates></gml:LineString></gml:lineStringMember>";
 		}
-		$str .=	"<gml:lineStringMember><gml:MultiLineString>";
+		$str .=	"</gml:MultiLineString>";
 		return $str;		
 	}
 	
 	public function toGml3 () {
-		$str = "<gml:MultiCurve srsName='$srsName'>";
+		$str = "<gml:MultiCurve srsName='$this->srs'>";
 		foreach ($this->lineArray as $line) {
 			$str .=	"<gml:curveMember><gml:LineString>";
 			$ptArray = array();
@@ -58,9 +61,9 @@
 				$ptArray[] = "<gml:pos>" . $point["x"] . " " . $point["y"] . "</gml:pos>";
 			}
 			$str .= implode("", $ptArray);
-			$str .= "</gml:LineString><gml:curveMember>";
+			$str .= "</gml:LineString></gml:curveMember>";
 		}
-		$str .=	"<gml:MultiCurve>";
+		$str .=	"</gml:MultiCurve>";
 		return $str;		
 		
 	}

Modified: branches/2.6/http/classes/class_gml_multipoint.php
===================================================================
--- branches/2.6/http/classes/class_gml_multipoint.php	2010-10-07 17:24:14 UTC (rev 7032)
+++ branches/2.6/http/classes/class_gml_multipoint.php	2010-10-07 18:15:11 UTC (rev 7033)
@@ -35,25 +35,25 @@
 	}
 	
 	public function toGml2 () {
-		$str = "<gml:MultiPoint srsName='$srsName'>";
+		$str = "<gml:MultiPoint srsName='$this->srs'>";
 		foreach ($this->pointArray as $point) {
 			$str .=	"<gml:pointMember><gml:Point><gml:coordinates>";
 			$str .= $point["x"] . "," . $point["y"];
 			$str .= "</gml:coordinates></gml:Point>";
 		}
-		$str .=	"<gml:pointMember><gml:MultiPoint>";
+		$str .=	"</gml:pointMember></gml:MultiPoint>";
 		return $str;		
 	}
 	
 	public function toGml3 () {
 		
-		$str = "<gml:MultiPoint srsName='$srsName'>";
+		$str = "<gml:MultiPoint srsName='$this->srs'>";
 		foreach ($this->pointArray as $point) {
 			$str .=	"<gml:pointMember><gml:Point>";
 			$str .= "<gml:pos>" . $point["x"] . " " . $point["y"] . "</gml:pos>";
-			$str .= "</gml:Point><gml:pointMember>";
+			$str .= "</gml:Point></gml:pointMember>";
 		}
-		$str .=	"<gml:MultiPoint>";
+		$str .=	"</gml:MultiPoint>";
 		return $str;		
 		
 	}

Modified: branches/2.6/http/classes/class_gml_polygon.php
===================================================================
--- branches/2.6/http/classes/class_gml_polygon.php	2010-10-07 17:24:14 UTC (rev 7032)
+++ branches/2.6/http/classes/class_gml_polygon.php	2010-10-07 18:15:11 UTC (rev 7033)
@@ -40,9 +40,7 @@
 		if (count($this->innerRingArray) < $i) {
 			array_push($this->innerRingArray, array());
 		}
-		$index = count($this->innerRingArray);
-		$currentIndex = ($i < $index ? $i : $index);
-		array_push($this->innerRingArray[$currentIndex-1], array("x" => $x, "y" => $y));
+		array_push($this->innerRingArray[$i-1], array("x" => $x, "y" => $y));
 	}
 	
 	public function toGml2 () {
@@ -81,7 +79,7 @@
 		foreach ($this->pointArray as $point) {
 			$ptArray[] = "<gml:pos>" . $point["x"] . " " . $point["y"] . "</gml:pos>";
 		}
-		$str .= implode(" ", $ptArray);
+		$str .= implode("", $ptArray);
 
 		$str .= '</gml:LinearRing></gml:exterior>';
 				



More information about the Mapbender_commits mailing list