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

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Thu Nov 16 08:26:38 PST 2017


Author: armin11
Date: 2017-11-16 08:26:38 -0800 (Thu, 16 Nov 2017)
New Revision: 9817

Modified:
   trunk/mapbender/http/classes/class_iso19139.php
   trunk/mapbender/http/php/wms.php
Log:
Fix for INSPIRE unique resource identifier handling

Modified: trunk/mapbender/http/classes/class_iso19139.php
===================================================================
--- trunk/mapbender/http/classes/class_iso19139.php	2017-11-14 16:33:02 UTC (rev 9816)
+++ trunk/mapbender/http/classes/class_iso19139.php	2017-11-16 16:26:38 UTC (rev 9817)
@@ -312,8 +312,15 @@
 					$this->datasetId = $explodedUrl[count($explodedUrl) - 1];
 					$this->datasetIdCodeSpace = rtrim($code[0], $this->datasetId);	
 				} else {
-					$this->datasetId = $code[0];
-					$this->datasetIdCodeSpace = "";	
+					if (($parsedUrl['scheme'] == 'http' || $parsedUrl['scheme'] == 'https') && strpos($code[0],'#') !== false) {
+						$e = new mb_exception($code[0]);
+						$explodedUrl = explode('#', $code[0]);
+						$this->datasetId = $explodedUrl[1];
+						$this->datasetIdCodeSpace = $explodedUrl[0];
+					} else {
+						$this->datasetId = $code[0];
+						$this->datasetIdCodeSpace = "";	
+					}
 				}
 			} else { //try to read code from RS_Identifier 		
 				$code = $iso19139Xml->xpath('//gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:citation/gmd:CI_Citation/gmd:identifier/gmd:RS_Identifier/gmd:code/gco:CharacterString');

Modified: trunk/mapbender/http/php/wms.php
===================================================================
--- trunk/mapbender/http/php/wms.php	2017-11-14 16:33:02 UTC (rev 9816)
+++ trunk/mapbender/http/php/wms.php	2017-11-16 16:26:38 UTC (rev 9817)
@@ -165,24 +165,12 @@
 $AuthorityName = $metadataContactGroup["mb_group_name"];
 //TODO: Problem - there is no single codespace if datasets have different ones !!!! - Find a generic solution  
 //$uniqueResourceIdentifierCodespace = $admin->getIdentifierCodespaceFromRegistry($departmentMetadata, $row_metadata);
+$metadataArray['datasetid_codespace'] = "";
+$AuthorityUrl = $admin->getIdentifierCodespaceFromRegistry($metadataContactGroup, $metadataArray);
 
-//check for given urls
-if (isset($metadataContactGroup["mb_group_registry_url"]) && $metadataContactGroup["mb_group_registry_url"] !== "") {
-	$AuthorityUrl = $metadataContactGroup["mb_group_registry_url"];
-} else {
-	$AuthorityUrl = $metadataContactGroup["mb_group_homepage"];
-}
-
 if ($AuthorityName == '') {
 	$AuthorityName = "defaultauthority";
 }
-if ($AuthorityUrl == '') {
-	if (defined("METADATA_DEFAULT_CODESPACE") && METADATA_DEFAULT_CODESPACE != '') {
-		$AuthorityUrl = METADATA_DEFAULT_CODESPACE."/registry/spatial/dataset/";
-	} else {
-		$AuthorityUrl = "http://www.mapbender.org"."/registry/spatial/dataset/";
-	}
-}
 
 //Get Geometry Type if featuretype info was requested
 if ($resource == 'featuretype') {



More information about the Mapbender_commits mailing list