Mercurial > mxd2map
changeset 297:ad05f72ef9e4
Useful debug output when setting the Projection fails
author | Andre Heinecke <aheinecke@intevation.de> |
---|---|
date | Mon, 03 Sep 2012 17:26:02 +0200 (2012-09-03) |
parents | 72b85bac29fa |
children | 1cbc278c956b |
files | ChangeLog src/java/de/intevation/mxd/writer/MapScriptWriter.java |
diffstat | 2 files changed, 16 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- 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 <aheinecke@intevation.de> + + * src/java/de/intevation/mxd/writer/MapScriptWriter.java: + Useful debug output when setting the Projection Fails + 2012-09-03 Andre Heinecke <aheinecke@intevation.de> * src/java/de/intevation/mxd/writer/MarkerStyleWriter.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")) {