changeset 172:929e09649b08

Handle unknown projections.
author vc11884admin@VC11884.win.bsh.de
date Wed, 06 Jul 2011 15:51:43 +0200
parents b9ee44070056
children 0a1435aa33d8
files ChangeLog src/java/de/intevation/mxd/writer/MapScriptWriter.java
diffstat 2 files changed, 11 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Wed Jul 06 15:17:05 2011 +0200
+++ b/ChangeLog	Wed Jul 06 15:51:43 2011 +0200
@@ -1,3 +1,9 @@
+2011-07-06  Raimund Renkert  <raimund.renkert@intevation.de>
+
+	* src/java/de/intevation/mxd/writer/MapScriptWriter.java:
+	  Do not write the projection if the EPSG code is 0. MapScript
+	  verifies the projection before writing it to the mapfile.
+
 2011-07-06  Raimund Renkert  <raimund.renkert@intevation.de>
 
 	* src/java/de/intevation/mxd/reader/MapReader.java:
--- a/src/java/de/intevation/mxd/writer/MapScriptWriter.java	Wed Jul 06 15:17:05 2011 +0200
+++ b/src/java/de/intevation/mxd/writer/MapScriptWriter.java	Wed Jul 06 15:51:43 2011 +0200
@@ -101,8 +101,11 @@
             Double.parseDouble(mapNode.getAttribute("extent_max_x")),
             Double.parseDouble(mapNode.getAttribute("extent_max_y")));
 
-        //Set the units.
-	map.setProjection("epsg:" + mapNode.getAttribute("projection"));
+        //Set the units and projection.
+	int proj = Integer.parseInt(mapNode.getAttribute("projection"));
+	if(proj != 0) {
+	    map.setProjection("epsg:" + mapNode.getAttribute("projection"));
+	}
         String u = mapNode.getAttribute("units");
         if(u.equals("feet")) {
             units = MS_UNITS.MS_FEET;
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)