comparison 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
comparison
equal deleted inserted replaced
97:18e4f143896b 98:4696d0769f9c
3 import org.apache.log4j.Logger; 3 import org.apache.log4j.Logger;
4 4
5 import org.w3c.dom.Document; 5 import org.w3c.dom.Document;
6 import org.w3c.dom.Element; 6 import org.w3c.dom.Element;
7 import org.w3c.dom.NodeList; 7 import org.w3c.dom.NodeList;
8
9 import java.io.File;
8 10
9 import javax.xml.xpath.XPathConstants; 11 import javax.xml.xpath.XPathConstants;
10 12
11 import edu.umn.gis.mapscript.mapObj; 13 import edu.umn.gis.mapscript.mapObj;
12 import edu.umn.gis.mapscript.layerObj; 14 import edu.umn.gis.mapscript.layerObj;
174 else if (type.equals("polygon")) { 176 else if (type.equals("polygon")) {
175 layer.setType(MS_LAYER_TYPE.MS_LAYER_POLYGON); 177 layer.setType(MS_LAYER_TYPE.MS_LAYER_POLYGON);
176 } 178 }
177 179
178 //The layer datasource. 180 //The layer datasource.
179 layer.setData(layerElement.getAttribute("data_source")); 181 String datasource = "";
182 if(layerElement.hasAttribute("workspace")) {
183 datasource = layerElement.getAttribute("workspace");
184 datasource += File.separator;
185 }
186 datasource += layerElement.getAttribute("data_source");
187 layer.setData(datasource);
180 188
181 //Write classes. 189 //Write classes.
182 writeClass(layer, layerElement); 190 writeClass(layer, layerElement);
183 } 191 }
184 192
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)