[Mapbender-commits] r8247 - branches/2.7/http/classes
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Mon Feb 13 11:47:11 EST 2012
Author: astrid_emde
Date: 2012-02-13 08:47:11 -0800 (Mon, 13 Feb 2012)
New Revision: 8247
Modified:
branches/2.7/http/classes/class_wms.php
Log:
WMS 1.3.0: handle EX_GEOGRAPHICBOUNDINGBOX from WMS 1.3.0, switch coords for geogr. Coords >= 4000 <5000
Modified: branches/2.7/http/classes/class_wms.php
===================================================================
--- branches/2.7/http/classes/class_wms.php 2012-02-13 16:44:56 UTC (rev 8246)
+++ branches/2.7/http/classes/class_wms.php 2012-02-13 16:47:11 UTC (rev 8247)
@@ -559,6 +559,7 @@
$request = null;
$layer_style = array();
$cnt_styles = -1;
+ $section_bbox = null;
$this->wms_getfeatureinfo = "";
$this->gui_wms_featureinfoformat = "";
@@ -918,6 +919,27 @@
if(mb_strtoupper($element[tag]) == "CRS"){
// unique srs only, see http://www.mapbender.org/index.php/Arrays_with_unique_entries
$this->wms_srs = array_keys(array_flip(array_merge($this->wms_srs, explode(" ", strtoupper($element[value])))));
+ }
+ #WMS 1.3.0
+ if(mb_strtoupper($element[tag]) == "EX_GEOGRAPHICBOUNDINGBOX" && $element[type] == "open"){
+ $section_bbox = "ex_geographicboundingbox";
+ }
+ if($section_bbox == "ex_geographicboundingbox" && mb_strtoupper($element[tag]) == "WESTBOUNDLONGITUDE"){
+ $cnt_epsg++;
+ $this->objLayer[$cnt_layer]->layer_epsg[$cnt_epsg]["epsg"] = "EPSG:4326";
+ $this->objLayer[$cnt_layer]->layer_epsg[$cnt_epsg]["minx"] = trim($element[value]);
+ }
+ if($section_bbox == "ex_geographicboundingbox" && mb_strtoupper($element[tag]) == "SOUTHBOUNDLATITUDE"){
+ $this->objLayer[$cnt_layer]->layer_epsg[$cnt_epsg]["miny"] = trim($element[value]);
+ }
+ if($section_bbox == "ex_geographicboundingbox" && mb_strtoupper($element[tag]) == "EASTBOUNDLONGITUDE"){
+ $this->objLayer[$cnt_layer]->layer_epsg[$cnt_epsg]["maxx"] = trim($element[value]);
+ }
+ if($section_bbox == "ex_geographicboundingbox" && mb_strtoupper($element[tag]) == "NORTHBOUNDLATITUDE"){
+ $this->objLayer[$cnt_layer]->layer_epsg[$cnt_epsg]["maxy"] = trim($element[value]);
+ }
+ if(mb_strtoupper($element[tag]) == "GEOGRAPHICBOUNDINGBOX" && $element[type] == "close"){
+ $section_bbox = "";
}
if(mb_strtoupper($element[tag]) == "LATLONBOUNDINGBOX"){
$cnt_epsg++;
@@ -945,20 +967,29 @@
&& $this->wms_version == "1.3.0"){
$cnt_epsg++;
$this->objLayer[$cnt_layer]->layer_epsg[$cnt_epsg]["epsg"] = $element[attributes][CRS];
- $this->objLayer[$cnt_layer]->layer_epsg[$cnt_epsg]["minx"] = $element[attributes][minx];
- $this->objLayer[$cnt_layer]->layer_epsg[$cnt_epsg]["miny"] = $element[attributes][miny];
- $this->objLayer[$cnt_layer]->layer_epsg[$cnt_epsg]["maxx"] = $element[attributes][maxx];
- $this->objLayer[$cnt_layer]->layer_epsg[$cnt_epsg]["maxy"] = $element[attributes][maxy];
+ $this->objLayer[$cnt_layer]->layer_epsg[$cnt_epsg]["minx"] = $element[attributes][miny];
+ $this->objLayer[$cnt_layer]->layer_epsg[$cnt_epsg]["miny"] = $element[attributes][minx];
+ $this->objLayer[$cnt_layer]->layer_epsg[$cnt_epsg]["maxx"] = $element[attributes][maxy];
+ $this->objLayer[$cnt_layer]->layer_epsg[$cnt_epsg]["maxy"] = $element[attributes][maxx];
}
#WMS 1.3.0
if(mb_strtoupper($element[tag]) == "BOUNDINGBOX" && $element[attributes][CRS] != "EPSG:4326"
&& $this->wms_version == "1.3.0"){
$cnt_epsg++;
$this->objLayer[$cnt_layer]->layer_epsg[$cnt_epsg]["epsg"] = $element[attributes][CRS];
- $this->objLayer[$cnt_layer]->layer_epsg[$cnt_epsg]["minx"] = $element[attributes][minx];
- $this->objLayer[$cnt_layer]->layer_epsg[$cnt_epsg]["miny"] = $element[attributes][miny];
- $this->objLayer[$cnt_layer]->layer_epsg[$cnt_epsg]["maxx"] = $element[attributes][maxx];
- $this->objLayer[$cnt_layer]->layer_epsg[$cnt_epsg]["maxy"] = $element[attributes][maxy];
+ $tmp_epsg = $element[attributes][CRS];
+ $tmp_epsg = str_replace('CR:','',str_replace ( 'EPSG:', '', $tmp_epsg ));
+ if ($tmp_epsg >= 4000 && $tmp_epsg < 5000){
+ $this->objLayer[$cnt_layer]->layer_epsg[$cnt_epsg]["minx"] = $element[attributes][miny];
+ $this->objLayer[$cnt_layer]->layer_epsg[$cnt_epsg]["miny"] = $element[attributes][minx];
+ $this->objLayer[$cnt_layer]->layer_epsg[$cnt_epsg]["maxx"] = $element[attributes][maxy];
+ $this->objLayer[$cnt_layer]->layer_epsg[$cnt_epsg]["maxy"] = $element[attributes][maxx];
+ }else{
+ $this->objLayer[$cnt_layer]->layer_epsg[$cnt_epsg]["minx"] = $element[attributes][minx];
+ $this->objLayer[$cnt_layer]->layer_epsg[$cnt_epsg]["miny"] = $element[attributes][miny];
+ $this->objLayer[$cnt_layer]->layer_epsg[$cnt_epsg]["maxx"] = $element[attributes][maxx];
+ $this->objLayer[$cnt_layer]->layer_epsg[$cnt_epsg]["maxy"] = $element[attributes][maxy];
+ }
// a default epsg for mapbender
if($cnt_layer == 0 && $this->default_epsg == 0 && mb_strlen(trim($element[attributes][SRS]))>= 10){
$this->default_epsg = $cnt_epsg;
More information about the Mapbender_commits
mailing list