# HG changeset patch # User Andre Heinecke # Date 1346685962 -7200 # Node ID ad05f72ef9e48a5c2f97c44d372ec91bccfe0e98 # Parent 72b85bac29fa18a4b39ceba59971e96c3bd8d1b3 Useful debug output when setting the Projection fails diff -r 72b85bac29fa -r ad05f72ef9e4 ChangeLog --- a/ChangeLog Mon Sep 03 17:24:31 2012 +0200 +++ b/ChangeLog Mon Sep 03 17:26:02 2012 +0200 @@ -1,3 +1,8 @@ +2012-09-03 Andre Heinecke + + * src/java/de/intevation/mxd/writer/MapScriptWriter.java: + Useful debug output when setting the Projection Fails + 2012-09-03 Andre Heinecke * src/java/de/intevation/mxd/writer/MarkerStyleWriter.java, diff -r 72b85bac29fa -r ad05f72ef9e4 src/java/de/intevation/mxd/writer/MapScriptWriter.java --- a/src/java/de/intevation/mxd/writer/MapScriptWriter.java Mon Sep 03 17:24:31 2012 +0200 +++ b/src/java/de/intevation/mxd/writer/MapScriptWriter.java Mon Sep 03 17:26:02 2012 +0200 @@ -148,7 +148,9 @@ /** * Create the map object and set the attributes. */ - private void writeMap() { + private void writeMap() + throws UnknownError + { logger.debug("writeMap()"); //Get the map. Element mapNode = (Element)XMLUtils.xpath( @@ -178,7 +180,14 @@ //Set the units and projection. int proj = Integer.parseInt(mapNode.getAttribute("projection")); if(proj != 0) { - map.setProjection("epsg:" + mapNode.getAttribute("projection")); + try { + map.setProjection("epsg:" + mapNode.getAttribute("projection")); + } + catch(UnknownError e) { + logger.error( "Could not set projection: " + mapNode.getAttribute("projection") + + ". Please ensure that it is described in your espg file."); + throw e; + } } String u = mapNode.getAttribute("units"); if(u.equals("feet")) {