Mercurial > mxd2map
changeset 309:e8021f3e411a
Add support for FgdbFeatureClass
author | Andre Heinecke <aheinecke@intevation.de> |
---|---|
date | Fri, 14 Sep 2012 11:48:52 +0200 |
parents | 1c949a309940 |
children | be441fa4bed0 |
files | ChangeLog src/java/de/intevation/mxd/reader/FeatureLayerReader.java |
diffstat | 2 files changed, 17 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog Thu Sep 06 18:59:35 2012 +0200 +++ b/ChangeLog Fri Sep 14 11:48:52 2012 +0200 @@ -1,3 +1,8 @@ +2012-09-14 Andre Heinecke <aheinecke@intevation.de> + + * src/java/de/intevation/mxd/reader/FeatureLayerReader.java: + Add Read Support for FgdbFeatureClass + 2012-09-06 Andre Heinecke <aheinecke@intevation.de> * src/java/de/intevation/mxd/writer/MapScriptWriter.java:
--- a/src/java/de/intevation/mxd/reader/FeatureLayerReader.java Thu Sep 06 18:59:35 2012 +0200 +++ b/src/java/de/intevation/mxd/reader/FeatureLayerReader.java Fri Sep 14 11:48:52 2012 +0200 @@ -27,6 +27,7 @@ import com.esri.arcgis.carto.IAnnotateLayerProperties; import com.esri.arcgis.carto.LabelEngineLayerProperties; import com.esri.arcgis.geodatabase.FeatureClassName; +import com.esri.arcgis.datasourcesGDB.FgdbFeatureClassName; import com.esri.arcgis.system.IName; import com.esri.arcgis.system.IPropertySet; import com.esri.arcgis.geometry.Envelope; @@ -200,6 +201,9 @@ if(fcn instanceof FeatureClassName) { FeatureClassName name = (FeatureClassName)fcn; layerElement.setAttribute("data_source", name.getName()); + } else if (fcn instanceof FgdbFeatureClassName) { + FgdbFeatureClassName name = (FgdbFeatureClassName)fcn; + layerElement.setAttribute("data_source", name.getName()); } else { logger.debug ( @@ -269,8 +273,13 @@ } try { - String datatype = layer.getDataSourceType(); - if(layer.getWorkspace().getType() == 0) { + if (layer.getDataSourceName() instanceof FgdbFeatureClassName) { + FgdbFeatureClassName name = (FgdbFeatureClassName)layer.getDataSourceName(); + layerElement.setAttribute("connection_type", "ogr"); + layerElement.setAttribute("data", name.getName()); + layerElement.setAttribute("connection", name.getWorkspaceName().getPathName()); + } + else if(layer.getWorkspace().getType() == 0) { layerElement.setAttribute("connection_type", "local"); layerElement.setAttribute( "workspace", @@ -331,6 +340,7 @@ } } catch(Exception e) { + logger.debug(e); logger.error( "Could not read layer datasource." + " Stopped reading layer " + layer.getName() + ".");