[Mapbender-commits] r9840 - in trunk/mapbender: conf http/classes

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Fri Jan 5 04:27:47 PST 2018


Author: armin11
Date: 2018-01-05 04:27:47 -0800 (Fri, 05 Jan 2018)
New Revision: 9840

Added:
   trunk/mapbender/conf/geoJsonSimpleStyle.json
Modified:
   trunk/mapbender/http/classes/class_kml_ows.php
   trunk/mapbender/http/classes/class_kml_parser_ows.php
   trunk/mapbender/http/classes/class_kml_polygon.php
Log:
First draft for serverside geojson2kml export possibility with support of mapbox simplestyle spec 1.1.0

Added: trunk/mapbender/conf/geoJsonSimpleStyle.json
===================================================================
--- trunk/mapbender/conf/geoJsonSimpleStyle.json	                        (rev 0)
+++ trunk/mapbender/conf/geoJsonSimpleStyle.json	2018-01-05 12:27:47 UTC (rev 9840)
@@ -0,0 +1,33 @@
+{
+	"point": {
+		"simple_style_spec_attributes":
+			["title","description","marker-size","marker-symbol","marker-color"],
+		"simple_style_spec_defaults":
+			["dummy title","dummy description","medium","","7e7e7e"],
+		"mapbender_extensions":
+			["marker-type"],
+		"mapbender_extensions_default":
+			[""]
+		},
+	"linestring": {
+		"simple_style_spec_attributes":
+			["title","description","stroke","stroke-opacity","stroke-width"],
+		"simple_style_spec_defaults":
+			["dummy title","dummy description","#555555",1.0,2],
+		"mapbender_extensions":
+			[],
+		"mapbender_extensions_default":
+			[]
+		},
+	"polygon": {
+		"simple_style_spec_attributes":
+			["title","description","stroke","stroke-opacity","stroke-width","fill","fill-opacity"],
+		"simple_style_spec_defaults":
+			["dummy title","dummy description","#555555",1.0,2,"5555557",0.6],
+		"mapbender_extensions":
+			[],
+		"mapbender_extensions_default":
+			[]
+		}
+}
+

Modified: trunk/mapbender/http/classes/class_kml_ows.php
===================================================================
--- trunk/mapbender/http/classes/class_kml_ows.php	2018-01-04 14:17:38 UTC (rev 9839)
+++ trunk/mapbender/http/classes/class_kml_ows.php	2018-01-05 12:27:47 UTC (rev 9840)
@@ -18,14 +18,14 @@
 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
 require_once(dirname(__FILE__)."/../../core/globalSettings.php");
-
 require_once(dirname(__FILE__)."/../classes/class_json.php");
 require_once(dirname(__FILE__)."/../classes/class_point.php");
 
 require_once(dirname(__FILE__)."/../classes/class_kml_geometry.php");
 require_once(dirname(__FILE__)."/../classes/class_kml_placemark.php");
-require_once(dirname(__FILE__)."/../classes/class_kml_parser_ows.php");;
+require_once(dirname(__FILE__)."/../classes/class_kml_parser_ows.php");
 
+
 /**
  * Allows parsing a KML file, extracting the placemarks.
  *
@@ -38,13 +38,16 @@
 	// ------------------------------- public -----------------------------------------------
 	//
 	//
-
 	/**
 	 * The constructor function, currently empty.
 	 */
 	public function __construct() {
 	}
 
+	public function getGeoJsonSimpleStyleInfo() {
+		return json_decode(file_get_contents("../../conf/geoJsonSimpleStyle.json"));
+	}
+
 	public function toSingleLineStringKml() {
 		//KML 2.2 output
 		$doc = new DOMDocument("1.0", CHARSET);
@@ -157,20 +160,22 @@
 	 * @return string the KML document.
 	 */
 	public function __toString() {
-
-
+		//read configuration for geojson simple style from conf folder - to handle style information from geojson if available
+		$geoJsonStyleInfo = $this->getGeoJsonSimpleStyleInfo();
 		if (!$this->kml) {
 			//KML 2.2 output
 			$doc = new DOMDocument("1.0", CHARSET);
 			$doc->preserveWhiteSpace = false;
 
-			// attach kml and Document tag
+			//attach kml and Document tag
 			$e_kml = $doc->createElementNS("http://earth.google.com/kml/2.2", "kml");
 			$e_document = $doc->createElement("Document");
 			$e_kml->appendChild($e_document);
 			$doc->appendChild($e_kml);
-
-			// attach placemarks
+			$styleHashArray = array();
+			$styleArray = array();
+			$placemarkArray = array();
+			//attach placemarks
 			$e = new mb_notice("to string: #placemarks: " . count($this->placemarkArray));
 			for ($i = 0; $i < count($this->placemarkArray); $i++) {
 				$currentPlacemark = $this->placemarkArray[$i];
@@ -198,26 +203,26 @@
 						$e_geometry->appendChild($e_coordinates);
 						break;
 
-/* TODO:Polygons
 					case "KMLPolygon" :
+						//<Polygon><outerBoundaryIs><LinearRing><coordinates>100,0 101,0 101,1 100,1 100,0</coordinates></LinearRing></outerBoundaryIs></Polygon>
 						$e_geometry = $doc->createElement("Polygon");
-						$e_outer = $doc->createElement("OuterBoundaryIs");
+						$e_outer = $doc->createElement("outerBoundaryIs");
 						$e_outer_lr = $doc->createElement("LinearRing");
-						$outer_coordinates = ""; // TODO: get coords from placemark
-						$e_outer_coordinates = $doc->createElement("Coordinates", $outer_coordinates);
-
-						$e_outer_lr->appendChild($e_outer_coordinates);
+						$coordinatesArray = $currentPlacemark->getGeometry()->getOuterBoundary()->getPointArray();
+						$coordinates = "";
+						for ($j = 0; $j < count($coordinatesArray); $j++) {
+							if ($j > 0) {
+								$coordinates .= " ";
+							}
+							$coordinates .= $coordinatesArray[$j]["x"] . "," . $coordinatesArray[$j]["y"] . "," . $coordinatesArray[$j]["z"];
+						}
+						$e_coordinates = $doc->createElement("coordinates", $coordinates);
+						$e_outer_lr->appendChild($e_coordinates);
 						$e_outer->appendChild($e_outer_lr);
+						$e_geometry->appendChild($e_outer);
+						//TODO - fill out inner rings as holes
+						break;
 
-						for ($j = 0; $j < $currentPlacemark; $j++) {
-
-						}
-
-						$e_geometry->appendChild($e_coordinates);
-					outerBoundaryIs"}->{"LinearRing"}->{"coordinates
-
-						break;
-*/
 					case "KMLLine" :
 						if (count($pl_name_array) > 2) {
 							$pl_description = $pl_name_array[1];
@@ -230,7 +235,6 @@
 								$coordinates .= " ";
 							}
 							$coordinates .= $coordinatesArray[$j]["x"] . "," . $coordinatesArray[$j]["y"] . "," . $coordinatesArray[$j]["z"];
-
 						}
 						$e_coordinates = $doc->createElement("coordinates", $coordinates);
 						$e_geometry->appendChild($e_coordinates);
@@ -241,10 +245,200 @@
 						break;
 */
 				}
+				//check for properties
+				$currentProperties = $currentPlacemark->getProperties();
+				if (count($currentProperties) > 0) {
+					$e_ExtendedData = $doc->createElement("ExtendedData");
+				}
+				//read out attribute information
+				//initial geojson style handling
+				$currentPropertiesSimpleStyle = array();
+				foreach($currentProperties as $key => $value){
+					$e_Data = $doc->createElement("Data");
+					$e_value = $doc->createElement("value");
+					$e_Data->setAttribute("name", $key);
+					if (isset($value)) {
+						$e_DataValue = $doc->createTextNode($value);
+					} else {
+						$e_DataValue = $doc->createTextNode('null');
+					}
+					$e_value->appendChild($e_DataValue);
+					$e_Data->appendChild($e_value);
+					$e_ExtendedData->appendChild($e_Data);
+					//
+				}
+				//parse styling information from simplestyle spec to define it in header of kml
+				//switch for geometry type
+				switch ($currentPlacemark->getGeometryType()) {
+					case "KMLPoint" :
+						foreach($geoJsonStyleInfo->point->simple_style_spec_attributes as $attributeKey => $attributeValue) {
+							//if (array_key_exists($attributeValue, $currentProperties)) {
+								if (isset($currentProperties[$attributeValue])) {
+									$value = $currentProperties[$attributeValue];
+								} else {
+									//set default value!
+									$value = $geoJsonStyleInfo->point->simple_style_spec_defaults[$attributeKey];
+								}
+							//}
+							$currentPropertiesSimpleStyle[$attributeValue] = $value;
+						}
+						//build style part
+						$hash = md5('point'.$currentPropertiesSimpleStyle['marker-size'].$currentPropertiesSimpleStyle['marker-symbol'].$currentPropertiesSimpleStyle['marker-color']);
+						if (!in_array($hash, $styleHashArray)) {
+							//generate style part
+							$e_Style = $doc->createElement("Style");
+							$e_Style->setAttribute("id", $hash);
+							$e_IconStyle = $doc->createElement("IconStyle");
+
+							$e_Icon = $doc->createElement("Icon");
+
+							$e_href = $doc->createElement("href");
+							
+							$makiUrl = "https://raw.githubusercontent.com/mapbox/maki/master/icons/";
+							switch($currentPropertiesSimpleStyle['marker-size']) {
+								case "medium":
+									$symbol = $makiUrl.$currentPropertiesSimpleStyle['marker-symbol']."-11.svg";
+									break;
+								case "smal":
+									$symbol = $makiUrl.$currentPropertiesSimpleStyle['marker-symbol']."-11.svg";
+									break;
+								default :
+									$symbol = $makiUrl.$currentPropertiesSimpleStyle['marker-symbol']."-15.svg";
+									break;
+							}							
+							
+							$e_hrefText = $doc->createTextNode($symbol);
+							$e_href->appendChild($e_hrefText);
+							$e_Icon->appendChild($e_href);
+							$e_IconStyle->appendChild($e_Icon);
+
+							$e_hotSpot = $doc->createElement("hotSpot");
+							$e_hotSpot->setAttribute("xunits", "fraction");
+							$e_hotSpot->setAttribute("yunits", "fraction");
+							$e_hotSpot->setAttribute("x", "0.5");
+							$e_hotSpot->setAttribute("y", "0.5");
+
+							/*$e_width = $doc->createElement("width");
+							$e_widthText = $doc->createTextNode($currentPropertiesSimpleStyle['stroke-width']);
+							$e_width->appendChild($e_widthText);
+							$e_LineStyle->appendChild($e_width);*/
+
+							$e_Style->appendChild($e_IconStyle);
+							$e_Style->appendChild($e_hotSpot);
+							//$e_document->appendChild($e_Style);
+							$styleArray[] = $e_Style;
+							$styleHashArray[] = $hash;							
+						}
+						$e_styleUrl = $doc->createElement("styleUrl");
+						$e_styleUrlText = $doc->createTextNode("#".$hash);
+						$e_styleUrl->appendChild($e_styleUrlText);
+						break;
+					case "KMLLine" :
+						foreach($geoJsonStyleInfo->linestring->simple_style_spec_attributes as $attributeKey => $attributeValue) {
+							//if (array_key_exists($attributeValue, $currentProperties)) {
+								if (isset($currentProperties[$attributeValue])) {
+									$value = $currentProperties[$attributeValue];
+								} else {
+									//set default value!
+									$value = $geoJsonStyleInfo->linestring->simple_style_spec_defaults[$attributeKey];
+								}
+							//}
+							$currentPropertiesSimpleStyle[$attributeValue] = $value;
+						}
+						//build style part
+						$hash = md5('linestring'.$currentPropertiesSimpleStyle['stroke'].$currentPropertiesSimpleStyle['stroke-opacity'].$currentPropertiesSimpleStyle['stroke-width']);
+						if (!in_array($hash, $styleHashArray)) {
+							//generate style part
+							$e_Style = $doc->createElement("Style");
+							$e_Style->setAttribute("id", $hash);
+							$e_LineStyle = $doc->createElement("LineStyle");
+
+							$e_color = $doc->createElement("color");
+							$e_colorText = $doc->createTextNode($currentPropertiesSimpleStyle['stroke']);
+							$e_color->appendChild($e_colorText);
+							$e_LineStyle->appendChild($e_color);
+
+							$e_width = $doc->createElement("width");
+							$e_widthText = $doc->createTextNode($currentPropertiesSimpleStyle['stroke-width']);
+							$e_width->appendChild($e_widthText);
+							$e_LineStyle->appendChild($e_width);
+
+							$e_Style->appendChild($e_LineStyle);
+							//$e_document->appendChild($e_Style);
+							$styleArray[] = $e_Style;
+							$styleHashArray[] = $hash;							
+						}
+						$e_styleUrl = $doc->createElement("styleUrl");
+						$e_styleUrlText = $doc->createTextNode("#".$hash);
+						$e_styleUrl->appendChild($e_styleUrlText);
+						break;
+					case "KMLPolygon":
+						foreach($geoJsonStyleInfo->polygon->simple_style_spec_attributes as $attributeKey => $attributeValue) {
+							//if (array_key_exists($attributeValue, $currentProperties)) {
+								if (isset($currentProperties[$attributeValue])) {
+									$value = $currentProperties[$attributeValue];
+								} else {
+									//set default value!
+									$value = $geoJsonStyleInfo->polygon->simple_style_spec_defaults[$attributeKey];
+								}
+							//}
+							$currentPropertiesSimpleStyle[$attributeValue] = $value;
+						}
+						//build style part
+						$hash = md5('polygon'.$currentPropertiesSimpleStyle['stroke'].$currentPropertiesSimpleStyle['stroke-opacity'].$currentPropertiesSimpleStyle['stroke-width']);
+						if (!in_array($hash, $styleHashArray)) {
+							//generate style part
+							$e_Style = $doc->createElement("Style");
+							$e_Style->setAttribute("id", $hash);
+							$e_LineStyle = $doc->createElement("LineStyle");
+
+							$e_color = $doc->createElement("color");
+							$e_colorText = $doc->createTextNode($currentPropertiesSimpleStyle['stroke']);
+							$e_color->appendChild($e_colorText);
+							$e_LineStyle->appendChild($e_color);
+
+							$e_width = $doc->createElement("width");
+							$e_widthText = $doc->createTextNode($currentPropertiesSimpleStyle['stroke-width']);
+							$e_width->appendChild($e_widthText);
+							$e_LineStyle->appendChild($e_width);
+
+							$e_Style->appendChild($e_LineStyle);
+
+							//polystyle
+							//<PolyStyle><color>7fff44ff</color></PolyStyle>
+							$e_PolyStyle = $doc->createElement("PolyStyle");
+							$e_color = $doc->createElement("color");
+							$e_colorText = $doc->createTextNode($currentPropertiesSimpleStyle['fill']);
+							$e_color->appendChild($e_colorText);
+							$e_PolyStyle->appendChild($e_color);
+							$e_Style->appendChild($e_PolyStyle);
+							//$e_document->appendChild($e_Style);
+							$styleArray[] = $e_Style;
+							$styleHashArray[] = $hash;							
+						}
+						$e_styleUrl = $doc->createElement("styleUrl");
+						$e_styleUrlText = $doc->createTextNode("#".$hash);
+						$e_styleUrl->appendChild($e_styleUrlText);
+						break;
+				}
+				//overwrite name and description with info from geojson simplestyle spec
+				//if (!isset($pl_name)) {
+					$pl_name = $currentPropertiesSimpleStyle['title'];
+				//}
+				//if (!isset($pl_description)) {
+					$pl_description = $currentPropertiesSimpleStyle['description'];
+				//}
 				// create a placemark tag with a geometry and add it to the document
+
 				if ($e_geometry) {
 					$e_placemark = $doc->createElement("Placemark");
+					if ($e_ExtendedData) {
+						$e_placemark->appendChild($e_ExtendedData);
+					}
 					$e_placemark->appendChild($e_geometry);
+					if ($e_styleUrl) {
+						$e_placemark->appendChild($e_styleUrl);
+					}
 					if ($pl_name) {
 						$e_pl_name = $doc->createElement("name", $pl_name);
 						$e_placemark->appendChild($e_pl_name);
@@ -253,9 +447,15 @@
 						$e_pl_description = $doc->createElement("description", $pl_description);
 						$e_placemark->appendChild($e_pl_description);
 					}
-					$e_document->appendChild($e_placemark);
+					$placemarkArray[] = $e_placemark;
 				}
 			}
+			foreach($styleArray as $style) {
+					$e_document->appendChild($style);
+			}
+			foreach($placemarkArray as $placemark) {
+					$e_document->appendChild($placemark);
+			}
 			$this->kml = $doc->saveXML();
 		}
 		return $this->kml;

Modified: trunk/mapbender/http/classes/class_kml_parser_ows.php
===================================================================
--- trunk/mapbender/http/classes/class_kml_parser_ows.php	2018-01-04 14:17:38 UTC (rev 9839)
+++ trunk/mapbender/http/classes/class_kml_parser_ows.php	2018-01-05 12:27:47 UTC (rev 9840)
@@ -38,12 +38,9 @@
 	}
 
 	public function parseGeoJSON ($geoJSON, $kmlId) {
-
-//		$e = new mb_notice("GEOJSON: " . $geoJSON);
 		$json = new Mapbender_JSON();
 		$geometryFromGeoJSON = $json->decode($geoJSON);
 		$id = 0;
-
 		if (gettype($geometryFromGeoJSON) == "object" && $geometryFromGeoJSON->type == "FeatureCollection") {
 			if ($geometryFromGeoJSON->crs->type == "EPSG" && $geometryFromGeoJSON->crs->properties->code) {
 				$epsg = $geometryFromGeoJSON->crs->properties->code;
@@ -57,12 +54,12 @@
 						$epsg = $feature->geometry->crs->properties->code;
 					}
 					if (!$epsg) {
-						$e = new mb_notice("EPSG is not set! Aborting...(" . $epsg . ")");
-					$currentGeometry = false;
+						$e = new mb_exception("EPSG is not set defaults to 4326!");
+						//$currentGeometry = false;
+						$epsg = "4326";
 					}
 					$geometry = $feature->geometry;
-
-					//TODO: missing Polygon and MultiGeometry
+					//TODO: missing MultiGeometry
 					switch ($geometry->type) {
 						case "LineString" :
 							$coordinateList = "";
@@ -70,24 +67,79 @@
 								if ($j > 0) {
 									$coordinateList .= " ";
 								}
+								//add zero altitude if only two dimensions are given
+								if (count($geometry->coordinates[$j]) == 2) {
+									$geometry->coordinates[$j][] = 0;
+								}
 								$coordinateList .= implode(",", $geometry->coordinates[$j]);
 							}
 							$currentGeometry = new KMLLine($coordinateList, $epsg);
 							break;
 						case "Point" :
+							//add zero altitude if only two dimensions are given
+							if (count($geometry->coordinates) == 2) {
+								$geometry->coordinates[] = 0;
+							}
 							$coordinateList = implode(",", $geometry->coordinates);
 							$currentGeometry = new KMLPoint($coordinateList, $epsg);
 							break;
+						case "Polygon" :
+							//
+							$coordinateList = "";
+							$countLinearRings = count($geometry->coordinates);
+							if ($countLinearRings == 0) {
+
+							} elseif ($countLinearRings == 1) {
+								for ($j = 0; $j < count($geometry->coordinates[0]); $j++) {
+									if ($j > 0) {
+										$coordinateList .= " ";
+									}
+									//add zero altitude if only two dimensions are given
+									if (count($geometry->coordinates[0][$j]) == 2) {
+										$geometry->coordinates[0][$j][] = 0;
+									}
+									$coordinateList .= implode(",", $geometry->coordinates[0][$j]);
+								}
+								$outerRing = new KMLLinearRing($coordinateList, $epsg);
+								$currentGeometry = new KMLPolygon($outerRing);
+							} elseif ($countLinearRings > 1) {
+								for ($j = 0; $j < count($geometry->coordinates[0]); $j++) {
+									if ($j > 0) {
+										$coordinateList .= " ";
+									}
+									//add zero altitude if only two dimensions are given
+									if (count($geometry->coordinates[0][$j]) == 2) {
+										$geometry->coordinates[0][$j][] = 0;
+									}
+									$coordinateList .= implode(",", $geometry->coordinates[0][$j]);
+								}
+								$outerRing = new KMLLinearRing($coordinateList, $epsg);
+								$currentGeometry = new KMLPolygon($outerRing);
+								for ($k = 1; $k < $countLinearRings; $k++) {
+									for ($j = 0; $j < count($geometry->coordinates[$k]); $j++) {
+										if ($j > 0) {
+											$coordinateList .= " ";
+										}
+										//add zero altitude if only two dimensions are given
+										if (count($geometry->coordinates[$k][$j]) == 2) {
+											$geometry->coordinates[$k][$j][] = 0;
+										}
+										$coordinateList .= implode(",", $geometry->coordinates[$k][$j]);
+									}
+									$innerRing = new KMLLinearRing($coordinateList, $epsg);
+									$currentGeometry->appendInnerBoundary($innerRing);
+								}
+							}							
+							break;
 					}
 
 					if ($currentGeometry) {
 						$currentPlacemark = new KMLPlacemark($currentGeometry);
-
 						if (gettype($feature->properties) == "object") {
-
 							foreach ($feature->properties as $key => $value) {
 								$currentPlacemark->setProperty($key, $value);
 							}
+							//some specific values
 							$currentPlacemark->setProperty("Mapbender:kml", true);
 							$currentPlacemark->setProperty("Mapbender:name", "unknown");
 							$currentPlacemark->setProperty("Mapbender:id", $kmlId);

Modified: trunk/mapbender/http/classes/class_kml_polygon.php
===================================================================
--- trunk/mapbender/http/classes/class_kml_polygon.php	2018-01-04 14:17:38 UTC (rev 9839)
+++ trunk/mapbender/http/classes/class_kml_polygon.php	2018-01-05 12:27:47 UTC (rev 9840)
@@ -4,19 +4,19 @@
  * @link 		http://www.mapbender.org/index.php/class_wmc.php
  * @copyright 	2002 CCGIS 
  * @license		http://opensource.org/licenses/gpl-license.php
- * 				This program is free software; you can redistribute it and/or modify
- * 				it under the terms of the GNU General Public License as published by
- * 				the Free Software Foundation; either version 2, or (at your option)
- * 				any later version.
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
  *
- * 				This program is distributed in the hope that it will be useful,
- * 				but WITHOUT ANY WARRANTY; without even the implied warranty of
- * 				MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * 				GNU General Public License for more details.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
  * 
- * 				You should have received a copy of the GNU General Public License
- * 				along with this program; if not, write to the Free Software
- * 				Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  */
 
 require_once(dirname(__FILE__)."/../../core/globalSettings.php");
@@ -32,7 +32,7 @@
 class KMLPolygon extends KMLGeometry {
 
 	/**
-	 * @param 	KMLLinearRing	$aLinearRing	the outer ring of the polygon
+	 * @param KMLLinearRing	$aLinearRing the outer ring of the polygon
 	 */
 	public function __construct ($aLinearRing) {
 		if ($aLinearRing instanceof KMLLinearRing) {
@@ -44,7 +44,7 @@
 	}
 
 	/**
-	 * @return	string	a string representation of the object, currently 
+	 * @return string a string representation of the object, currently 
 	 * 					{@link http://www.geojson.org GeoJSON}
 	 */
 	public function __toString() {
@@ -52,7 +52,7 @@
 	}
 	
 	/**
-	 * @return	string	the geoJSON representation of the object
+	 * @return string the geoJSON representation of the object
 	 */
 	public function toGeoJSON () {
 		if ($this->outerBoundary !== null) {
@@ -78,8 +78,8 @@
 	/**
 	 * Cuts a hole in the polygon.
 	 * 
-	 * @param	KMLLinearRing	$aLinearRing	the linear ring describing the hole that is being cut.
-	 * @return	bool							true, if the parameter is a linear ring; else false
+	 * @param KMLLinearRing $aLinearRing the linear ring describing the hole that is being cut.
+	 * @return bool true, if the parameter is a linear ring; else false
 	 */
 	public function appendInnerBoundary ($aLinearRing) {
 		if ($aLinearRing instanceof KMLLinearRing) {
@@ -105,7 +105,7 @@
 	}
 
 	/**
-	 * @var	KMLLinearRing	The outer boundary of the polygon
+	 * @var	KMLLinearRing The outer boundary of the polygon
 	 */
 	private $outerBoundary;
 
@@ -113,5 +113,20 @@
 	 * @var	KMLLinearRing[]	The inner boundaries (holes) of the polygon
 	 */
 	private $innerBoundaryArray = array();
+
+	/**
+	 * @return outerBoundary
+	 */
+	public function getOuterBoundary () {
+		return $this->outerBoundary;
+	}
+
+	/**
+	 * @return innerBoundaryArray
+	 */
+	public function getInnerBoundaryArray () {
+		return $this->innerBoundaryArray;
+	}
+
 }
 ?>



More information about the Mapbender_commits mailing list