[MXD2map-commits] r300:215ae6199b95
scm-commit at wald.intevation.org
scm-commit at wald.intevation.org
Wed Sep 5 16:19:23 CEST 2012
details: http://hg.intevation.org/geospatial/mxd2map/rev/215ae6199b95
changeset: 300:215ae6199b95
user: Andre Heinecke <aheinecke at intevation.de>
date: Wed Sep 05 16:15:03 2012 +0200
description:
Add WMS Support to the writer
diffstat:
ChangeLog | 7 +++++-
src/java/de/intevation/mxd/writer/MapScriptWriter.java | 21 +++++++++++++++++-
2 files changed, 26 insertions(+), 2 deletions(-)
diffs (59 lines):
diff -r c4fb04f6422f -r 215ae6199b95 ChangeLog
--- 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 at intevation.de>
+2012-09-05 Andre Heinecke <aheinecke at intevation.de>
+
+ * src/java/de/intevation/mxd/writer/MapScriptWriter.java:
+ Add basic WMS Support
+
+2012-09-05 Andre Heinecke <aheinecke at intevation.de>
* src/java/de/intevation/mxd/writer/MapScriptWriter.java:
Write Layer GROUP attribute
diff -r c4fb04f6422f -r 215ae6199b95 src/java/de/intevation/mxd/writer/MapScriptWriter.java
--- 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");
More information about the MXD2map-commits
mailing list