[MXD2map-commits] r297:ad05f72ef9e4
scm-commit at wald.intevation.org
scm-commit at wald.intevation.org
Mon Sep 3 17:26:12 CEST 2012
details: http://hg.intevation.org/geospatial/mxd2map/rev/ad05f72ef9e4
changeset: 297:ad05f72ef9e4
user: Andre Heinecke <aheinecke at intevation.de>
date: Mon Sep 03 17:26:02 2012 +0200
description:
Useful debug output when setting the Projection fails
diffstat:
ChangeLog | 5 +++++
src/java/de/intevation/mxd/writer/MapScriptWriter.java | 13 +++++++++++--
2 files changed, 16 insertions(+), 2 deletions(-)
diffs (42 lines):
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 <aheinecke at intevation.de>
+
+ * src/java/de/intevation/mxd/writer/MapScriptWriter.java:
+ Useful debug output when setting the Projection Fails
+
2012-09-03 Andre Heinecke <aheinecke at intevation.de>
* 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")) {
More information about the MXD2map-commits
mailing list