[Mapbender-commits] r9787 - trunk/mapbender/http/php
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Fri Sep 29 04:35:37 PDT 2017
Author: armin11
Date: 2017-09-29 04:35:37 -0700 (Fri, 29 Sep 2017)
New Revision: 9787
Modified:
trunk/mapbender/http/php/mod_inspireDownloadFeed.php
Log:
Fix for gml 3.2 bbox in case of wfs > 2.0
Modified: trunk/mapbender/http/php/mod_inspireDownloadFeed.php
===================================================================
--- trunk/mapbender/http/php/mod_inspireDownloadFeed.php 2017-09-29 11:06:02 UTC (rev 9786)
+++ trunk/mapbender/http/php/mod_inspireDownloadFeed.php 2017-09-29 11:35:37 UTC (rev 9787)
@@ -1358,9 +1358,68 @@
}*/
//echo count($bboxWfs[$mapbenderMetadata[$i]->featuretype_name]);
for ($l = 0; $l < count($bboxWfs[$mapbenderMetadata[$i]->featuretype_name]); $l++) {
+
//generate bbox Filter:
//<ogc:Filter xmlns:ogc="http://www.opengis.net/ogc"><ogc:BBOX><gml:Box xmlns:gml="http://www.opengis.net/gml" srsName="EPSG:3785"><gml:coordinates decimal="." cs="," ts=" ">-8033496.4863128,5677373.0653376 -7988551.5136872,5718801.9346624</gml:coordinates></gml:Box></ogc:BBOX></ogc:Filter>
-
+ /* fes="http://www.opengis.net/fes/2.0" xmlns:gml="http://www.opengis.net/gml/3.2"
+ <fes:Filter>
+ <fes:BBOX>
+ <fes:ValueReference>/RS1/geometry</fes:ValueReference>
+ <gml:Envelope srsName="urn:ogc:def:crs:EPSG::1234">
+ <gml:lowerCorner>10 10</gml:lowerCorner>
+ <gml:upperCorner>20 20</gml:upperCorner>
+ </gml:Envelope>
+ </fes:BBOX>
+ </fes:Filter>
+ */
+ $currentBbox = explode(',',$bboxWfs[$mapbenderMetadata[$i]->featuretype_name][$l]);
+ switch ($mapbenderMetadata[$i]->wfs_version) {
+ case "2.0.0":
+ $bboxFilter = '<fes:Filter xmlns:fes="http://www.opengis.net/fes/2.0"><fes:BBOX>';
+ $bboxFilter .= '<fes:PropertyName>'.$mapbenderMetadata[$i]->geometry_field_name[0].'</fes:PropertyName>';
+ //<gml:Envelope srsName="urn:ogc:def:crs:EPSG::1234">
+ $bboxFilter .= '<gml:Envelope xmlns:gml="http://www.opengis.net/gml/3.2" srsName="'.$crs'">';
+ //FIX for ESRI? TODO
+ $bboxFilter .= '<gml:lowerCorner>'.$currentBbox[0].' '.$currentBbox[1].'</gml:lowerCorner>';
+ $bboxFilter .= '<gml:upperCorner>'.$currentBbox[2].' '.$currentBbox[3].'</gml:upperCorner>';
+ $bboxFilter .= '</gml:Envelope>';
+ $bboxFilter .= '</fes:BBOX>';
+ $bboxFilter .= '</fes:Filter>';
+ $bboxFilter = rawurlencode(utf8_decode($bboxFilter));
+ break;
+ case "2.0.2":
+ $bboxFilter = '<fes:Filter xmlns:fes="http://www.opengis.net/fes/2.0"><fes:BBOX>';
+ $bboxFilter .= '<fes:PropertyName>'.$mapbenderMetadata[$i]->geometry_field_name[0].'</fes:PropertyName>';
+ //<gml:Envelope srsName="urn:ogc:def:crs:EPSG::1234">
+ $bboxFilter .= '<gml:Envelope xmlns:gml="http://www.opengis.net/gml/3.2" srsName="'.$crs'">';
+ //FIX for ESRI? TODO
+ $bboxFilter .= '<gml:lowerCorner>'.$currentBbox[0].' '.$currentBbox[1].'</gml:lowerCorner>';
+ $bboxFilter .= '<gml:upperCorner>'.$currentBbox[2].' '.$currentBbox[3].'</gml:upperCorner>';
+ $bboxFilter .= '</gml:Envelope>';
+ $bboxFilter .= '</fes:BBOX>';
+ $bboxFilter .= '</fes:Filter>';
+ $bboxFilter = rawurlencode(utf8_decode($bboxFilter));
+ break;
+ case "1.1.0":
+ $bboxFilter = '<ogc:Filter xmlns:ogc="http://www.opengis.net/ogc"><ogc:BBOX>';
+ //$bboxFilter = '<ogc:Filter xmlns:ogc="http://www.opengis.net/ogc" xmlns:gml="http://www.opengis.net/gml"><ogc:BBOX>';
+ //$bboxFilter .= '<gml:Box srsName="EPSG:'.$epsgId[1].'"';
+ $bboxFilter .= '<ogc:PropertyName>'.$mapbenderMetadata[$i]->geometry_field_name[0].'</ogc:PropertyName>';
+ $bboxFilter .= '<gml:Box xmlns:gml="http://www.opengis.net/gml" srsName="'.$crs.'">';
+ $bboxFilter .= '<gml:coordinates decimal="." cs="," ts=" ">';
+ //$currentBbox = explode(',',$bboxWfs[$mapbenderMetadata[$i]->featuretype_name][$l]);
+ $e = new mb_notice("Bounding box ".$l." : ".$l.$bboxWfs[$mapbenderMetadata[$i]->featuretype_name][$l]);
+ //fix for esri????? TODO check crs axes order handling
+ if (strtoupper($mapbenderMetadata[$i]->geometry_field_name[0] == "SHAPE")) {
+ $bboxFilter .= $currentBbox[1].','.$currentBbox[0].' '.$currentBbox[3].','.$currentBbox[2];
+ } else {
+ $bboxFilter .= $currentBbox[0].','.$currentBbox[1].' '.$currentBbox[2].','.$currentBbox[3];
+ }
+ $bboxFilter .= '</gml:coordinates></gml:Box></ogc:BBOX></ogc:Filter>';
+ $bboxFilter = rawurlencode(utf8_decode($bboxFilter));
+ break;
+ }
+ /*
//$bboxFilter = '<ogc:Filter><ogc:BBOX>';
$bboxFilter = '<ogc:Filter xmlns:ogc="http://www.opengis.net/ogc"><ogc:BBOX>';
//$bboxFilter = '<ogc:Filter xmlns:ogc="http://www.opengis.net/ogc" xmlns:gml="http://www.opengis.net/gml"><ogc:BBOX>';
@@ -1379,6 +1438,8 @@
}
$bboxFilter .= '</gml:coordinates></gml:Box></ogc:BBOX></ogc:Filter>';
$bboxFilter = rawurlencode(utf8_decode($bboxFilter));
+ */
+
//check if owsproxy is activated for wfs - if so, use absolute url of wfs
//e.g.: www.geoportal.rlp.de/registry/wfs/{wfs_id}? - important - there has to be one wfsconf defined and assigned!
if ($admin->getWFSOWSstring($mapbenderMetadata[$i]->wfs_id) == false) {
More information about the Mapbender_commits
mailing list