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

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Mon Nov 6 06:19:47 PST 2017


Author: armin11
Date: 2017-11-06 06:19:47 -0800 (Mon, 06 Nov 2017)
New Revision: 9809

Modified:
   trunk/mapbender/http/classes/class_crs.php
Log:
Fix for crs handling of geoserver

Modified: trunk/mapbender/http/classes/class_crs.php
===================================================================
--- trunk/mapbender/http/classes/class_crs.php	2017-10-25 14:20:37 UTC (rev 9808)
+++ trunk/mapbender/http/classes/class_crs.php	2017-11-06 14:19:47 UTC (rev 9809)
@@ -93,17 +93,27 @@
 				$this->identifierCode = explode(':',$identifierNew)[1];			
 				return;
 			} else {
-				if (substr($identifier, 0, 31) === 'http://www.opengis.net/def/crs/') {
-					$identifierNew = str_replace('http://www.opengis.net/def/crs/','',$identifier);
-					//remaining string: ({OGC|EPSG}/{0}/{code})
+				//case urn:x-ogc:def:crs:EPSG:25832?? - geoserver
+                                if (substr(strtoupper($identifier), 0, 23) === "URN:X-OGC:DEF:CRS:EPSG:") {
+					//delete this part from original identifier
+					$identifierNew = str_replace('URN:X-OGC:DEF:CRS:EPSG:','',strtoupper($identifier));			
 					$this->identifier = $identifier;
-					$this->identifierType = 'url';
-					$this->identifierCode = explode('/',$identifierNew)[2];
-					return;
+					$this->identifierType = 'urn';
+					$this->identifierCode = $identifierNew;	
+					return; 
 				} else {
-					$this->identifier = $identifier;
-					$this->identifierType = 'other';
-					$this->identifierCode = $identifier;
+					if (substr($identifier, 0, 31) === 'http://www.opengis.net/def/crs/') {
+						$identifierNew = str_replace('http://www.opengis.net/def/crs/','',$identifier);
+						//remaining string: ({OGC|EPSG}/{0}/{code})
+						$this->identifier = $identifier;
+						$this->identifierType = 'url';
+						$this->identifierCode = explode('/',$identifierNew)[2];
+						return;
+					} else {
+						$this->identifier = $identifier;
+						$this->identifierType = 'other';
+						$this->identifierCode = $identifier;
+					}
 				}
 			}
 		}



More information about the Mapbender_commits mailing list