comparison src/java/de/intevation/mxd/writer/MapScriptWriter.java @ 307:f9e53dcc7424

Add Read/Write Support for Projections on a per Layer basis
author Andre Heinecke <aheinecke@intevation.de>
date Thu, 06 Sep 2012 18:58:41 +0200
parents ebf974199309
children 1c949a309940
comparison
equal deleted inserted replaced
306:ea3fde77ea48 307:f9e53dcc7424
294 layer.setGroup(ulgroup); 294 layer.setGroup(ulgroup);
295 layer.setMetaData("wms_layer_group", group); 295 layer.setMetaData("wms_layer_group", group);
296 } 296 }
297 layer.setMetaData("wms_title", ulname); 297 layer.setMetaData("wms_title", ulname);
298 298
299 //Set the projection for the Layers
300 if (layerElement.hasAttribute("projection")) {
301 int proj = Integer.parseInt(layerElement.getAttribute("projection"));
302 if(proj != 0) {
303 try {
304 layer.setProjection("epsg:" + layerElement.getAttribute("projection"));
305 }
306 catch(UnknownError e) {
307 logger.error( "Could not set projection in layer: " + layerElement.getAttribute("projection") +
308 ". Please ensure that it is described in your espg file.");
309 throw e;
310 }
311 }
312 }
299 // Projection metadata. 313 // Projection metadata.
300 String mproj = mapNode.getAttribute("projection"); 314 String mproj = mapNode.getAttribute("projection");
315 if (layerElement.hasAttribute("projection")) {
316 // Overwrite the Map Projection in the layer
317 mproj = layerElement.getAttribute("projection");
318 }
301 if(mproj != null && !mproj.equals("") && !mproj.equals("0")) { 319 if(mproj != null && !mproj.equals("") && !mproj.equals("0")) {
302 String wmssrs = layer.getMetaData("wms_srs"); 320 String wmssrs = layer.getMetaData("wms_srs");
303 String owssrs = layer.getMetaData("ows_srs"); 321 String owssrs = layer.getMetaData("ows_srs");
304 if(wmssrs == null) { 322 if(wmssrs == null) {
305 wmssrs = "EPSG:"; 323 wmssrs = "EPSG:";
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)