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

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Mon Sep 15 05:13:17 PDT 2014


Author: armin11
Date: 2014-09-15 05:13:17 -0700 (Mon, 15 Sep 2014)
New Revision: 9075

Modified:
   trunk/mapbender/http/php/mod_exportMapbenderLayer2CkanObjects.php
Log:
Export INSPIRE Download options to ckan as new ressource

Modified: trunk/mapbender/http/php/mod_exportMapbenderLayer2CkanObjects.php
===================================================================
--- trunk/mapbender/http/php/mod_exportMapbenderLayer2CkanObjects.php	2014-09-15 08:32:04 UTC (rev 9074)
+++ trunk/mapbender/http/php/mod_exportMapbenderLayer2CkanObjects.php	2014-09-15 12:13:17 UTC (rev 9075)
@@ -6,10 +6,11 @@
 //select open data information from mapbenders database
 $sql = <<<SQL
 
-select wms_id, layer_id, f_collect_topic_cat_layer(layer_id) as category, f_collect_layer_keywords(layer_id) as keywords, layer.uuid as uuid, wms_title || ' - Ebene: ' || layer_title as title, wms_abstract || '\r\n' || layer_abstract as notes, tou_licence_title, tou_licence_url, tou_licence_id, tou_licence_timestamp, isopen, to_timestamp(wms_timestamp) as wms_timestamp, to_timestamp(wms_timestamp_create) as wms_timestamp_create, wms_owner as service_owner,fees,accessconstraints, fkey_mb_group_id as service_group, contactperson, address, city, postcode, contactvoicetelephone, contactelectronicmailaddress from (select termsofuse_id, description as tou_licence_title, descriptionlink as tou_licence_url, wms_tou.name as tou_licence_id, wms_tou.isopen as isopen, wms_tou.timestamp as tou_licence_timestamp, wms_id, wms_title, wms_timestamp, wms_timestamp_create, wms.wms_abstract, wms.wms_owner,fees,accessconstraints,wms.fkey_mb_group_id, contactperson, address, city, postcode, conta
 ctvoicetelephone, contactelectronicmailaddress from (select * from termsofuse inner join wms_termsofuse on termsofuse.termsofuse_id = wms_termsofuse.fkey_termsofuse_id and termsofuse.termsofuse_id in ($openLicences)) as wms_tou inner join wms on wms_tou.fkey_wms_id = wms.wms_id) as wms_tou2 inner join layer on wms_tou2.wms_id = layer.fkey_wms_id and layer_searchable=1; 
+select wms_id, layer_id, f_collect_topic_cat_layer(layer_id) as category, f_get_download_options_for_layer(layer_id) as downloadoptions, f_collect_layer_keywords(layer_id) as keywords, layer.uuid as uuid, wms_title || ' - Ebene: ' || layer_title as title, wms_abstract || '\r\n' || layer_abstract as notes, tou_licence_title, tou_licence_url, tou_licence_id, tou_licence_timestamp, isopen, to_timestamp(wms_timestamp) as wms_timestamp, to_timestamp(wms_timestamp_create) as wms_timestamp_create, wms_owner as service_owner,fees,accessconstraints, fkey_mb_group_id as service_group, contactperson, address, city, postcode, contactvoicetelephone, contactelectronicmailaddress from (select termsofuse_id, description as tou_licence_title, descriptionlink as tou_licence_url, wms_tou.name as tou_licence_id, wms_tou.isopen as isopen, wms_tou.timestamp as tou_licence_timestamp, wms_id, wms_title, wms_timestamp, wms_timestamp_create, wms.wms_abstract, wms.wms_owner,fees,accessconstraints,wms.
 fkey_mb_group_id, contactperson, address, city, postcode, contactvoicetelephone, contactelectronicmailaddress from (select * from termsofuse inner join wms_termsofuse on termsofuse.termsofuse_id = wms_termsofuse.fkey_termsofuse_id and termsofuse.termsofuse_id in ($openLicences)) as wms_tou inner join wms on wms_tou.fkey_wms_id = wms.wms_id) as wms_tou2 inner join layer on wms_tou2.wms_id = layer.fkey_wms_id and layer_searchable=1; 
 
 SQL;
 $result = db_query($sql);
+//
 
 //initialize result array
 $sqlTable = array();
@@ -39,6 +40,7 @@
 	$sqlTable['isopen'][] = $row['isopen'];
 	$sqlTable['temporal_coverage_to'][] = $row['wms_timestamp'];
 	$sqlTable['temporal_coverage_from'][] = $row['wms_timestamp_create'];
+	$sqlTable['downloadoptions'][] = $row['downloadoptions'];
 	//build categories array
 	if (isset($row['category']) && $row['category'] != '') {
 		$categories = explode(",",str_replace("{","",str_replace("}","",str_replace("}{",",",$row['category']))));
@@ -195,11 +197,24 @@
 	$package->resources[1]->url = $mapbenderUrl."/php/wms.php?layer_id=".$mbArray['resource_id']."&REQUEST=GetCapabilities&VERSION=1.1.1&SERVICE=WMS";// "http://www.geoportal.rlp.de/portal/karten.html?LAYER[zoom]=1&LAYER[id]=36699"; //constant .. ids
 	$package->resources[1]->resource_type = "visualization"; //constant
 
-	$package->resources[2]->description = "Metadaten zur WMS Kartenebene";//$mbArray['mb_user_id'];// "Link zur WMS-Darstellung im GeoPortal.rlp, die Darstellung erfolgt ab einem Maßstab 1:500.000"; //fix: "".id.id?
-	$package->resources[2]->format = "HTML"; //constant
-	$package->resources[2]->url = $mapbenderUrl."/php/mod_showMetadata.php?languageCode=de&resource=layer&layout=tabs&id=".$mbArray['resource_id'];// "http://www.geoportal.rlp.de/portal/karten.html?LAYER[zoom]=1&LAYER[id]=36699"; //constant .. ids
-	$package->resources[2]->resource_type = "metadata"; //constant
+	if ($mbArray['downloadoptions'] != '') {
+		$package->resources[2]->description = "GDI Downloadoptionen (EU Standard)";//$mbArray['mb_user_id'];// "Link zur WMS-Darstellung im GeoPortal.rlp, die Darstellung erfolgt ab einem Maßstab 1:500.000"; //fix: "".id.id?
+		$package->resources[2]->format = "GDI Download"; //constant
+		$package->resources[2]->url = $mapbenderUrl."/php/mod_getDownloadOptions.php?outputFormat=html&id=".str_replace('{','',str_replace('}','',str_replace('}{',',',$mbArray["downloadoptions"])));
+		$package->resources[2]->resource_type = "download"; //constant
 
+
+		$package->resources[3]->description = "Metadaten zur WMS Kartenebene";//$mbArray['mb_user_id'];// "Link zur WMS-Darstellung im GeoPortal.rlp, die Darstellung erfolgt ab einem Maßstab 1:500.000"; //fix: "".id.id?
+		$package->resources[3]->format = "HTML"; //constant
+		$package->resources[3]->url = $mapbenderUrl."/php/mod_showMetadata.php?languageCode=de&resource=layer&layout=tabs&id=".$mbArray['resource_id'];// "http://www.geoportal.rlp.de/portal/karten.html?LAYER[zoom]=1&LAYER[id]=36699"; //constant .. ids
+		$package->resources[3]->resource_type = "metadata"; //constant
+	} else {
+		$package->resources[2]->description = "Metadaten zur WMS Kartenebene";//$mbArray['mb_user_id'];// "Link zur WMS-Darstellung im GeoPortal.rlp, die Darstellung erfolgt ab einem Maßstab 1:500.000"; //fix: "".id.id?
+		$package->resources[2]->format = "HTML"; //constant
+		$package->resources[2]->url = $mapbenderUrl."/php/mod_showMetadata.php?languageCode=de&resource=layer&layout=tabs&id=".$mbArray['resource_id'];// "http://www.geoportal.rlp.de/portal/karten.html?LAYER[zoom]=1&LAYER[id]=36699"; //constant .. ids
+		$package->resources[2]->resource_type = "metadata"; //constant
+	}
+	
 	$package->author_address->url = $mbArray['mb_user_id'];// null; //null
 	$package->author_address->email = $mbArray['mb_user_id'];// ""; // ""
 	$package->maintainer_address->url = $mbArray['group_homepage'];//$mbArray['service_address'];// null; //mb_group.mb_group_homepage



More information about the Mapbender_commits mailing list