diff src/java/de/intevation/mxd/writer/MapScriptWriter.java @ 98:4696d0769f9c

Write the absolute path to the data source of the layer.
author Raimund Renkert <rrenkert@intevation.de>
date Tue, 07 Jun 2011 13:35:02 +0200
parents 18e4f143896b
children d6d2a4058ebf
line wrap: on
line diff
--- a/src/java/de/intevation/mxd/writer/MapScriptWriter.java	Mon Jun 06 17:24:43 2011 +0200
+++ b/src/java/de/intevation/mxd/writer/MapScriptWriter.java	Tue Jun 07 13:35:02 2011 +0200
@@ -6,6 +6,8 @@
 import org.w3c.dom.Element;
 import org.w3c.dom.NodeList;
 
+import java.io.File;
+
 import javax.xml.xpath.XPathConstants;
 
 import edu.umn.gis.mapscript.mapObj;
@@ -176,7 +178,13 @@
             }
 
             //The layer datasource.
-            layer.setData(layerElement.getAttribute("data_source"));
+            String datasource = "";
+            if(layerElement.hasAttribute("workspace")) {
+                datasource = layerElement.getAttribute("workspace");
+                datasource += File.separator;
+            }
+            datasource += layerElement.getAttribute("data_source");
+            layer.setData(datasource);
 
             //Write classes.
             writeClass(layer, layerElement);
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)