diff src/java/de/intevation/mxd/writer/MapScriptWriter.java @ 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
parents efab4d62ad3c
children 1cbc278c956b
line wrap: on
line diff
--- 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")) {
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)