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

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Tue Dec 4 03:12:57 PST 2018


Author: armin11
Date: 2018-12-04 03:12:57 -0800 (Tue, 04 Dec 2018)
New Revision: 10002

Modified:
   trunk/mapbender/http/php/mod_dataISOMetadata.php
Log:
Only add gemet thesaurus if some inspire theme was selected for metador dataset metadata

Modified: trunk/mapbender/http/php/mod_dataISOMetadata.php
===================================================================
--- trunk/mapbender/http/php/mod_dataISOMetadata.php	2018-11-29 14:48:03 UTC (rev 10001)
+++ trunk/mapbender/http/php/mod_dataISOMetadata.php	2018-12-04 11:12:57 UTC (rev 10002)
@@ -1119,6 +1119,9 @@
 	$MD_DataIdentification->appendChild($descriptiveKeywords);
 	//new entry - with gemet thesaurus referenced
 	$descriptiveKeywords=$iso19139->createElement("gmd:descriptiveKeywords");
+	//****************************************************************************************************************************************************************************************
+	//keywords for INSPIRE themes:
+	$inspireCategoryDefined = false;
 	$MD_Keywords=$iso19139->createElement("gmd:MD_Keywords");
 	//read out the inspire categories and push them in as controlled keywords
 /* example
@@ -1150,7 +1153,6 @@
 	$t = array('i','i','i');
 	$res = db_prep_query($sql,$v,$t);
 	while ($row = db_fetch_array($res)) {
-		
 		//part for the name of the inspire category
 		$keyword=$iso19139->createElement("gmd:keyword");
 		$keyword_cs=$iso19139->createElement("gco:CharacterString");
@@ -1158,8 +1160,8 @@
 		$keyword_cs->appendChild($keywordText);
 		$keyword->appendChild($keyword_cs);
 		$MD_Keywords->appendChild($keyword);
-	}
-		
+		$inspireCategoryDefined = true;
+	}	
 	//part for the vocabulary - is always the same for the inspire themes
 	$thesaurusName = $iso19139->createElement("gmd:thesaurusName");
 	$CI_Citation = $iso19139->createElement("gmd:CI_Citation");
@@ -1192,15 +1194,16 @@
 	$CI_Citation->appendChild($date1);
 	$thesaurusName->appendChild($CI_Citation);
 
-		#$MD_Keywords->appendChild($keyword);
+	#$MD_Keywords->appendChild($keyword);
 	$MD_Keywords->appendChild($thesaurusName);
-	
 	$descriptiveKeywords->appendChild($MD_Keywords);
-	$MD_DataIdentification->appendChild($descriptiveKeywords);
+	//only append child descriptiveKeywords if an INSPIRE category was found!
+	if ($inspireCategoryDefined) {
+	    $MD_DataIdentification->appendChild($descriptiveKeywords);
+	}
+	//****************************************************************************************************************************************************************************************
 	//add the keyword part to the right leaf
-
 	//End of keyword part **********
-
 	//generate constraints part
 	//generate service type part
 	//generate extent part



More information about the Mapbender_commits mailing list