[Mapbender-commits] r6922 - in trunk/mapbender: http/classes http/php tools/wms_extent

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Tue Sep 21 10:05:26 EDT 2010


Author: armin11
Date: 2010-09-21 14:05:26 +0000 (Tue, 21 Sep 2010)
New Revision: 6922

Added:
   trunk/mapbender/tools/wms_extent/extent_service.conf
   trunk/mapbender/tools/wms_extent/extents.map
   trunk/mapbender/tools/wms_extent/readme.txt
   trunk/mapbender/tools/wms_extent/symbolset_mapbender.sym
   trunk/mapbender/tools/wms_extent/target_small.png
Modified:
   trunk/mapbender/http/classes/class_metadata_new.php
   trunk/mapbender/http/php/mod_showMetadata.php
Log:
Adoptions on new metadata module for jquery ui and new possibility to show graphical extent of resources with usage of mapserver on the fly. No client needed - therefor simple and fast.

Modified: trunk/mapbender/http/classes/class_metadata_new.php
===================================================================
--- trunk/mapbender/http/classes/class_metadata_new.php	2010-09-20 13:55:49 UTC (rev 6921)
+++ trunk/mapbender/http/classes/class_metadata_new.php	2010-09-21 14:05:26 UTC (rev 6922)
@@ -616,7 +616,7 @@
 				$this->wmsJSON->wms->srv[$j]->layer[0]->id = (integer)$subLayers[$rootIndex]['layer_id'];
 				$this->wmsJSON->wms->srv[$j]->layer[0]->title = $subLayers[$rootIndex]['layer_title'];
 				$this->wmsJSON->wms->srv[$j]->layer[0]->abstract = $subLayers[$rootIndex]['layer_abstract'];
-				$this->wmsJSON->wms->srv[$j]->layer[0]->mdLink = "http://".$this->hostName."/mapbender/php/mod_showMetadata.php?resource=layer&id=".(integer)$subLayers[$rootIndex]['layer_id'];
+				$this->wmsJSON->wms->srv[$j]->layer[0]->mdLink = "http://".$this->hostName."/mapbender/php/mod_showMetadata.php?resource=layer&layout=tabs&id=".(integer)$subLayers[$rootIndex]['layer_id'];
 				$this->wmsJSON->wms->srv[$j]->layer[0]->previewURL = "http://".$this->hostName."/mapbender/x_geoportal/mod_layerPreview.php?id=".(integer)$subLayers[$rootIndex]['layer_id'];
 				if ($subLayers[$rootIndex]['layer_name'] == ''){
 					$this->wmsJSON->wms->srv[$j]->layer[0]->loadable = 0;
@@ -1522,7 +1522,7 @@
 			$servObject->layer[$countsublayer]->title = $child['layer_title'];
 			$servObject->layer[$countsublayer]->abstract = $child['layer_abstract'];
 			$servObject->layer[$countsublayer]->previewURL = "http://".$this->hostName."/mapbender/x_geoportal/mod_layerPreview.php?id=".$child['layer_id'];
-			$servObject->layer[$countsublayer]->mdLink = "http://".$this->hostName."/mapbender/x_geoportal/mod_showMetadata.php?resource=layer&id=".$child['layer_id'];
+			$servObject->layer[$countsublayer]->mdLink = "http://".$this->hostName."/mapbender/php/mod_showMetadata.php?resource=layer&layout=tabs&id=".$child['layer_id'];
 			if ($child['layer_name'] == ''){
 				$servObject->layer[$countsublayer]->loadable = 0;
 			} else {

Modified: trunk/mapbender/http/php/mod_showMetadata.php
===================================================================
--- trunk/mapbender/http/php/mod_showMetadata.php	2010-09-20 13:55:49 UTC (rev 6921)
+++ trunk/mapbender/http/php/mod_showMetadata.php	2010-09-21 14:05:26 UTC (rev 6922)
@@ -19,13 +19,14 @@
 
 require_once dirname(__FILE__) . "/../../core/globalSettings.php";
 require_once dirname(__FILE__) . "/../classes/class_user.php";
+require_once dirname(__FILE__) . "/../../tools/wms_extent/extent_service.conf";
 
 //GET:
 //resource: wms, layer, wfs, featuretype, wfs-conf, wmc
 //id: integer
 //outputFormat: html, xml, georss, 
 //languageCode: de, en, fr
-
+$layout = 'accordion';
 //Parse REQUEST Parameters
 if (isset($_REQUEST["resource"]) & $_REQUEST["resource"] != "") {
 	//validate to csv integer list
@@ -68,7 +69,16 @@
 	$languageCode = $testMatch;
 	$testMatch = NULL;
 }
-
+if (isset($_REQUEST["layout"]) & $_REQUEST["layout"] != "") {
+	//validate to csv integer list
+	$testMatch = $_REQUEST["layout"];
+	if (!($testMatch == 'tabs' or $testMatch == 'accordion' or $testMatch == 'plain')){ 
+		echo 'layout: <b>'.$testMatch.'</b> is not valid.<br/>'; 
+		die(); 		
+ 	}
+	$layout = $testMatch;
+	$testMatch = NULL;
+}
 $subscribe = intval($_GET["subscribe"]);
 
 //get language parameter out of mapbender session if it is set else set default language to de_DE
@@ -84,7 +94,9 @@
 $langCode = explode("_", $language);
 
 $langCode = $langCode[0];
-
+if ($languageCode == 'de' or $languageCode == 'en' or $languageCode == 'fr') {
+	$langCode = $language;
+}
 #$langCode="de";
 
 $e = new mb_exception("mod_showMetadata.php: language: ".$langCode);
@@ -101,6 +113,7 @@
 $translation['wms'] = 'Kartendienst';
 $translation['layer'] = 'Kartenebene';
 $translation['preview'] = 'Voransicht';
+$translation['extent'] = 'Ausdehnung';
 $translation['resourceAbstract'] = 'Zusammenfassung';
 $translation['resourceTitle'] = 'Titel';
 $translation['metadataProvider'] = 'Veröffentlichende Stelle';
@@ -124,6 +137,7 @@
 $translation['maxscale'] = 'Maximaler Maßstab';
 $translation['crs'] = 'Koordinatenreferenzsysteme (mit BBOX)';
 $translation['wgs84Bbox'] = 'Ausdehnung in geographischen Koordinaten';
+$translation['wgs84BboxGraphic'] = 'Kartenübersicht';
 $translation['mapbenderCapabilities'] = 'Geoportal Capabilities';
 $translation['originalCapabilities'] = 'Original Capabilities';
 $translation['kml'] = 'KML';
@@ -245,6 +259,9 @@
 	if ($rowP['layer_legend_preview_filename'] != "") {
 		$resourceMetadata['legend'] .= "<img src = '../x_geoportal/layer_preview/".$rowP['layer_legend_preview_filename']."'>";
 	}
+	if ($rowP['layer_extent_preview_filename'] != "") {
+		$resourceMetadata['extent'] .= "<img src = '../x_geoportal/layer_preview/".$rowP['layer_extent_preview_filename']."'>";
+	}
 	
 }
 
@@ -299,31 +316,92 @@
 		'</head>';
 $html .= $metadataStr;
 //define the javascripts to include
-$html .= '<link type="text/css" href="../extensions/jquery-ui-1.8.1.custom/css/ui-lightness/jquery-ui-1.8.1.custom.css" rel="Stylesheet" />';	
-$html .= '<script type="text/javascript" src="../extensions/jquery-ui-1.8.1.custom/js/jquery-1.4.2.min.js"></script>';
-$html .= '<script type="text/javascript" src="../extensions/jquery-ui-1.8.1.custom/js/jquery-ui-1.8.1.custom.min.js"></script>';
+	$html .= '<link type="text/css" href="../css/metadataNew.css" rel="Stylesheet" />';
 
-//define the javascript functions
-$html .= '<script type="text/javascript">';
-$html .= '	$(function() {';
-$html .= '		$("#accordion").accordion();';
-//$html .= '		$("#accordion").accordion({ autoHeight: false});';
-//$html .= '		$("#accordion").accordion({ autoHeight: false , clearStyle: true });';
-$html .= '	});';
-$html .= '	</script>';
-$html .= '<div class="demo">';
-$html .= '<div id="accordion">';
+if ($layout == 'tabs') {
+	$html .= '<link type="text/css" href="../extensions/jquery-ui-1.8.1.custom/css/custom-theme/jquery-ui-1.8.4.custom.css" rel="Stylesheet" />';	
+	$html .= '<script type="text/javascript" src="../extensions/jquery-ui-1.8.1.custom/js/jquery-1.4.2.min.js"></script>';
+	$html .= '<script type="text/javascript" src="../extensions/jquery-ui-1.8.1.custom/js/jquery-ui-1.8.1.custom.min.js"></script>';
 
+
+/*if ($metadataContactGroup['metdatapointofcontactorglogo'] != '') {
+	$html .= "<img src='".$metadataContactGroup['metdatapointofcontactorglogo']."'  height='30'>";
+}
+//TODO use right name
+$html .= displayText($resourceMetadata['contactorganization']);
+$html .= '<h3>'.displayText($resourceMetadata['contenttitle']).'</h3>';
+*/
+
+
+
+//initialize tabs
+	$html .= '<script type="text/javascript">';
+	$html .= '$(function() {';
+	$html .= '	$("#tabs").tabs();';
+	$html .= '});';
+	$html .= '</script>';
+
+
+
+
+
+
+
+
+
+//independently define the headers of the parts
+	$html .= '<div class="demo">';
+	$html .= '<div id="tabs">';
+	$html .= '<ul>';
+	$html .= 	'<li><a href="#tabs-1">'.$translation["overview"].'</a></li>';
+	$html .= 	'<li><a href="#tabs-2">'.$translation["properties"].'</a></li>';
+	$html .= 	'<li><a href="#tabs-3">'.$translation["contact"].'</a></li>';
+	$html .= 	'<li><a href="#tabs-4">'.$translation["termsOfUse"].'</a></li>';
+	$html .= 	'<li><a href="#tabs-5">'.$translation["quality"].'</a></li>';
+	$html .= 	'<li><a href="#tabs-6">'.$translation["interfaces"].'</a></li>';
+	$html .= '</ul>';
+
+}
+
+if ($layout == 'accordion') {
+	$html .= '<link type="text/css" href="../extensions/jquery-ui-1.8.1.custom/css/custom-theme/jquery-ui-1.8.4.custom.css" rel="Stylesheet" />';	
+	$html .= '<script type="text/javascript" src="../extensions/jquery-ui-1.8.1.custom/js/jquery-1.4.2.min.js"></script>';
+	$html .= '<script type="text/javascript" src="../extensions/jquery-ui-1.8.1.custom/js/jquery-ui-1.8.1.custom.min.js"></script>';
+	//define the javascript functions
+	$html .= '<script type="text/javascript">';
+	$html .= '	$(function() {';
+	$html .= '		$("#accordion").accordion();';
+	//$html .= '		$("#accordion").accordion({ autoHeight: false});';
+	//$html .= '		$("#accordion").accordion({ autoHeight: false , clearStyle: true });';
+	$html .= '	});';
+	$html .= '	</script>';
+	$html .= '<div class="demo">';
+	$html .= '<div id="accordion">';
+}
+if ($layout == 'plain') {
+	$html .= '<div class="demo">';
+	$html .= '<div id="plain">';
+}
+
 //some placeholders
 $tableBegin =  "<table>\n";
 $t_a = "\t<tr>\n\t\t<th>\n\t\t\t";
 $t_b = "\n\t\t</th>\n\t\t<td>\n\t\t\t";
 $t_c = "\n\t\t</td>\n\t</tr>\n";
 $tableEnd = "</table>\n";
-
+//**************************overview part begin******************************
 //generate div tags for the content - the divs are defined in the array
-$html .= '<h3><a href="#">'.$translation["overview"].'</a></h3>';
-$html .= '<div style="height:300px">';
+if ($layout == 'accordion') {
+	$html .= '<h3><a href="#">'.$translation["overview"].'</a></h3>';
+	$html .= '<div style="height:300px">';
+}
+if ($layout == 'tabs') {
+	$html .= '<div id="tabs-1">';
+}
+if ($layout == 'plain') {
+	$html .= '<h3>'.$translation["overview"].'</h3>';
+	$html .= '<div>';
+}
 $html .= '<p>';
 $html .= $tableBegin;
 $html .= $t_a.$translation['resourceTitle'].$t_b.displayText($resourceMetadata['contenttitle']).$t_c;
@@ -335,6 +413,10 @@
 	}
 	$html .= $t_c;
 }
+if ($metadataContactGroup['metdatapointofcontactorglogo'] != '') {
+	$html .= $t_a.$translation['contactOrganization'].$t_b."<img src='".$metadataContactGroup['metdatapointofcontactorglogo']."'  height='30'>";
+}
+$html .= displayText($metadataContactGroup['metadatacontactorganization']).$t_c;
 $html .= $t_a.$translation['resourceAbstract'].$t_b.displayText($resourceMetadata['contentabstract']).$t_c;
 
 $user = new User();
@@ -376,8 +458,21 @@
 $html .= $tableEnd;
 $html .= '</p>';
 $html .= '</div>';
-$html .= '<h3><a href="#">'.$translation["properties"].'</a></h3>';
-$html .= '<div style="height:300px">';
+
+//**************************overview part end******************************
+
+//**************************properties part begin******************************
+if ($layout == 'accordion') {
+	$html .= '<h3><a href="#">'.$translation["properties"].'</a></h3>';
+	$html .= '<div style="height:300px">';
+}
+if ($layout == 'tabs') {
+	$html .= '<div id="tabs-2">';
+}
+if ($layout == 'plain') {
+	$html .= '<h3>'.$translation["properties"].'</h3>';
+	$html .= '<div>';
+}
 $html .= '<p>';
 $html .= $tableBegin;
 
@@ -393,12 +488,19 @@
 		$epsgString .= $contentBboxes[$j]['epsg']." ";
 		if ($contentBboxes[$j]['epsg'] == 'EPSG:4326') {
 			$wgs84Bbox = $contentBboxes[$j]['minx'].",".$contentBboxes[$j]['miny'].",".$contentBboxes[$j]['maxx'].",".$contentBboxes[$j]['maxy'];
+			
+			$getMapUrl = getExtentGraphic(explode(",", $wgs84Bbox),$layerId);
 		}
 }
 
 $html .= $t_a.$translation['crs'].$t_b.$epsgString.$t_c;
 if (isset($wgs84Bbox)) {
 	$html .= $t_a.$translation['wgs84Bbox'].$t_b.$wgs84Bbox.$t_c;
+	if (defined('EXTENTSERVICEURL')) {
+		$html .= $t_a.$translation['wgs84BboxGraphic'].$t_b."<img src='".$getMapUrl."'>".$t_c;
+	}
+	//show preview map - dynamically
+	
 }
 $html .= $tableEnd;
 $html .= $tableBegin;
@@ -416,10 +518,20 @@
 $html .= $tableEnd;
 $html .= '</p>';
 $html .= '</div>';
+//**************************properties  part end******************************
 
-$html .= '<h3><a href="#">'.$translation["contact"].'</a></h3>';
-
-$html .= '<div style="height:300px">';
+//**************************contact part begin******************************
+if ($layout == 'accordion') {
+	$html .= '<h3><a href="#">'.$translation["contact"].'</a></h3>';
+	$html .= '<div style="height:300px">';
+}
+if ($layout == 'tabs') {
+	$html .= '<div id="tabs-3">';
+}
+if ($layout == 'plain') {
+	$html .= '<h3>'.$translation["contact"].'</h3>';
+	$html .= '<div>';
+}
 $html .= '<p>';
 
 $html .= '<h4>'.$translation['metadataProvider'].'</h4>';
@@ -446,17 +558,39 @@
 $html .= '</p>';
 
 $html .= '</div>';
+//**************************contact part end******************************
 
-$html .= '<h3><a href="#">'.$translation["termsOfUse"].'</a></h3>';
-$html .= '<div style="height:300px">';
+//**************************termsOfUse part begin******************************
+if ($layout == 'accordion') {
+	$html .= '<h3><a href="#">'.$translation["termsOfUse"].'</a></h3>';
+	$html .= '<div style="height:300px">';
+}
+if ($layout == 'tabs') {
+	$html .= '<div id="tabs-4">';
+}
+if ($layout == 'plain') {
+	$html .= '<h3>'.$translation["termsOfUse"].'</h3>';
+	$html .= '<div>';
+}
 $html .= '<p>';
 $tou = file_get_contents("http://localhost/mapbender/php/mod_getServiceDisclaimer.php?type=".$serviceType."&id=".$serviceId."&languageCode=".$langCode."&asTable=true");
 $html .= $tou;
 $html .= '</p>';
 $html .= '</div>';
+//**************************termsOfUse part end******************************
 
-$html .= '<h3><a href="#">'.$translation["quality"].'</a></h3>';
-$html .= '<div style="height:300px">';
+//**************************quality part begin******************************
+if ($layout == 'accordion') {
+	$html .= '<h3><a href="#">'.$translation["quality"].'</a></h3>';
+	$html .= '<div style="height:300px">';
+}
+if ($layout == 'tabs') {
+	$html .= '<div id="tabs-5">';
+}
+if ($layout == 'plain') {
+	$html .= '<h3>'.$translation["quality"].'</h3>';
+	$html .= '<div>';
+}
 $html .= '<p>';
 $html .= $tableBegin;
 switch ($serviceQuality['last_status']) {
@@ -476,8 +610,20 @@
 $html .= $tableEnd;
 $html .= '</p>';
 $html .= '</div>';
-$html .= '<h3><a href="#">'.$translation["interfaces"].'</a></h3>';
-$html .= '<div style="height:300px">';
+//**************************quality part end******************************
+
+//**************************interfaces part begin******************************
+if ($layout == 'accordion') {
+	$html .= '<h3><a href="#">'.$translation["interfaces"].'</a></h3>';
+	$html .= '<div style="height:300px">';
+}
+if ($layout == 'tabs') {
+	$html .= '<div id="tabs-6">';
+}
+if ($layout == 'plain') {
+	$html .= '<h3>'.$translation["interfaces"].'</h3>';
+	$html .= '<div>';
+}
 $html .= '<p>';
 
 /*$translation['mapbenderCapabilities'] = 'Geoportal Capabilities';
@@ -496,11 +642,12 @@
 	$html .= $t_a.$translation['securedCapabilities'].$t_b."<a href = '".$securedLink."' target=_blank>".$translation['capabilities']."</a>".$t_c;
 }
 //kml
-$html .= $t_a.$translation['kml'].$t_b."<a href='../php/mod_interfaceWms4Kml.php?id=".$layerId.">".$translation['kml']."-Datei</a>".$t_c;
+$html .= $t_a.$translation['kml'].$t_b."<a href='../php/mod_interfaceWms4Kml.php?id=".$layerId."'>".$translation['kml']."-Datei</a>".$t_c;
 
 $html .= $tableEnd;
 $html .= '</p>';
 $html .= '</div>';
+//**************************interfaces part end******************************
 
 $html .= '</div>'; //accordion
 $html .= '</div>'; //demo
@@ -517,4 +664,36 @@
     $string = mb_eregi_replace("\n", "<br>", $string);
     return $string;
 } 
+function getExtentGraphic($layer_4326_box, $layerId) {
+		$rlp_4326_box = array(6.05,48.9,8.6,50.96);
+		if ($layer_4326_box[0] <= $rlp_4326_box[0] || $layer_4326_box[2] >= $rlp_4326_box[2] || $layer_4326_box[1] <= $rlp_4326_box[1] || $layer_4326_box[3] >= $rlp_4326_box[3]) {
+			if ($layer_4326_box[0] < $rlp_4326_box[0]) {
+				$rlp_4326_box[0] = $layer_4326_box[0]; 
+			}
+			if ($layer_4326_box[2] > $rlp_4326_box[2]) {
+				$rlp_4326_box[2] = $layer_4326_box[2]; 
+			}
+			if ($layer_4326_box[1] < $rlp_4326_box[1]) {
+				$rlp_4326_box[1] = $layer_4326_box[1]; 
+			}
+			if ($layer_4326_box[3] > $rlp_4326_box[3]) {
+				$rlp_4326_box[3] = $layer_4326_box[3]; 
+			}
+
+			$d_x = $rlp_4326_box[2] - $rlp_4326_box[0]; 
+			$d_y = $rlp_4326_box[3] - $rlp_4326_box[1];
+			
+			$new_minx = $rlp_4326_box[0] - 0.05*($d_x);
+			$new_maxx = $rlp_4326_box[2] + 0.05*($d_x);
+			$new_miny = $rlp_4326_box[1] - 0.05*($d_y);
+			$new_maxy = $rlp_4326_box[3] + 0.05*($d_y);
+
+			if ($new_minx < -180) $rlp_4326_box[0] = -180; else $rlp_4326_box[0] = $new_minx;
+			if ($new_maxx > 180) $rlp_4326_box[2] = 180; else $rlp_4326_box[2] = $new_maxx;
+			if ($new_miny < -90) $rlp_4326_box[1] = -90; else $rlp_4326_box[1] = $new_miny;
+			if ($new_maxy > 90) $rlp_4326_box[3] = 90; else $rlp_4326_box[3] = $new_maxy;
+		}
+		$getMapUrl = EXTENTSERVICEURL."VERSION=1.1.1&REQUEST=GetMap&SERVICE=WMS&LAYERS=background,extent&STYLES=&SRS=EPSG:4326&BBOX=".$rlp_4326_box[0].",".$rlp_4326_box[1].",".$rlp_4326_box[2].",".$rlp_4326_box[3]."&WIDTH=120&HEIGHT=120&FORMAT=image/png&BGCOLOR=0xffffff&TRANSPARENT=TRUE&EXCEPTIONS=application/vnd.ogc.se_inimage&minx=".$layer_4326_box[0]."&miny=".$layer_4326_box[1]."&maxx=".$layer_4326_box[2]."&maxy=".$layer_4326_box[3];
+		return $getMapUrl;
+}
 ?>

Added: trunk/mapbender/tools/wms_extent/extent_service.conf
===================================================================
--- trunk/mapbender/tools/wms_extent/extent_service.conf	                        (rev 0)
+++ trunk/mapbender/tools/wms_extent/extent_service.conf	2010-09-21 14:05:26 UTC (rev 6922)
@@ -0,0 +1,6 @@
+<?php
+# --------------------------------------------
+# type of mapbender database
+# --------------------------------------------
+DEFINE("EXTENTSERVICEURL","http://".$_SERVER['HTTP_HOST']."/cgi-bin/mapserv?map=/data/mapbender/tools/wms_extent/extents.map&");
+?>

Added: trunk/mapbender/tools/wms_extent/extents.map
===================================================================
--- trunk/mapbender/tools/wms_extent/extents.map	                        (rev 0)
+++ trunk/mapbender/tools/wms_extent/extents.map	2010-09-21 14:05:26 UTC (rev 6922)
@@ -0,0 +1,164 @@
+MAP
+NAME "extents"
+STATUS ON
+SIZE 600 600
+MAXSIZE 5000
+UNITS METERS
+SYMBOLSET  "symbolset_mapbender.sym"
+PROJECTION
+	"init=epsg:4326"
+END
+EXTENT 2475000 5425000 2724000 5658000
+WEB	
+	METADATA
+		WMS_TITLE "Layer Extent"
+		WMS_ABSTRACT "Geoportal Rheinland Pfalz, Layer Extent"
+		WMS_ONLINERESOURCE "http://localhost/cgi-bin/mapserv?map=/data/mapbender/tools/extents.map"
+		WMS_FEATURE_INFO_MIME_TYPE    "text/html"	
+		WMS_SRS "epsg:4326 epsg:31467 epsg:31466 epsg:31468 epsg:31469 epsg:31462 epsg:31463 epsg:31492 epsg:31493"
+		wms_extent "2508083 5427840 2681976 5646760"
+		"ows_keywordlist" "Geoportal RLP, Service Layer, WMS, WFS"
+		"ows_fees" "none"
+		"ows_accessconstraints" "none"
+		"ows_addresstype" "postal"
+		"ows_address" "Ferdinand-Sauerbruch-Str. 15"
+		"ows_city" "Koblenz"
+		"ows_stateorprovince" "Rheinland-Pfalz"
+		"ows_postcode" "56073"
+		"ows_country" "Germany"
+		"ows_contactperson" "Armin Retterath" 
+		"ows_contactinformation" "Infos Geoportal-RLP"
+		"ows_contactorganization" "Landesamt für Vermessung und Geobasisinformation Rheinland-Pfalz"
+		"ows_contactposition" "Vermessung und Geobasisinformation"
+		"ows_contactelectronicmailaddress" "armin.retterath at lvermgeo.rlp.de"
+		"wms_contactfacsimiletelephone" "0261/492-466"
+		"wms_contactvoicetelephone" "0261/492-492"
+	END
+END
+SYMBOL
+	NAME 'my_hatch'
+	TYPE hatch
+END
+OUTPUTFORMAT
+  NAME 'png'
+  DRIVER 'GD/PNG'
+  MIMETYPE 'image/png'
+  EXTENSION PNG
+  IMAGEMODE PC256
+  TRANSPARENT ON
+END
+LEGEND
+  STATUS ON
+  KEYSIZE 10 8
+  KEYSPACING 10 10
+  IMAGECOLOR 255 255 255
+  LABEL
+    COLOR 128 128 128
+    TYPE TRUETYPE
+    FONT "arial"
+    SIZE 8
+  END
+END
+#---------------------------------------------------
+LAYER
+	NAME "background" #some service for the background information
+	STATUS ON
+	TYPE LINE
+	CONNECTIONTYPE postgis 
+	CONNECTION   "dbname=<postgisdatabase> user=<username> port=5432 host=<ip>"
+	DATA "the_geom from (select gid , the_geom from gis.landes) as foo using unique gid using SRID=31466"  
+	METADATA
+		WMS_TITLE "Rheinland-Pfalz"
+		WMS_SRS "epsg:31466"
+		WMS_ABSTRACT "Bounding Box Rectangles of Geo Resources registered with the Geoportal Rhineland Palatinate"
+		wms_dataurl_format "text/html"
+		wms_dataurl_href "http://www.mapbender.org/"
+		wms_keywordlist "Geoportal, RLP, Rheinland Pfalz, Umgebungsrechteck, Kartensuche, Dienst, OGC WMS, Open Source Geospatial Foundation, OSGeo"
+		wms_metadataurl_format "text/html"
+		wms_metadataurl_href "http://wiki.osgeo.org/"
+		wms_metadataurl_type "TC211"
+		wms_extent "2508083.25 5427840 2681976 5646759.5"
+	END
+	MINSCALE 0
+	MAXSCALE 0
+	PROJECTION
+		"init=epsg:31466"
+	END
+	CLASS
+		NAME "Rheinland_Pfalz"
+		STYLE
+			OUTLINECOLOR 0 0 0
+			COLOR -1 -1 -1
+		END 
+	END
+END
+#---------------------------------------------------
+LAYER
+	NAME "extent"
+	STATUS ON
+	TYPE POLYGON
+	CONNECTIONTYPE postgis 
+	CONNECTION   "dbname=<postgisdatabase> user=<databaseuser> port=5432 host=<ip>"
+	DATA "the_geom from (select GeomFromText('POLYGON((%minx% %miny%,%minx% %maxy%,%maxx% %maxy%,%maxx% %miny%, %minx% %miny%))',4326) as the_geom,area2d(transform(GeomFromText('POLYGON((%minx% %miny%,%minx% %maxy%,%maxx% %maxy%,%maxx% %miny%, %minx% %miny%))',4326),31466)) as area, 1 as oid ) as foo USING UNIQUE oid USING SRID=4326"
+	METADATA
+		WMS_TITLE "RLP Geo-Services"
+		WMS_SRS "epsg:4326"
+		WMS_ABSTRACT "Bounding Box Rectangles of OWS Services registered with thte Geoportal Rhineland Palatinate"
+		wms_dataurl_format "text/html"
+		wms_dataurl_href "http://www.geoportal.rlp.de"
+		wms_keywordlist "Geoportal, RLP, Rheinland Pfalz, Umgebungsrechteck, Kartensuche, Dienst, OGC WMS, Open Source Geospatial Foundation. OSGeo"
+		wms_metadataurl_format "text/html"
+		wms_metadataurl_href "http://www.geoportal.rlp.de"
+		wms_metadataurl_type "TC211"
+		wms_extent "2508083.25 5427840 2681976 5646759.5"
+	END
+	PROJECTION
+		"init=epsg:4326"
+	END
+ 	CLASS
+		EXPRESSION ([area] > 300000)
+		NAME "bbox2"
+		STYLE
+        		OUTLINECOLOR 135 30 50 
+        		WIDTH 2 
+      		END 
+	END
+END
+#-------------------------------------
+LAYER
+	NAME "ows_layer_target"
+	STATUS DEFAULT
+	TYPE POINT 
+	LABELMAXSCALE 5000000000
+	LABELMINSCALE 0
+	CONNECTIONTYPE postgis
+	CONNECTION   "dbname=<postgisdatabase> user=<databaseuser> port=5432 host=<ip>"
+	DATA "the_geom from (select centroid(GeomFromText('POLYGON((%minx% %miny%,%minx% %maxy%,%maxx% %maxy%,%maxx% %miny%, %minx% %miny%))',4326)) as the_geom,area2d(transform(GeomFromText('POLYGON((%minx% %miny%,%minx% %maxy%,%maxx% %maxy%,%maxx% %miny%, %minx% %miny%))',4326),31466)) as area, 1 as oid ) as foo USING UNIQUE oid USING SRID=4326"
+	LABELCACHE ON
+	METADATA
+		WMS_TITLE "RLP Geo-Services Annotations"
+		WMS_SRS "epsg:4326"
+		WMS_ABSTRACT "Bounding Box Rectangles of OWS Services registered with thte Geoportal Rhineland Palatinate"
+		wms_dataurl_format "text/html"
+		wms_dataurl_href "http://www.mapbender.org/"
+		wms_keywordlist "Geoportal, RLP, Rheinland Pfalz, Umgebungsrechteck, Kartensuche, Dienst,OGC WMS, Open Source Geospatial Foundation. OSGeo"
+		wms_metadataurl_format "text/html"
+		wms_metadataurl_href "http://wiki.osgeo.org/"
+		wms_metadataurl_type "TC211"
+		wms_extent "2508083.25 5427840 2681976 5646759.5"
+	END
+	PROJECTION
+		"init=epsg:4326"
+	END
+	CLASS
+		EXPRESSION ([area] <= 300000)
+		NAME "bbox"
+		STYLE
+			SYMBOL 'target'
+		END
+	END
+END
+#-------------------------------------
+
+
+END

Added: trunk/mapbender/tools/wms_extent/readme.txt
===================================================================
--- trunk/mapbender/tools/wms_extent/readme.txt	                        (rev 0)
+++ trunk/mapbender/tools/wms_extent/readme.txt	2010-09-21 14:05:26 UTC (rev 6922)
@@ -0,0 +1,12 @@
+Toolset to show a simple bounding box graphic with help of umn mapserver.
+Mapbender itselfs comes without a own server component. Therefor it is not so easy to show a simple graphic for the extents of the resources which are registrated in a mapbender database. It will be possible to do so with a mapbender or ol client and the use of javascript rendering. But it is much easier to render the bbox and the background service with the help of a mapserver installation. The bbox can be given as vsp to the mapserver and the mapserver decides to render a special symbol for a special area of the bbox. For mapserver a postgis database backend is used. The user can define the same database as used for mapbender installation.
+Principle:
+vsp bbox to mapserv.cgi and generating a simple polygon by postgis functions on the fly. The polygon and/or the central point can be rendered by the mapserv itself. The url of the request will be defined in a special conf file and can be included by the module which needs the visualization of the extent.
+The principle is better than the solution with an own client because no special javascript data is used.
+
+List of files:
+tools/wms_extent/extent_service.conf
+tools/wms_extent/extents.map
+tools/wms_extent/symbolset_mapbender.sym
+tools/wms_extent/target.png
+

Added: trunk/mapbender/tools/wms_extent/symbolset_mapbender.sym
===================================================================
--- trunk/mapbender/tools/wms_extent/symbolset_mapbender.sym	                        (rev 0)
+++ trunk/mapbender/tools/wms_extent/symbolset_mapbender.sym	2010-09-21 14:05:26 UTC (rev 6922)
@@ -0,0 +1,8 @@
+SYMBOLSET
+SYMBOL
+  NAME 'target'
+  TYPE PIXMAP
+  IMAGE "target_small.png"
+  END
+END
+

Added: trunk/mapbender/tools/wms_extent/target_small.png
===================================================================
(Binary files differ)


Property changes on: trunk/mapbender/tools/wms_extent/target_small.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream



More information about the Mapbender_commits mailing list