[Mapbender-commits] r10193 - in trunk/mapbender/http: classes php

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Fri Aug 2 00:01:58 PDT 2019


Author: armin11
Date: 2019-08-02 00:01:58 -0700 (Fri, 02 Aug 2019)
New Revision: 10193

Modified:
   trunk/mapbender/http/classes/class_cswClient.php
   trunk/mapbender/http/php/mod_callCswMetadata.php
Log:
First fix for spatial search via csw: https://ies-svn.jrc.ec.europa.eu/issues/3658

Modified: trunk/mapbender/http/classes/class_cswClient.php
===================================================================
--- trunk/mapbender/http/classes/class_cswClient.php	2019-08-01 09:32:44 UTC (rev 10192)
+++ trunk/mapbender/http/classes/class_cswClient.php	2019-08-02 07:01:58 UTC (rev 10193)
@@ -140,7 +140,7 @@
     				$postRequest .= '<csw:Query typeNames="csw:Record">';
 				$postRequest .= '<csw:ElementSetName>full</csw:ElementSetName>'; //full to get all queryables?
 				if ($recordtype !== false) {
-            				$postRequest .= '<csw:Constraint version="1.0.0">';
+            				$postRequest .= '<csw:Constraint version="1.1.0">';
                 			$postRequest .= '<ogc:Filter>';
 					if ($additionalFilter !== false) {
 						$postRequest .= '<ogc:And>';
@@ -178,7 +178,7 @@
             				$postRequest .= '</csw:Constraint>';
 				} else {
 					if ($additionalFilter !== false) {
-						$postRequest .= '<csw:Constraint version="1.0.0">';
+						$postRequest .= '<csw:Constraint version="1.1.0">';
                 				$postRequest .= '<ogc:Filter>';
 						$postRequest .= $additionalFilter;
 						$postRequest .= '</ogc:Filter>';
@@ -211,7 +211,7 @@
 				$postRequest = '<?xml version="1.0" encoding="UTF-8"?>';
 				$postRequest .= '<csw:Transaction service="CSW" version="2.0.2" xmlns:csw="http://www.opengis.net/cat/csw/2.0.2" xmlns:ogc="http://www.opengis.net/ogc" xmlns:apiso="http://www.opengis.net/cat/csw/apiso/1.0" xmlns:gml="http://www.opengis.net/gml">';
     				$postRequest .= '<csw:Delete>';
-            			$postRequest .= '<csw:Constraint version="1.0.0">';
+            			$postRequest .= '<csw:Constraint version="1.1.0">';
                 		$postRequest .= '<ogc:Filter>';
                     		$postRequest .= '<ogc:PropertyIsLike wildCard="%" singleChar="_" escapeChar="/">';
                        		$postRequest .= ' <ogc:PropertyName>apiso:Identifier</ogc:PropertyName>';
@@ -231,7 +231,7 @@
     				$postRequest .= '<csw:Query typeNames="csw:Record">';
 				$postRequest .= '<csw:ElementSetName>full</csw:ElementSetName>'; //full to get all queryables?
 				if ($recordtype !== false) {
-            				$postRequest .= '<csw:Constraint version="1.0.0">';
+            				$postRequest .= '<csw:Constraint version="1.1.0">';
                 			$postRequest .= '<ogc:Filter>';
 					if ($additionalFilter !== false) {
 						$postRequest .= '<ogc:And>';
@@ -261,7 +261,7 @@
             				$postRequest .= '</csw:Constraint>';
 				} else {
 					if ($additionalFilter !== false) {
-						$postRequest .= '<csw:Constraint version="1.0.0">';
+						$postRequest .= '<csw:Constraint version="1.1.0">';
                 				$postRequest .= '<ogc:Filter>';
 						$postRequest .= $additionalFilter;
 						$postRequest .= '</ogc:Filter>';
@@ -288,7 +288,7 @@
 					//$postRequest .= '<csw:ElementSetName>summary</csw:ElementSetName>';
 					$postRequest .= '<csw:ElementSetName>full</csw:ElementSetName>';
 					if ($recordtype !== false) {
-            					$postRequest .= '<csw:Constraint version="1.0.0">';
+            					$postRequest .= '<csw:Constraint version="1.1.0">';
                 				$postRequest .= '<ogc:Filter>';
 						if ($additionalFilter !== false) {
 							$postRequest .= '<ogc:And>';
@@ -318,7 +318,7 @@
             					$postRequest .= '</csw:Constraint>';
 					} else {
 						if ($additionalFilter !== false) {
-							$postRequest .= '<csw:Constraint version="1.0.0">';
+							$postRequest .= '<csw:Constraint version="1.1.0">';
                 					$postRequest .= '<ogc:Filter>';
 							$postRequest .= $additionalFilter;
 							$postRequest .= '</ogc:Filter>';
@@ -498,7 +498,7 @@
 			$cswInterfaceObject = new connector();
 			$cswInterfaceObject->set('httpType','POST');
 			$postData = stripslashes($postData);
-			//$e = new mb_exception("classes/class_cswClient.php: post xml: ".$postData);
+			$e = new mb_exception("classes/class_cswClient.php: post xml: ".$postData);
 			$dataXMLObject = new SimpleXMLElement($postData);
 			$postData = $dataXMLObject->asXML();
 			//$e = new mb_exception($postData);

Modified: trunk/mapbender/http/php/mod_callCswMetadata.php
===================================================================
--- trunk/mapbender/http/php/mod_callCswMetadata.php	2019-08-01 09:32:44 UTC (rev 10192)
+++ trunk/mapbender/http/php/mod_callCswMetadata.php	2019-08-02 07:01:58 UTC (rev 10193)
@@ -237,6 +237,7 @@
 	echo 'Mandatory parameter <b>catalogueId</b> not set!<br/>';
 	die();
 }
+//example: &searchBbox=7.18159618172,50.2823608933,7.26750846535,50.3502633407
 if (isset($_REQUEST["searchBbox"]) & $_REQUEST["searchBbox"] != "") {
 	//validate to float/integer
 	$testMatch = $_REQUEST["searchBbox"];
@@ -530,10 +531,18 @@
 		$spatialFilter .= "<ogc:BBOX>";
     }
     $spatialFilter .= "<ogc:PropertyName>BoundingBox</ogc:PropertyName>";
-    $spatialFilter .= '<gml:Box xmlns:gml="http://www.opengis.net/gml" srsName="EPSG:4326">';
+
+    /*$spatialFilter .= '<gml:Box xmlns:gml="http://www.opengis.net/gml" srsName="EPSG:4326">';
     $spatialFilter .= '<gml:coordinates decimal="." cs="," ts=" ">';
     $spatialFilter .= $searchBboxArray[0].','.$searchBboxArray[1].' '.$searchBboxArray[2].','.$searchBboxArray[3];
-    $spatialFilter .= '</gml:coordinates></gml:Box>';
+    $spatialFilter .= '</gml:coordinates></gml:Box>';*/  
+
+    //Exchanged to support INSPIRE Discovery service: https://ies-svn.jrc.ec.europa.eu/issues/3658
+    $spatialFilter .= '<gml:Envelope srsName="EPSG:4326">';
+    $spatialFilter .= '<gml:lowerCorner>'.$searchBboxArray[0].' '.$searchBboxArray[1].'</gml:lowerCorner>';
+    $spatialFilter .= '<gml:upperCorner>'.$searchBboxArray[2].' '.$searchBboxArray[3].'</gml:upperCorner>';
+    $spatialFilter .= '</gml:Envelope>';
+
     switch ($searchTypeBbox) {
 	case "intersect":
 		$spatialFilter .= "</ogc:BBOX>";
@@ -555,7 +564,7 @@
     $additionalFilter = "<ogc:And>".$fullTextFilter.$spatialFilter."</ogc:And>";
 } else {
     if ($searchText == '' || $searchText == '*') {
-        $additionalFilter = false;
+        $additionalFilter = $spatialFilter;
     } else {
 	$additionalFilter = $fullTextFilter;
     }



More information about the Mapbender_commits mailing list