[MXD2map-commits] r309:e8021f3e411a

scm-commit at wald.intevation.org scm-commit at wald.intevation.org
Fri Sep 14 11:54:12 CEST 2012


details:   http://hg.intevation.org/geospatial/mxd2map/rev/e8021f3e411a

changeset: 309:e8021f3e411a

user:      Andre Heinecke <aheinecke at intevation.de>

date:      Fri Sep 14 11:48:52 2012 +0200

description:
Add support for FgdbFeatureClass


diffstat:

 ChangeLog                                                 |   5 +++++
 src/java/de/intevation/mxd/reader/FeatureLayerReader.java |  14 ++++++++++++--
 2 files changed, 17 insertions(+), 2 deletions(-)

diffs (57 lines):

diff -r 1c949a309940 -r e8021f3e411a ChangeLog
--- 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 at intevation.de>
+
+	* src/java/de/intevation/mxd/reader/FeatureLayerReader.java:
+	Add Read Support for FgdbFeatureClass
+
 2012-09-06  Andre Heinecke <aheinecke at intevation.de>
 
 	* src/java/de/intevation/mxd/writer/MapScriptWriter.java:
diff -r 1c949a309940 -r e8021f3e411a src/java/de/intevation/mxd/reader/FeatureLayerReader.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() + ".");


More information about the MXD2map-commits mailing list