changeset 300:215ae6199b95

Add WMS Support to the writer
author Andre Heinecke <aheinecke@intevation.de>
date Wed, 05 Sep 2012 16:15:03 +0200
parents c4fb04f6422f
children 2cb2d8eb56ed
files ChangeLog src/java/de/intevation/mxd/writer/MapScriptWriter.java
diffstat 2 files changed, 26 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Wed Sep 05 16:13:39 2012 +0200
+++ b/ChangeLog	Wed Sep 05 16:15:03 2012 +0200
@@ -1,4 +1,9 @@
-2012-09-03  Andre Heinecke <aheinecke@intevation.de>
+2012-09-05  Andre Heinecke <aheinecke@intevation.de>
+
+	* src/java/de/intevation/mxd/writer/MapScriptWriter.java:
+	Add basic WMS Support
+
+2012-09-05  Andre Heinecke <aheinecke@intevation.de>
 
 	* src/java/de/intevation/mxd/writer/MapScriptWriter.java:
 	Write Layer GROUP attribute
--- a/src/java/de/intevation/mxd/writer/MapScriptWriter.java	Wed Sep 05 16:13:39 2012 +0200
+++ b/src/java/de/intevation/mxd/writer/MapScriptWriter.java	Wed Sep 05 16:15:03 2012 +0200
@@ -261,7 +261,8 @@
             Element layerElement = (Element)list.item(i);
             layerObj layer = new layerObj(map);
             NodeList renderer = layerElement.getElementsByTagName("renderer");
-            if (renderer.getLength() == 0) {
+            if (renderer.getLength() == 0 &&
+                    layerElement.getAttribute("connection_type") != "WMS") {
                 map.removeLayer(layer.getIndex());
                 logger.warn(
                     "Skipping empty layer " + 
@@ -326,6 +327,18 @@
                 layer.setMetaData("ows_srs", owssrs);
             }
 
+            // WMS Version
+            if (layerElement.hasAttribute("wms_server_version")) {
+                layer.setMetaData("wms_server_version",
+                    layerElement.getAttribute("wms_server_version"));
+            }
+
+            // WMS Version
+            if (layerElement.hasAttribute("imageType")) {
+                layer.setMetaData("wms_format",
+                    layerElement.getAttribute("imageType"));
+            }
+
             // The layer extent metadata.
             if(layerElement.hasAttribute("extent_min_x") &&
                layerElement.hasAttribute("extent_max_x") &&
@@ -498,6 +511,12 @@
                         layer.setFilter("where " +
                         layerElement.getAttribute("definition_query"));
                 }
+            } else if(con_type.equals("WMS")) {
+                layer.setType(MS_LAYER_TYPE.MS_LAYER_RASTER);
+                layer.setConnection(layerElement.getAttribute("connection"));
+                layer.setConnectionType(MS_CONNECTION_TYPE.MS_WMS.swigValue(), "");
+                layer.setMetaData("wms_name",
+                    layerElement.getAttribute("wms_name"));
             }
             if(!type.equals("raster")) {
                 layer.setTemplate("PleaseInsertAValidTemplateForGFI");
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)