diff src/java/de/intevation/mxd/writer/MapScriptWriter.java @ 246:87e92debc53f

Added extent and projection as ows metadata to the mapfile.
author raimund renkert <raimund.renkert@intevation.de>
date Wed, 10 Aug 2011 13:18:53 +0200
parents 2eeeae07aaa2
children 30e10eb9ac68
line wrap: on
line diff
--- a/src/java/de/intevation/mxd/writer/MapScriptWriter.java	Tue Aug 09 17:42:31 2011 +0200
+++ b/src/java/de/intevation/mxd/writer/MapScriptWriter.java	Wed Aug 10 13:18:53 2011 +0200
@@ -162,6 +162,13 @@
             Double.parseDouble(mapNode.getAttribute("extent_max_x")),
             Double.parseDouble(mapNode.getAttribute("extent_max_y")));
 
+	map.setMetaData(
+	    "ows_extent",
+	    mapNode.getAttribute("extent_min_x") + ", " +
+	    mapNode.getAttribute("extent_min_y") + ", " +
+	    mapNode.getAttribute("extent_max_x") + ", " +
+	    mapNode.getAttribute("extent_max_y"));
+
         //Set the units and projection.
         int proj = Integer.parseInt(mapNode.getAttribute("projection"));
         if(proj != 0) {
@@ -196,6 +203,10 @@
             units = MS_UNITS.MS_METERS;
         }
         map.setUnits(units);
+
+	String srs = map.getMetaData("ows_srs");
+	srs += " EPSG:" + mapNode.getAttribute("projection");
+	map.setMetaData("ows_srs", srs);
     }
 
     /**
@@ -243,6 +254,17 @@
 	    }
             layer.setMetaData("wms_title", ulname);
 
+	    if(layerElement.hasAttribute("extent_min_x") &&
+	       layerElement.hasAttribute("extent_max_x") &&
+	       layerElement.hasAttribute("extent_min_y") &&
+	       layerElement.hasAttribute("extent_max_y")) {
+	        layer.setMetaData(
+		    "ows_extent",
+		    layerElement.getAttribute("extent_min_x") + ", " +
+		    layerElement.getAttribute("extent_min_y") + ", " +
+		    layerElement.getAttribute("extent_max_x") + ", " +
+		    layerElement.getAttribute("extent_max_y"));
+	    }
             //The layer status.
             String stat = layerElement.getAttribute("status");
             if (stat.equals("on")) {
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)