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

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Tue Nov 15 02:50:16 EST 2011


Author: armin11
Date: 2011-11-14 23:50:16 -0800 (Mon, 14 Nov 2011)
New Revision: 8201

Modified:
   trunk/mapbender/http/php/mod_dataISOMetadata.php
   trunk/mapbender/http/php/wms.php
Log:
bugfix for inspire

Modified: trunk/mapbender/http/php/mod_dataISOMetadata.php
===================================================================
--- trunk/mapbender/http/php/mod_dataISOMetadata.php	2011-11-14 11:25:53 UTC (rev 8200)
+++ trunk/mapbender/http/php/mod_dataISOMetadata.php	2011-11-15 07:50:16 UTC (rev 8201)
@@ -881,53 +881,55 @@
 	$t = array('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");
 		$keywordText = $iso19139->createTextNode($row['inspire_category_code_en']);
 		$keyword_cs->appendChild($keywordText);
 		$keyword->appendChild($keyword_cs);
+		$MD_Keywords->appendChild($keyword);
+	}
+		
+	//part for the vocabulary - is always the same for the inspire themes
+	$thesaurusName = $iso19139->createElement("gmd:thesaurusName");
+	$CI_Citation = $iso19139->createElement("gmd:CI_Citation");
+	$title = $iso19139->createElement("gmd:title");
+	$title_cs = $iso19139->createElement("gco:CharacterString");
+	$titleText = $iso19139->createTextNode("GEMET - INSPIRE themes, version 1.0");
 
-		//part for the vocabulary
-		$thesaurusName = $iso19139->createElement("gmd:thesaurusName");
-		$CI_Citation = $iso19139->createElement("gmd:CI_Citation");
-		$title = $iso19139->createElement("gmd:title");
-		$title_cs = $iso19139->createElement("gco:CharacterString");
-		$titleText = $iso19139->createTextNode("GEMET - INSPIRE themes, version 1.0");
+	$title_cs->appendChild($titleText);
+	$title->appendChild($title_cs);
+	$CI_Citation->appendChild($title);
 
-		$title_cs->appendChild($titleText);
-		$title->appendChild($title_cs);
-		$CI_Citation->appendChild($title);
+	$date1=$iso19139->createElement("gmd:date");
+	$CI_Date=$iso19139->createElement("gmd:CI_Date");
+	$date2=$iso19139->createElement("gmd:date");
+	$gcoDate=$iso19139->createElement("gco:Date");
+	$dateType=$iso19139->createElement("gmd:dateType");
+	$dateTypeCode=$iso19139->createElement("gmd:CI_DateTypeCode");
+	$dateTypeCode->setAttribute("codeList", "http://standards.iso.org/ittf/PubliclyAvailableStandards/ISO_19139_Schemas/resources/Codelist/ML_gmxCodelists.xml#CI_DateTypeCode");
+	$dateTypeCode->setAttribute("codeListValue", "publication");
+	$dateTypeCodeText=$iso19139->createTextNode('publication');
+	$dateText= $iso19139->createTextNode('2008-06-01');
+	$dateTypeCode->appendChild($dateTypeCodeText);
+	$dateType->appendChild($dateTypeCode);
+	$gcoDate->appendChild($dateText);
+	$date2->appendChild($gcoDate);
+	$CI_Date->appendChild($date2);
+	$CI_Date->appendChild($dateType);
+	$date1->appendChild($CI_Date);
 
-		$date1=$iso19139->createElement("gmd:date");
-		$CI_Date=$iso19139->createElement("gmd:CI_Date");
-		$date2=$iso19139->createElement("gmd:date");
-		$gcoDate=$iso19139->createElement("gco:Date");
-		$dateType=$iso19139->createElement("gmd:dateType");
-		$dateTypeCode=$iso19139->createElement("gmd:CI_DateTypeCode");
-		$dateTypeCode->setAttribute("codeList", "http://standards.iso.org/ittf/PubliclyAvailableStandards/ISO_19139_Schemas/resources/Codelist/ML_gmxCodelists.xml#CI_DateTypeCode");
-		$dateTypeCode->setAttribute("codeListValue", "publication");
-		$dateTypeCodeText=$iso19139->createTextNode('publication');
-		$dateText= $iso19139->createTextNode('2008-06-01');
-		$dateTypeCode->appendChild($dateTypeCodeText);
-		$dateType->appendChild($dateTypeCode);
-		$gcoDate->appendChild($dateText);
-		$date2->appendChild($gcoDate);
-		$CI_Date->appendChild($date2);
-		$CI_Date->appendChild($dateType);
-		$date1->appendChild($CI_Date);
+	$CI_Citation->appendChild($date1);
+	$thesaurusName->appendChild($CI_Citation);
 
-		$CI_Citation->appendChild($date1);
-		$thesaurusName->appendChild($CI_Citation);
-
-		$MD_Keywords->appendChild($keyword);
-		$MD_Keywords->appendChild($thesaurusName);
-	}
-
-	//add the keyword part to the right leaf
+		#$MD_Keywords->appendChild($keyword);
+	$MD_Keywords->appendChild($thesaurusName);
+	
 	$descriptiveKeywords->appendChild($MD_Keywords);
 	$MD_DataIdentification->appendChild($descriptiveKeywords);
+	//add the keyword part to the right leaf
+
 	//End of keyword part **********
 
 	//generate constraints part

Modified: trunk/mapbender/http/php/wms.php
===================================================================
--- trunk/mapbender/http/php/wms.php	2011-11-14 11:25:53 UTC (rev 8200)
+++ trunk/mapbender/http/php/wms.php	2011-11-15 07:50:16 UTC (rev 8201)
@@ -817,7 +817,7 @@
 	#Creating SRS node
 	$srs = $doc->createElement("SRS");
 	$srs = $layer->appendChild($srs);
-	$srsText = $doc->createTextNode($epsg_row['epsg']);
+	$srsText = $doc->createTextNode(str_replace('epsg','EPSG',$epsg_row['epsg']));
 	$srsText = $srs->appendChild($srsText);
 	
 
@@ -862,23 +862,21 @@
 $res_espg_sql = db_prep_query($epsg_sql, $v, $t);
 
 while ($epsg_row = db_fetch_array($res_espg_sql)) {
-	//IF ($epsg_row['epsg'] ) {
-		#set only first epsg for bbox
-		$bbox['epsg'] = $epsg_row['epsg'];
-		$bbox['minx'] = $epsg_row['minx'];
-		$bbox['miny'] = $epsg_row['miny'];
-		$bbox['maxx'] = $epsg_row['maxx'];
-		$bbox['maxy'] = $epsg_row['maxy'];
+	#set only first epsg for bbox
+	$bbox['epsg'] = str_replace('epsg','EPSG',$epsg_row['epsg']);
+	$bbox['minx'] = $epsg_row['minx'];
+	$bbox['miny'] = $epsg_row['miny'];
+	$bbox['maxx'] = $epsg_row['maxx'];
+	$bbox['maxy'] = $epsg_row['maxy'];
 
-		#Creating BoundingBox node
-		$boundingBox = $doc->createElement("BoundingBox");
-		$boundingBox = $layer->appendChild($boundingBox);
-		$boundingBox->setAttribute('SRS', $bbox['epsg']);
-		$boundingBox->setAttribute('minx', $bbox['minx']);
-		$boundingBox->setAttribute('miny', $bbox['miny']);
-		$boundingBox->setAttribute('maxx', $bbox['maxx']);
-		$boundingBox->setAttribute('maxy', $bbox['maxy']);
-	//}
+	#Creating BoundingBox node
+	$boundingBox = $doc->createElement("BoundingBox");
+	$boundingBox = $layer->appendChild($boundingBox);
+	$boundingBox->setAttribute('SRS', $bbox['epsg']);
+	$boundingBox->setAttribute('minx', $bbox['minx']);
+	$boundingBox->setAttribute('miny', $bbox['miny']);
+	$boundingBox->setAttribute('maxx', $bbox['maxx']);
+	$boundingBox->setAttribute('maxy', $bbox['maxy']);
 }
 
 
@@ -1036,7 +1034,7 @@
 		#Creating SRS node
 		$srs = $doc->createElement("SRS");
 		$srs = $sub_layer->appendChild($srs);
-		$srsText = $doc->createTextNode($layer_srs_row['epsg']);
+		$srsText = $doc->createTextNode(str_replace('epsg','EPSG',$layer_srs_row['epsg']));
 		$srsText = $srs->appendChild($srsText);
 
 	}
@@ -1075,7 +1073,7 @@
 	
 		
 		#set only first epsg for bbox
-		$bbox['epsg'] = $epsg_row['epsg'];
+		$bbox['epsg'] = str_replace('epsg','EPSG',$epsg_row['epsg']);
 		$bbox['minx'] = $epsg_row['minx'];
 		$bbox['miny'] = $epsg_row['miny'];
 		$bbox['maxx'] = $epsg_row['maxx'];



More information about the Mapbender_commits mailing list