[Mapbender-commits] r9392 - trunk/mapbender/http/php

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Wed Jan 27 07:12:25 PST 2016


Author: armin11
Date: 2016-01-27 07:12:25 -0800 (Wed, 27 Jan 2016)
New Revision: 9392

Modified:
   trunk/mapbender/http/php/mod_inspireDownloadFeed.php
Log:
switch for evil esri wfs

Modified: trunk/mapbender/http/php/mod_inspireDownloadFeed.php
===================================================================
--- trunk/mapbender/http/php/mod_inspireDownloadFeed.php	2016-01-27 12:25:45 UTC (rev 9391)
+++ trunk/mapbender/http/php/mod_inspireDownloadFeed.php	2016-01-27 15:12:25 UTC (rev 9392)
@@ -1305,23 +1305,29 @@
 					//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>
 
-					$bboxFilter = '<Filter xmlns:gml="http://www.opengis.net/gml"><BBOX>';
+					//$bboxFilter = '<ogc:Filter><ogc:BBOX>';
+					$bboxFilter = '<ogc:Filter><ogc:BBOX srsName="EPSG:4326">';
+					//$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>the_geom</ogc:PropertyName>';//TODO parse DescribeFeatureType for geom property
 					$bboxFilter .= '<ogc:PropertyName>'.$mapbenderMetadata[$i]->geometry_field_name[0].'</ogc:PropertyName>';
 					$bboxFilter .= '<gml:Box>';
-					$bboxFilter .= '<gml:coordinates>';
+					$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]);
-					$bboxFilter .= $currentBbox[0].','.$currentBbox[1].' '.$currentBbox[2].','.$currentBbox[3];
-					$bboxFilter .= '</gml:coordinates></gml:Box></BBOX></Filter>';
-					$bboxFilter = urlencode($bboxFilter);
+					//fix for esri?????
+					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));
 
 					$gFLink = $mapbenderMetadata[$i]->wfs_getfeature."SERVICE=WFS&REQUEST=GetFeature&VERSION=";
 					$gFLink .= $mapbenderMetadata[$i]->wfs_version."&typeName=".$mapbenderMetadata[$i]->featuretype_name;
 					$gFLink .= "&maxFeatures=".$featureHits[$i]."&srsName=".$mapbenderMetadata[$i]->featuretype_srs;
-					if (count($mapbenderMetadata[$i]->output_formats) >= 1) {
+					if (count($mapbenderMetadata[$i]->output_formats) >= 1 && strtoupper($mapbenderMetadata[$i]->geometry_field_name[0] !== "SHAPE")) {
 						//use first output format which have been found - TODO - check if it should be pulled from featuretype instead from wfs 
 						$gFLink .= "&outputFormat=".urlencode($mapbenderMetadata[$i]->output_formats[0]);
 					}
@@ -1661,7 +1667,7 @@
 	//</entry>
 		$feed->appendChild($feedEntry);
 		//duplicate feed entry for other formats if one is given
-		if ($type == 'DATASET' && $generateFrom == 'wfs' && count($mapbenderMetadata[$i]->output_formats) > 1) {
+		if ($type == 'DATASET' && $generateFrom == 'wfs' && count($mapbenderMetadata[$i]->output_formats) > 1 && strtoupper($mapbenderMetadata[$i]->geometry_field_name[0] !== "SHAPE")) {
 			for ($j=1; $j < count($mapbenderMetadata[$i]->output_formats); $j++) {
 				$feedEntryCopy = $feedEntry;
 				$feedEntryCopyXml = $feedDoc->saveXML($feedEntry);
@@ -1893,11 +1899,11 @@
 							$mapbenderMetadata[$indexMapbenderMetadata]->geometry_field_name[] = $row['element_name'];
 							$e = new mb_notice("php/mod_inspireDownloadFeed.php: element_name of geometry field (type name like PropertyName) found: ".$row['element_name']);
 							break;
-						} else {
-							//set default value
-							$mapbenderMetadata[$indexMapbenderMetadata]->geometry_field_name[] = "the_geom";
 						}
 					}
+					if (count($mapbenderMetadata[$indexMapbenderMetadata]->geometry_field_name) < 1) {
+						$mapbenderMetadata[$indexMapbenderMetadata]->geometry_field_name[0] = "the_geom";
+					}
 				}
 				//overwrite mapbenderMetadata->minx ... which came from layer/featuretype metadata with bbox of metadata itself, if given
 				if (isset($mapbenderMetadata[$indexMapbenderMetadata]->metadata_bbox) && $mapbenderMetadata[$indexMapbenderMetadata]->metadata_bbox !== "") {



More information about the Mapbender_commits mailing list