Mercurial > mxd2map
changeset 40:a1bc7220efe7
Updated the mxd reader.
author | Raimund Renkert <rrenkert@intevation.de> |
---|---|
date | Thu, 14 Apr 2011 11:25:57 +0200 |
parents | f807c9c81019 |
children | 60ed2164035a |
files | ChangeLog src/java/de/intevation/mxd/reader/FeatureLayerReader.java src/java/de/intevation/mxd/reader/MXDReader.java |
diffstat | 3 files changed, 28 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog Thu Apr 14 11:09:35 2011 +0200 +++ b/ChangeLog Thu Apr 14 11:25:57 2011 +0200 @@ -1,3 +1,11 @@ +2011-04-14 Raimund Renkert <raimund.renkert@intevation.de> + + * src/java/de/intevation/mxd/reader/FeatureLayerReader.java: + Read the layer type. + + * src/java/de/intevation/mxd/reader/MXDReader.java: Updated the reader to + use the XML utilities here. + 2011-04-14 Raimund Renkert <raimund.renkert@intevation.de> * src/java/de/intevation/mxd/reader/MapReader.java:
--- a/src/java/de/intevation/mxd/reader/FeatureLayerReader.java Thu Apr 14 11:09:35 2011 +0200 +++ b/src/java/de/intevation/mxd/reader/FeatureLayerReader.java Thu Apr 14 11:25:57 2011 +0200 @@ -78,6 +78,12 @@ layerElement.setAttribute("status", "off"); } + int type = layer.getShapeType(); + switch (type) { + case 0: layerElement.setAttribute("type", "none"); + case 1: layerElement.setAttribute("type", "point"); + } + layerElement.setAttribute("definition_query", layer.getDefinitionExpression());
--- a/src/java/de/intevation/mxd/reader/MXDReader.java Thu Apr 14 11:09:35 2011 +0200 +++ b/src/java/de/intevation/mxd/reader/MXDReader.java Thu Apr 14 11:25:57 2011 +0200 @@ -30,6 +30,7 @@ //Member private String filename = ""; private ArcGISInitializer initializer = null; + private MapToXMLUtils util; private IMap map; private static final Logger logger = Logger.getLogger(MXDReader.class); @@ -38,6 +39,7 @@ public MXDReader() throws IOException{ logger.debug("constructor()"); initializer = new ArcGISInitializer(); + util = new MapToXMLUtils(); } @@ -93,11 +95,18 @@ throw new IOException("Please set filename!"); } else{ + util.addFilename(filename); openMapDocument(); - MapReader mreader = new MapReader (map); - MapToXMLUtils util = new MapToXMLUtils(); - mreader.setUtil(util); - mreader.read(); + MapReader mreader; + try { + mreader = new MapReader (map); + mreader.setUtil(util); + mreader.read(); + + } + catch(Exception e) { + e.printStackTrace(); + } for(int i = 0; i < map.getLayerCount();i++){ ILayer layer = map.getLayer(i); @@ -176,7 +185,7 @@ public Document getMapDocument(){ logger.debug("getMapDocument()"); - return null; + return util.getDocument(); } } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :