comparison src/java/de/intevation/mxd/writer/MapScriptWriter.java @ 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 50031b1ae8e6
comparison
equal deleted inserted replaced
299:c4fb04f6422f 300:215ae6199b95
259 NodeList list = mapNode.getElementsByTagName("layer"); 259 NodeList list = mapNode.getElementsByTagName("layer");
260 for(int i = 0; i < list.getLength(); i++) { 260 for(int i = 0; i < list.getLength(); i++) {
261 Element layerElement = (Element)list.item(i); 261 Element layerElement = (Element)list.item(i);
262 layerObj layer = new layerObj(map); 262 layerObj layer = new layerObj(map);
263 NodeList renderer = layerElement.getElementsByTagName("renderer"); 263 NodeList renderer = layerElement.getElementsByTagName("renderer");
264 if (renderer.getLength() == 0) { 264 if (renderer.getLength() == 0 &&
265 layerElement.getAttribute("connection_type") != "WMS") {
265 map.removeLayer(layer.getIndex()); 266 map.removeLayer(layer.getIndex());
266 logger.warn( 267 logger.warn(
267 "Skipping empty layer " + 268 "Skipping empty layer " +
268 layerElement.getAttribute("name")); 269 layerElement.getAttribute("name"));
269 continue; 270 continue;
322 } 323 }
323 wmssrs += mproj; 324 wmssrs += mproj;
324 owssrs += mproj; 325 owssrs += mproj;
325 layer.setMetaData("wms_srs", wmssrs); 326 layer.setMetaData("wms_srs", wmssrs);
326 layer.setMetaData("ows_srs", owssrs); 327 layer.setMetaData("ows_srs", owssrs);
328 }
329
330 // WMS Version
331 if (layerElement.hasAttribute("wms_server_version")) {
332 layer.setMetaData("wms_server_version",
333 layerElement.getAttribute("wms_server_version"));
334 }
335
336 // WMS Version
337 if (layerElement.hasAttribute("imageType")) {
338 layer.setMetaData("wms_format",
339 layerElement.getAttribute("imageType"));
327 } 340 }
328 341
329 // The layer extent metadata. 342 // The layer extent metadata.
330 if(layerElement.hasAttribute("extent_min_x") && 343 if(layerElement.hasAttribute("extent_min_x") &&
331 layerElement.hasAttribute("extent_max_x") && 344 layerElement.hasAttribute("extent_max_x") &&
496 if(layerElement.hasAttribute("definition_query") && 509 if(layerElement.hasAttribute("definition_query") &&
497 !layerElement.getAttribute("definition_query").equals("")) { 510 !layerElement.getAttribute("definition_query").equals("")) {
498 layer.setFilter("where " + 511 layer.setFilter("where " +
499 layerElement.getAttribute("definition_query")); 512 layerElement.getAttribute("definition_query"));
500 } 513 }
514 } else if(con_type.equals("WMS")) {
515 layer.setType(MS_LAYER_TYPE.MS_LAYER_RASTER);
516 layer.setConnection(layerElement.getAttribute("connection"));
517 layer.setConnectionType(MS_CONNECTION_TYPE.MS_WMS.swigValue(), "");
518 layer.setMetaData("wms_name",
519 layerElement.getAttribute("wms_name"));
501 } 520 }
502 if(!type.equals("raster")) { 521 if(!type.equals("raster")) {
503 layer.setTemplate("PleaseInsertAValidTemplateForGFI"); 522 layer.setTemplate("PleaseInsertAValidTemplateForGFI");
504 } 523 }
505 524
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)