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

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Mon Nov 11 06:28:16 PST 2019


Author: armin11
Date: 2019-11-11 06:28:16 -0800 (Mon, 11 Nov 2019)
New Revision: 10323

Modified:
   trunk/mapbender/http/php/mod_dataISOMetadata.php
Log:
Do some metadata qualification to valida against inspire reference validator

Modified: trunk/mapbender/http/php/mod_dataISOMetadata.php
===================================================================
--- trunk/mapbender/http/php/mod_dataISOMetadata.php	2019-11-07 05:27:40 UTC (rev 10322)
+++ trunk/mapbender/http/php/mod_dataISOMetadata.php	2019-11-11 14:28:16 UTC (rev 10323)
@@ -1499,14 +1499,18 @@
 	#Geographical Extent
 	$bbox = array();
 	//initialize if no extent is defined in the database
-	$bbox[0] = -180;
-	$bbox[1] = -90;
-	$bbox[2] = 180;
-	$bbox[3] = 90;
+	$bbox[0] = -180.00;
+	$bbox[1] = -90.00;
+	$bbox[2] = 180.00;
+	$bbox[3] = 90.00;
 	if (isset($mb_metadata['bbox2d']) & ($mb_metadata['bbox2d'] != '')) {
 		$bbox = explode(',',$mb_metadata['bbox2d']);
 	}
-
+        //simple function to add two digits to value if there is no point in string
+	if (strpos($bbox[0], '.') === false)  {$bbox[0] = $bbox[0].'.00';}
+        if (strpos($bbox[1], '.') === false)  {$bbox[1] = $bbox[1].'.00';}
+        if (strpos($bbox[2], '.') === false)  {$bbox[2] = $bbox[2].'.00';}
+        if (strpos($bbox[3], '.') === false)  {$bbox[3] = $bbox[3].'.00';}
 	$extent=$iso19139->createElement("gmd:extent");
 	$EX_Extent=$iso19139->createElement("gmd:EX_Extent");
 	$geographicElement=$iso19139->createElement("gmd:geographicElement");
@@ -1667,8 +1671,10 @@
 //***********************************************************************************
 	$gmd_onLine->appendChild($CI_OnlineResource);
 	$MD_DigitalTransferOptions->appendChild($gmd_onLine);
-	$gmd_transferOptions->appendChild($MD_DigitalTransferOptions);
-
+	//only append transfer option, if $downloadUrl or $applicationUrl was given! This has to be done, because the inspire validator tries to access the referenced resource and throws am error if it is not available! See http://inspire.ec.europa.eu/validator/
+	if (($mb_metadata['type'] == 'application' && $applicationUrl != "") || $downloadUrl != "") {
+	    $gmd_transferOptions->appendChild($MD_DigitalTransferOptions);
+	}
 	$MD_Format->appendChild($gmd_name);
 	$MD_Format->appendChild($gmd_version);
 	$MD_Format->appendChild($gmd_specification);



More information about the Mapbender_commits mailing list