Index: trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.exportto/org.gvsig.exportto.lib/org.gvsig.exportto.lib.api/src/main/java/org/gvsig/export/spi/ExportGeometryHelper.java
===================================================================
--- trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.exportto/org.gvsig.exportto.lib/org.gvsig.exportto.lib.api/src/main/java/org/gvsig/export/spi/ExportGeometryHelper.java	(revision 0)
+++ trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.exportto/org.gvsig.exportto.lib/org.gvsig.exportto.lib.api/src/main/java/org/gvsig/export/spi/ExportGeometryHelper.java	(revision 43936)
@@ -0,0 +1,18 @@
+package org.gvsig.export.spi;
+
+import org.gvsig.fmap.dal.feature.EditableFeature;
+import org.gvsig.fmap.dal.feature.Feature;
+
+/**
+ *
+ * @author jjdelcerro
+ */
+public interface ExportGeometryHelper {
+
+    boolean canProcessGeometry();
+
+    int copyGeometry(Feature sourceFeature, EditableFeature targetFeature);
+
+    String getLastErrorMessage();
+    
+}
Index: trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.exportto/org.gvsig.exportto.lib/org.gvsig.exportto.lib.api/src/main/java/org/gvsig/export/spi/ExportServiceManager.java
===================================================================
--- trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.exportto/org.gvsig.exportto.lib/org.gvsig.exportto.lib.api/src/main/java/org/gvsig/export/spi/ExportServiceManager.java	(revision 43935)
+++ trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.exportto/org.gvsig.exportto.lib/org.gvsig.exportto.lib.api/src/main/java/org/gvsig/export/spi/ExportServiceManager.java	(revision 43936)
@@ -48,4 +48,10 @@
             ICoordTrans coord_trans,
             Geometry geometry
     );
+    
+    public ExportGeometryHelper createGeometryHelper(
+            ExportParametersGeometry parameters,
+            FeatureType theTargetFeatureType,
+            FeatureType theSourceFeatureType
+    );
 }
Index: trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.exportto/org.gvsig.exportto.lib/org.gvsig.exportto.lib.api/src/main/java/org/gvsig/export/spi/AbstractExportParametersGeometry.java
===================================================================
--- trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.exportto/org.gvsig.exportto.lib/org.gvsig.exportto.lib.api/src/main/java/org/gvsig/export/spi/AbstractExportParametersGeometry.java	(revision 43935)
+++ trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.exportto/org.gvsig.exportto.lib/org.gvsig.exportto.lib.api/src/main/java/org/gvsig/export/spi/AbstractExportParametersGeometry.java	(revision 43936)
@@ -121,43 +121,43 @@
     }
 
     @Override
-    public String getGeometryFieldName() {
+    public String getSourceGeometryFieldName() {
         return this.geometryFieldName;
     }
 
     @Override
-    public void setGeometryFieldName(String geometryFieldName) {
+    public void setSourceGeometryFieldName(String geometryFieldName) {
         this.geometryFieldName = geometryFieldName;
     }
 
     @Override
-    public int getGeometryTypeAsInt() {
+    public int getTargetGeometryTypeAsInt() {
         return geometryType;
     }
 
     @Override
-    public int getGeometrySubtype() {
+    public int getTargetGeometrySubtype() {
         return geometrySubtype;
     }
 
     @Override
-    public void setGeometryType(int geometryType) {
+    public void setTargetGeometryType(int geometryType) {
         this.geometryType = geometryType;
     }
 
     @Override
-    public void setGeometrySubtype(int subtype) {
+    public void setTargetGeometrySubtype(int subtype) {
         this.geometrySubtype = subtype;
     }
 
     @Override
-    public void setGeometryType(GeometryType type) {
+    public void setTargetGeometryType(GeometryType type) {
         this.geometryType = type.getType();
         this.geometrySubtype = type.getSubType();
     }
 
     @Override
-    public GeometryType getGeometryType() {
+    public GeometryType getTargetGeometryType() {
         try {
             GeometryManager geomManager = GeometryLocator.getGeometryManager();
             GeometryType type = geomManager.getGeometryType(
Index: trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.exportto/org.gvsig.exportto.lib/org.gvsig.exportto.lib.api/src/main/java/org/gvsig/export/spi/AbstractExportService.java
===================================================================
--- trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.exportto/org.gvsig.exportto.lib/org.gvsig.exportto.lib.api/src/main/java/org/gvsig/export/spi/AbstractExportService.java	(revision 43935)
+++ trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.exportto/org.gvsig.exportto.lib/org.gvsig.exportto.lib.api/src/main/java/org/gvsig/export/spi/AbstractExportService.java	(revision 43936)
@@ -5,11 +5,11 @@
 import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
-import org.cresques.cts.ICoordTrans;
-import org.cresques.cts.IProjection;
 import org.gvsig.export.ExportException;
 import org.gvsig.export.ExportLocator;
 import org.gvsig.export.ExportParameters;
+import org.gvsig.export.ExportParametersGeometry;
+import org.gvsig.export.spi.ExportServiceManager.FixGeometryStatus;
 import org.gvsig.fmap.dal.DALLocator;
 import org.gvsig.fmap.dal.DataManager;
 import org.gvsig.fmap.dal.DataServerExplorer;
@@ -21,7 +21,6 @@
 import org.gvsig.fmap.dal.feature.FeatureSet;
 import org.gvsig.fmap.dal.feature.FeatureStore;
 import org.gvsig.fmap.dal.feature.FeatureType;
-import org.gvsig.fmap.geom.Geometry;
 import org.gvsig.tools.ToolsLocator;
 import org.gvsig.tools.dispose.DisposableIterator;
 import org.gvsig.tools.dispose.DisposeUtils;
@@ -124,6 +123,14 @@
 
     abstract protected OpenDataStoreParameters createTargetOpenStoreParameters() throws ExportException;     
 
+    
+    protected static class InvalidGeometryException extends ExportException {
+
+        public InvalidGeometryException(Feature feature, String checkMessage) {
+            super(checkMessage, feature);
+        }
+    }
+
     @Override
     public void export(FeatureSet featureSet) throws ExportException {
         DataServerExplorer explorer = createServerExplorer();
@@ -135,7 +142,7 @@
 
         DisposableIterator it = null;
         FeatureStore target = null;
-        EditableFeature newfeature = null;
+        EditableFeature targetFeature = null;
         try {
             this.getTaskStatus().setRangeOfValues(0, featureSet.getSize());
 
@@ -144,49 +151,47 @@
             dataManager.newStore(explorerName, providerName, newStoreParameters, true);
             target = (FeatureStore) dataManager.openStore(providerName, openStoreParameters);
 
-            FeatureType targetType = target.getDefaultFeatureType();
+            FeatureType theTargetFeatureType = target.getDefaultFeatureType();
+            FeatureType theSourceFeatureType = featureSet.getDefaultFeatureType();
 
+            ExportGeometryHelper geomHelper = null;
+            if( this.getParameters() instanceof ExportParametersGeometry ) {
+                geomHelper = ExportLocator.getServiceManager().createGeometryHelper(
+                        (ExportParametersGeometry) this.getParameters(),
+                        theTargetFeatureType, 
+                        theSourceFeatureType
+                );
+                if( !geomHelper.canProcessGeometry() ) {
+                    geomHelper = null;
+                }
+            }
+            // ============================================
+            
             target.edit(FeatureStore.MODE_APPEND);
             it = featureSet.fastIterator();
 
-            IProjection targetProjection;
-            FeatureAttributeDescriptor defaultGeom = target.getDefaultFeatureType().getDefaultGeometryAttribute();
-            if (defaultGeom!=null) {
-            	targetProjection = defaultGeom.getSRS();
-            } else {
-            	targetProjection = null;
-            }
-
             long featureCount = 0;
             while (it.hasNext()) {
-                Feature feature = (Feature) it.next();
-                newfeature = target.createNewFeature(targetType, true);
-                copyValues(feature, newfeature);
-                // ================================================
-                // Reprojection stuff
-                Geometry reproj_geom;
-                IProjection sourceProjection = feature.getDefaultSRS();
+                this.getTaskStatus().setCurValue(featureCount);
 
-                ICoordTrans coord_trans;
-                // this comparison is perhaps too preventive
-                // we could  have two instances of same projection
-                // so we would do more computations than needed
-                if (sourceProjection != null
-                        && targetProjection != null
-                        && sourceProjection != targetProjection) {
-
-                    coord_trans = sourceProjection.getCT(targetProjection);
-                    reproj_geom = feature.getDefaultGeometry();
-                    reproj_geom = reproj_geom.cloneGeometry();
-                    reproj_geom.reProject(coord_trans);
-                    newfeature.setDefaultGeometry(reproj_geom);
+                Feature sourceFeature = (Feature) it.next();
+                targetFeature = target.createNewFeature(theTargetFeatureType, true);
+                copyValues(sourceFeature, targetFeature);
+                
+                if( geomHelper!=null ) {
+                    switch(geomHelper.copyGeometry(sourceFeature,targetFeature)) {
+                        case FixGeometryStatus.STATE_OK:
+                            break;
+                        case FixGeometryStatus.STATE_SKIP:
+                            continue;
+                        case FixGeometryStatus.STATE_ABORT:
+                            throw new InvalidGeometryException(targetFeature, geomHelper.getLastErrorMessage());
+                    }
                 }
-                // ================================================
+                
+                target.insert(targetFeature);
 
-                target.insert(newfeature);
-
                 featureCount++;
-                this.getTaskStatus().setCurValue(featureCount);
 
                 if (this.getTaskStatus().isCancellationRequested()) {
                     return;
@@ -198,18 +203,18 @@
             fireFinishedListener();
         } catch (Exception e) {
             fireCancelledListeners();
-            throw new ExportException(e, newfeature);
+            throw new ExportException(e, targetFeature);
         } finally {
             DisposeUtils.dispose(it);
             DisposeUtils.dispose(featureSet);
             DisposeUtils.dispose(target);
-        }
     }
+    }
     
     protected void copyValues(Feature source, EditableFeature target) {
         FeatureType sourceType= source.getType();
         FeatureType targetType = target.getType();
-        for( FeatureAttributeDescriptor targetAttr : targetType) {
+        for( FeatureAttributeDescriptor targetAttr: targetType) {
             String targetAttrName = targetAttr.getName();
             String sourceAttrName = getAttributeNamesTranslator().getSourceName(targetAttrName);
             FeatureAttributeDescriptor sourceAttr = sourceType.getAttributeDescriptor(sourceAttrName);
Index: trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.exportto/org.gvsig.exportto.lib/org.gvsig.exportto.lib.api/src/main/java/org/gvsig/export/ExportParametersGeometry.java
===================================================================
--- trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.exportto/org.gvsig.exportto.lib/org.gvsig.exportto.lib.api/src/main/java/org/gvsig/export/ExportParametersGeometry.java	(revision 43935)
+++ trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.exportto/org.gvsig.exportto.lib/org.gvsig.exportto.lib.api/src/main/java/org/gvsig/export/ExportParametersGeometry.java	(revision 43936)
@@ -55,19 +55,19 @@
 
     public void setTryToFixGeometry(boolean tryToFixGeometry);
     
-    public String getGeometryFieldName();
+    public String getSourceGeometryFieldName();
     
-    public void setGeometryFieldName(String geometryFieldName);
+    public void setSourceGeometryFieldName(String geometryFieldName);
     
-    public GeometryType getGeometryType();
+    public GeometryType getTargetGeometryType();
     
-    public int getGeometryTypeAsInt();
+    public int getTargetGeometryTypeAsInt();
     
-    public int getGeometrySubtype();
+    public int getTargetGeometrySubtype();
     
-    public void setGeometryType(GeometryType type);
+    public void setTargetGeometryType(GeometryType type);
     
-    public void setGeometryType(int type);
+    public void setTargetGeometryType(int type);
     
-    public void setGeometrySubtype(int subtype);
+    public void setTargetGeometrySubtype(int subtype);
 }
Index: trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.exportto/org.gvsig.exportto.lib/org.gvsig.exportto.lib.impl/src/main/java/org/gvsig/export/impl/service/DefaultExportGeometryHelper.java
===================================================================
--- trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.exportto/org.gvsig.exportto.lib/org.gvsig.exportto.lib.impl/src/main/java/org/gvsig/export/impl/service/DefaultExportGeometryHelper.java	(revision 0)
+++ trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.exportto/org.gvsig.exportto.lib/org.gvsig.exportto.lib.impl/src/main/java/org/gvsig/export/impl/service/DefaultExportGeometryHelper.java	(revision 43936)
@@ -0,0 +1,155 @@
+package org.gvsig.export.impl.service;
+
+import org.apache.commons.lang3.StringUtils;
+import org.cresques.cts.ICoordTrans;
+import org.cresques.cts.IProjection;
+import org.gvsig.export.ExportLocator;
+import org.gvsig.export.ExportParametersGeometry;
+import org.gvsig.export.spi.ExportGeometryHelper;
+import org.gvsig.export.spi.ExportServiceManager;
+import org.gvsig.fmap.dal.DataTypes;
+import org.gvsig.fmap.dal.feature.EditableFeature;
+import org.gvsig.fmap.dal.feature.Feature;
+import org.gvsig.fmap.dal.feature.FeatureAttributeDescriptor;
+import org.gvsig.fmap.dal.feature.FeatureType;
+import org.gvsig.fmap.geom.Geometry;
+
+/**
+ *
+ * @author jjdelcerro
+ */
+public class DefaultExportGeometryHelper implements ExportGeometryHelper {
+        private final int targetGeometryIndex;
+        private final int sourceGeometryIndex;
+        private final ICoordTrans coord_trans;
+        
+        private final ExportServiceManager serviceManager;
+        private final ExportParametersGeometry parameters;
+        private String lastErrorMessage;
+
+        public DefaultExportGeometryHelper(
+            ExportParametersGeometry parameters,
+            FeatureType theTargetFeatureType,
+            FeatureType theSourceFeatureType
+        ) {
+            this.serviceManager = ExportLocator.getServiceManager();
+            this.parameters = parameters;
+                    
+            FeatureAttributeDescriptor sourceGeomAtt = theSourceFeatureType.getDefaultGeometryAttribute();
+            FeatureAttributeDescriptor targetGeomAtt;
+
+            String sourceGeometryFieldName = this.parameters.getSourceGeometryFieldName();
+            if( !StringUtils.isEmpty(sourceGeometryFieldName) ) {
+                sourceGeomAtt = theSourceFeatureType.getAttributeDescriptor(sourceGeometryFieldName);
+            }
+            if (sourceGeomAtt == null) {
+                // Si el origen no tiene geometria, no haremos nada con las
+                // geometrias.
+                this.targetGeometryIndex = -1;
+                this.sourceGeometryIndex = -1;
+                this.coord_trans = null;
+                return;
+            }
+            switch( this.getGeometryColumnCount(theTargetFeatureType) ) {
+                case 0:
+                    // Si el destino no tiene campo geometry no haremos nada con 
+                    // las geometrias.
+                    this.targetGeometryIndex = -1;
+                    this.sourceGeometryIndex = -1;
+                    this.coord_trans = null;
+                    return;
+                case 1:
+                    // Si solo hay una columna de geometria asignaremos las geometrias
+                    // independientemente de como se llamen los campos.
+                    targetGeomAtt = theTargetFeatureType.getDefaultGeometryAttribute();
+                    break;
+                default:
+                    // Si hay mas de una geometria en el target y hay un campo de tipo
+                    // geometria que coincida en nombre con el del source, usamos ese.
+                    targetGeomAtt = theTargetFeatureType.getAttributeDescriptor(sourceGeomAtt.getName());
+                    if( targetGeomAtt == null || targetGeomAtt.getType()!=DataTypes.GEOMETRY ) {
+                        // Si no coinciden por nombre y tipo, pillaremos el primer campo
+                        // geometry por defecto del target.
+                        targetGeomAtt = theTargetFeatureType.getDefaultGeometryAttribute();
+                        if( targetGeomAtt==null ) {
+                            targetGeomAtt = this.getFirstGeometryColumn(theTargetFeatureType);
+                            if( targetGeomAtt == null ) {
+                                this.targetGeometryIndex = -1;
+                                this.sourceGeometryIndex = -1;
+                                this.coord_trans = null;
+                                return;
+                            }
+                        }
+                    }
+            }
+
+            IProjection sourceProjection = this.parameters.getTargetProjection();
+            IProjection targetProjection = sourceGeomAtt.getSRS();
+            if( targetProjection == null ) {
+                targetProjection = sourceProjection;
+            }
+            // this comparison is perhaps too preventive
+            // we could  have two instances of same projection
+            // so we would do more computations than needed
+            if (sourceProjection != null && targetProjection != null && sourceProjection != targetProjection) {
+                this.coord_trans = sourceProjection.getCT(targetProjection);
+            } else {
+                this.coord_trans = null;
+            }
+            this.sourceGeometryIndex = sourceGeomAtt.getIndex();
+            this.targetGeometryIndex = targetGeomAtt.getIndex();
+        }
+
+        private int getGeometryColumnCount(FeatureType featureType) {
+            int count = 0;
+            for( int i=0; i<featureType.size(); i++ ) {
+                if( featureType.getAttributeDescriptor(i).getType()==DataTypes.GEOMETRY ) {
+                    count++;
+                }
+            }
+            return count;
+        }
+
+        @Override
+        public String getLastErrorMessage() {
+            return this.lastErrorMessage;
+        }
+        
+        @Override
+        public int copyGeometry(
+                Feature sourceFeature, 
+                EditableFeature targetFeature
+            ) {
+            if( this.sourceGeometryIndex<0 || this.targetGeometryIndex<0 ) {
+                return ExportServiceManager.FixGeometryStatus.STATE_OK;
+            }
+            Geometry geometry = sourceFeature.getGeometry(this.sourceGeometryIndex);
+            ExportServiceManager.FixGeometryStatus check = serviceManager.fixGeometry(
+                    this.parameters, 
+                    this.coord_trans, 
+                    geometry
+            );
+            if( check.getState() == ExportServiceManager.FixGeometryStatus.STATE_OK ) {
+                targetFeature.setGeometry(this.targetGeometryIndex, check.getGeometry());
+            }
+            this.lastErrorMessage = check.getMessage();
+            return check.getState();
+        }
+
+        @Override
+        public boolean canProcessGeometry() {
+            return this.sourceGeometryIndex>=0 && this.targetGeometryIndex>=0 ;
+        }
+
+        private FeatureAttributeDescriptor getFirstGeometryColumn(FeatureType featureType) {
+            for( int i=0; i<featureType.size(); i++ ) {
+                FeatureAttributeDescriptor descriptor = featureType.getAttributeDescriptor(i);
+                if( descriptor.getType()==DataTypes.GEOMETRY ) {
+                    return descriptor;
+                }
+            }
+            return null;
+        }
+        
+    
+}
Index: trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.exportto/org.gvsig.exportto.lib/org.gvsig.exportto.lib.impl/src/main/java/org/gvsig/export/impl/service/DefaultExportServiceManager.java
===================================================================
--- trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.exportto/org.gvsig.exportto.lib/org.gvsig.exportto.lib.impl/src/main/java/org/gvsig/export/impl/service/DefaultExportServiceManager.java	(revision 43935)
+++ trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.exportto/org.gvsig.exportto.lib/org.gvsig.exportto.lib.impl/src/main/java/org/gvsig/export/impl/service/DefaultExportServiceManager.java	(revision 43936)
@@ -16,6 +16,7 @@
 import org.gvsig.export.Filter;
 import org.gvsig.export.impl.ExportGeometryUtils;
 import org.gvsig.export.spi.AttributeNamesTranslator;
+import org.gvsig.export.spi.ExportGeometryHelper;
 import org.gvsig.export.spi.ExportService;
 import org.gvsig.export.spi.ExportServiceFactory;
 import org.gvsig.export.spi.ExportServiceManager;
@@ -123,4 +124,15 @@
     ) {
         return ExportGeometryUtils.fixGeometry(parmeters, coord_trans, geometry);
     }    
+
+    @Override
+    public ExportGeometryHelper createGeometryHelper(ExportParametersGeometry parameters, FeatureType theTargetFeatureType, FeatureType theSourceFeatureType) {
+        DefaultExportGeometryHelper helper = new DefaultExportGeometryHelper(
+                parameters,
+                theTargetFeatureType, 
+                theSourceFeatureType
+        );
+        return helper;
+        
+    }
 }
Index: trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.exportto/org.gvsig.exportto.swing/org.gvsig.exportto.swing.impl/src/main/java/org/gvsig/export/swing/impl/panels/SelectGeometryTypePanel.java
===================================================================
--- trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.exportto/org.gvsig.exportto.swing/org.gvsig.exportto.swing.impl/src/main/java/org/gvsig/export/swing/impl/panels/SelectGeometryTypePanel.java	(revision 43935)
+++ trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.exportto/org.gvsig.exportto.swing/org.gvsig.exportto.swing.impl/src/main/java/org/gvsig/export/swing/impl/panels/SelectGeometryTypePanel.java	(revision 43936)
@@ -70,12 +70,12 @@
         FeatureAttributeDescriptor geomDescriptor = ft.getDefaultGeometryAttribute();
         
         if( geomDescriptor == null ) {
-            this.parameters.setGeometryType(Geometry.TYPES.GEOMETRY);
-            this.parameters.setGeometrySubtype(Geometry.SUBTYPES.GEOM2D);
+            this.parameters.setTargetGeometryType(Geometry.TYPES.GEOMETRY);
+            this.parameters.setTargetGeometrySubtype(Geometry.SUBTYPES.GEOM2D);
         } else {
             GeometryType gt = geomDescriptor.getGeomType();
-            this.parameters.setGeometryType(gt.getType());
-            this.parameters.setGeometrySubtype(gt.getSubType());
+            this.parameters.setTargetGeometryType(gt.getType());
+            this.parameters.setTargetGeometrySubtype(gt.getSubType());
         }
         
         if( ArrayUtils.isEmpty(this.geometryTypes) ) {
@@ -220,19 +220,19 @@
     public void exitPanel() {
         Integer n = (Integer) ListElement.getSelected(cboType);
         if( n!=null ) {
-            this.parameters.setGeometryType(n);
+            this.parameters.setTargetGeometryType(n);
         }
         n = (Integer) ListElement.getSelected(cboSubtype);
         if( n!=null ) {
-            this.parameters.setGeometrySubtype(n);
+            this.parameters.setTargetGeometrySubtype(n);
         }
     }
 
     @Override
     public void enterPanel() {
         if( this.updateComponents ) {
-            ListElement.setSelected(cboType, this.parameters.getGeometryTypeAsInt());
-            ListElement.setSelected(cboSubtype, this.parameters.getGeometrySubtype());
+            ListElement.setSelected(cboType, this.parameters.getTargetGeometryTypeAsInt());
+            ListElement.setSelected(cboSubtype, this.parameters.getTargetGeometrySubtype());
         }
         this.updateComponents=false;
     }
Index: trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.exportto/org.gvsig.exportto.swing/org.gvsig.exportto.swing.impl/src/main/java/org/gvsig/export/swing/impl/panels/SelectGeometryFieldPanel.java
===================================================================
--- trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.exportto/org.gvsig.exportto.swing/org.gvsig.exportto.swing.impl/src/main/java/org/gvsig/export/swing/impl/panels/SelectGeometryFieldPanel.java	(revision 43935)
+++ trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.exportto/org.gvsig.exportto.swing/org.gvsig.exportto.swing.impl/src/main/java/org/gvsig/export/swing/impl/panels/SelectGeometryFieldPanel.java	(revision 43936)
@@ -39,9 +39,9 @@
         this.parameters = (ExportParametersGeometry) parameters;
 
         if( this.parameters.getSourceFeatureType().getDefaultGeometryAttribute()==null ) {
-            this.parameters.setGeometryFieldName(null);
+            this.parameters.setSourceGeometryFieldName(null);
         } else {
-            this.parameters.setGeometryFieldName(this.parameters.getSourceFeatureType().getDefaultGeometryAttributeName());
+            this.parameters.setSourceGeometryFieldName(this.parameters.getSourceFeatureType().getDefaultGeometryAttributeName());
         }
 
         this.initComponents();
@@ -65,7 +65,7 @@
 
     @Override
     public void exitPanel() {
-        this.parameters.setGeometryFieldName(this.getGeometryField());
+        this.parameters.setSourceGeometryFieldName(this.getGeometryField());
     }
     
     @Override
@@ -82,7 +82,7 @@
         this.rdoSelectTheFieldToBeUsedAsGeometry.setEnabled(true);
         this.rdoSelectTheFieldToBeUsedAsGeometry.setSelected(false);
         
-        if( this.parameters.getGeometryFieldName()==null ) {
+        if( this.parameters.getSourceGeometryFieldName()==null ) {
             this.rdoUseTheGeometryFieldByDefault.setEnabled(false);
             this.rdoUseTheGeometryFieldByDefault.setSelected(false);
             this.rdoUseNullAsTheValueOfTheGeometry.setSelected(true);
Index: trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.exportto/org.gvsig.exportto.swing/org.gvsig.exportto.swing.impl/src/main/java/org/gvsig/export/swing/impl/panels/CheckGeometriesPanel.java
===================================================================
--- trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.exportto/org.gvsig.exportto.swing/org.gvsig.exportto.swing.impl/src/main/java/org/gvsig/export/swing/impl/panels/CheckGeometriesPanel.java	(revision 43935)
+++ trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.exportto/org.gvsig.exportto.swing/org.gvsig.exportto.swing.impl/src/main/java/org/gvsig/export/swing/impl/panels/CheckGeometriesPanel.java	(revision 43936)
@@ -155,7 +155,7 @@
             this.chkTryFixGeometry.setSelected( this.parameters.getTryToFixGeometry() );
         }
         this.updateComponents = false;
-        if( this.parameters.getGeometryFieldName()==null ) {
+        if( this.parameters.getSourceGeometryFieldName()==null ) {
             this.rdbCheckIsCorrupt.setEnabled(false);
             this.rdbCheckIsValid.setEnabled(false);
             this.rdbCheckNone.setEnabled(false);
Index: trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.exportto/org.gvsig.exportto.swing/org.gvsig.exportto.swing.prov/org.gvsig.exportto.swing.prov.dbf/src/main/java/org/gvsig/export/dbf/service/ExportDBFService.java
===================================================================
--- trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.exportto/org.gvsig.exportto.swing/org.gvsig.exportto.swing.prov/org.gvsig.exportto.swing.prov.dbf/src/main/java/org/gvsig/export/dbf/service/ExportDBFService.java	(revision 43935)
+++ trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.exportto/org.gvsig.exportto.swing/org.gvsig.exportto.swing.prov/org.gvsig.exportto.swing.prov.dbf/src/main/java/org/gvsig/export/dbf/service/ExportDBFService.java	(revision 43936)
@@ -121,6 +121,9 @@
                 // Volvemos a obtener una copia "limpia" con los cambios consolidados
                 ft = eft.getNotEditableCopy();
             }
+            
+            // FIXME: check types of fields in ft (remove Geometry?)
+            
             newStoreParameters.setDefaultFeatureType(ft.getEditable());
             return newStoreParameters;
         } catch (DataException ex) {
Index: trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.exportto/org.gvsig.exportto.swing/org.gvsig.exportto.swing.prov/org.gvsig.exportto.swing.prov.shape/src/main/java/org/gvsig/export/shape/service/ExportShapeParametersImpl.java
===================================================================
--- trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.exportto/org.gvsig.exportto.swing/org.gvsig.exportto.swing.prov/org.gvsig.exportto.swing.prov.shape/src/main/java/org/gvsig/export/shape/service/ExportShapeParametersImpl.java	(revision 43935)
+++ trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.exportto/org.gvsig.exportto.swing/org.gvsig.exportto.swing.prov/org.gvsig.exportto.swing.prov.shape/src/main/java/org/gvsig/export/shape/service/ExportShapeParametersImpl.java	(revision 43936)
@@ -1,6 +1,7 @@
 package org.gvsig.export.shape.service;
 
 import java.io.File;
+import org.apache.commons.io.FilenameUtils;
 import org.gvsig.export.spi.AbstractExportParametersGeometry;
 
 /**
@@ -36,7 +37,7 @@
 
     @Override
     public void setFile(File file) {
-        this.file = file;
+        this.file = new File(FilenameUtils.removeExtension(file.getAbsolutePath()) + ".shp");
     }
     
 }
Index: trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.exportto/org.gvsig.exportto.swing/org.gvsig.exportto.swing.prov/org.gvsig.exportto.swing.prov.shape/src/main/java/org/gvsig/export/shape/service/ExportShapeService.java
===================================================================
--- trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.exportto/org.gvsig.exportto.swing/org.gvsig.exportto.swing.prov/org.gvsig.exportto.swing.prov.shape/src/main/java/org/gvsig/export/shape/service/ExportShapeService.java	(revision 43935)
+++ trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.exportto/org.gvsig.exportto.swing/org.gvsig.exportto.swing.prov/org.gvsig.exportto.swing.prov.shape/src/main/java/org/gvsig/export/shape/service/ExportShapeService.java	(revision 43936)
@@ -130,6 +130,9 @@
                 // Volvemos a obtener una copia "limpia" con los cambios consolidados
                 ft = eft.getNotEditableCopy();
             }
+            
+            // FIXME: check if ft has one and only one geometry.
+            
             newStoreParameters.setDefaultFeatureType(ft.getEditable());
             return newStoreParameters;
         } catch (DataException ex) {
@@ -162,7 +165,7 @@
         File parametersFile = this.getParameters().getFile();
         String pathName = FilenameUtils.removeExtension(parametersFile.getAbsolutePath());
 
-        int geometryType = this.getParameters().getGeometryTypeAsInt();
+        int geometryType = this.getParameters().getTargetGeometryTypeAsInt();
         
         if (geometryType == Geometry.TYPES.GEOMETRY) {
             try {
@@ -214,7 +217,7 @@
         try {
             EditableFeatureType type = this.getParameters().getSourceFeatureType().getCopy().getEditable();
 
-            String geomFieldName = this.getParameters().getGeometryFieldName();
+            String geomFieldName = this.getParameters().getSourceGeometryFieldName();
             
             FeatureAttributeDescriptor geomFieldDescSource = (FeatureAttributeDescriptor) type.getDefaultGeometryAttribute();
             if( geomFieldDescSource!=null ) { 
@@ -222,10 +225,10 @@
             }
             EditableFeatureAttributeDescriptor geomFieldDescTarget = type.add(
                     "GEOMETRY",
-                    this.getParameters().getGeometryTypeAsInt()
+                    this.getParameters().getTargetGeometryTypeAsInt()
             );
             geomFieldDescTarget.setDefaultValue(null);
-            int gsubtype = this.getParameters().getGeometrySubtype();
+            int gsubtype = this.getParameters().getTargetGeometrySubtype();
             // El shp solo soporta los subtipos 2D y 3D
             switch (gsubtype) {
                 case Geometry.SUBTYPES.GEOM2D:
Index: trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.exportto/org.gvsig.exportto.swing/org.gvsig.exportto.swing.prov/org.gvsig.exportto.swing.prov.jdbc/src/main/java/org/gvsig/export/jdbc/service/ExportJDBCService.java
===================================================================
--- trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.exportto/org.gvsig.exportto.swing/org.gvsig.exportto.swing.prov/org.gvsig.exportto.swing.prov.jdbc/src/main/java/org/gvsig/export/jdbc/service/ExportJDBCService.java	(revision 43935)
+++ trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.exportto/org.gvsig.exportto.swing/org.gvsig.exportto.swing.prov/org.gvsig.exportto.swing.prov.jdbc/src/main/java/org/gvsig/export/jdbc/service/ExportJDBCService.java	(revision 43936)
@@ -66,13 +66,6 @@
         implements ExportService 
     {
 
-    private static class InvalidGeometryException extends ExportException {
-
-        public InvalidGeometryException(Feature feature, String checkMessage) {
-            super(checkMessage, feature);
-        }
-    }
-
     private FeatureType targetFeatureType;
 
     
