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

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Wed Feb 6 06:34:24 PST 2019


Author: armin11
Date: 2019-02-06 06:34:24 -0800 (Wed, 06 Feb 2019)
New Revision: 10051

Modified:
   trunk/mapbender/http/classes/class_wfs.php
Log:
rewind some things - have to be tested

Modified: trunk/mapbender/http/classes/class_wfs.php
===================================================================
--- trunk/mapbender/http/classes/class_wfs.php	2019-02-06 14:16:45 UTC (rev 10050)
+++ trunk/mapbender/http/classes/class_wfs.php	2019-02-06 14:34:24 UTC (rev 10051)
@@ -93,26 +93,12 @@
 	}
 	
 	protected function getFeatureGet ($featureTypeName, $filter, $maxFeatures=null) {
-		switch ($this->getVersion()) {
-			case "2.0.2":
-				$typeNameParameterName = "typeNames";
-				$maxFeaturesParameterName = "COUNT";
-				break;
-			case "2.0.0":
-				$typeNameParameterName = "typeNames";
-				$maxFeaturesParameterName = "COUNT";
-				break;
-			default:
-				$typeNameParameterName = "typeName";
-				$maxFeaturesParameterName = "MAXFEATURES";
-				break;
-		}
 		$url = $this->getFeature .
 				$this->getConjunctionCharacter($this->getFeature) . 
 				"service=WFS&request=getFeature&version=" . 
-				$this->getVersion() . "&".strtolower($typeNameParameterName)."=" . $featureTypeName;
+				$this->getVersion() . "&typename=" . $featureTypeName;
 		if ($maxFeatures != null) {
-			$url .= "&".$maxFeaturesParameterName."=".$maxFeatures;
+			$url .= "&MAXFEATURES=".$maxFeatures;
 		}
 		if ($filter != null) {
 				$url .= "&filter=" . urlencode($filter);
@@ -122,20 +108,6 @@
 	}
 	
 	protected function getFeaturePost ($featureTypeName, $filter, $destSrs, $storedQueryId, $storedQueryParams, $maxFeatures) {
-		switch ($this->getVersion()) {
-			case "2.0.2":
-				$typeNameParameterName = "typeNames";
-				$maxFeaturesParameterName = "COUNT";
-				break;
-			case "2.0.0":
-				$typeNameParameterName = "typeNames";
-				$maxFeaturesParameterName = "COUNT";
-				break;
-			default:
-				$typeNameParameterName = "typeName";
-				$maxFeaturesParameterName = "MAXFEATURES";
-				break;
-		}
 		if($storedQueryId && $storedQueryId != "") {
 			$postData = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" .
 					"<wfs:GetFeature service=\"WFS\" version=\"" . $this->getVersion() . "\" " .
@@ -192,16 +164,22 @@
 				$postData .= "xmlns:" . $ns . "=\"" . $url . "\" ";
 					
 			}
-			if($this->getVersion() == "2.0.0" || $this->getVersion() == "2.0.2") {
+			if($this->getVersion() == "2.0.0") {
 				//change filter to fes syntax
 				$filter = str_replace("<ogc", "<fes", $filter);
 				$filter = str_replace("/ogc", "/fes", $filter);
+				$filter = str_replace("PropertyName", "ValueReference", $filter);
+				$postData .= "typeNames=\"" . $featureTypeName . "\">" .
+						$filter .
+						"</wfs:Query>";
 			}
-			$filter = str_replace("PropertyName", "ValueReference", $filter);
-			$postData .= $typeNameParameterName."=\"" . $featureTypeName . "\">" .
-					$filter .
-					"</wfs:Query>";
+			else {
+				$postData .= "typeName=\"" . $featureTypeName . "\">" .
+						$filter .
+						"</wfs:Query>";
+			}
 		}
+		
 		$postData .= "</wfs:GetFeature>";	
                 $e = new mb_notice("class_wfs.php: getFeaturePost: ".$postData);
 	        if ($filter == null) {
@@ -214,7 +192,7 @@
 			}
 		} else {
 			if (is_int($maxFeatures)) {
-				return $this->post($this->getFeature."&".$maxFeaturesParameterName."=".$maxFeatures, $postData); //from class_ows!
+				return $this->post($this->getFeature."&MAXFEATURES=".$maxFeatures, $postData); //from class_ows!
 			} else {
 				return $this->post($this->getFeature, $postData); //from class_ows!
 			}



More information about the Mapbender_commits mailing list