Revision 45690 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
ExportJDBCService.java | ||
---|---|---|
54 | 54 |
import org.gvsig.export.spi.ExportServiceFactory; |
55 | 55 |
import org.gvsig.export.spi.ExportServiceManager; |
56 | 56 |
import org.gvsig.export.spi.ExportServiceManager.FixGeometryStatus; |
57 |
import org.gvsig.fmap.geom.GeometryCoercionContext; |
|
58 |
import org.gvsig.tools.dataTypes.CoercionContext; |
|
57 | 59 |
|
58 | 60 |
/** |
59 | 61 |
* @author gvSIG Team |
... | ... | |
142 | 144 |
// Reprojection: set SRS of geometry field to target SRS |
143 | 145 |
if (attrdescriptor != null) { |
144 | 146 |
attrdescriptor.setSRS(this.getParameters().getTargetProjection()); |
147 |
attrdescriptor.setGeometryType(this.getParameters().getTargetGeometryType()); |
|
145 | 148 |
} |
146 | 149 |
|
147 | 150 |
// ====================================== |
... | ... | |
216 | 219 |
DisposableIterator it = null; |
217 | 220 |
EditableFeature targetFeature = null; |
218 | 221 |
FeatureStore target = null; |
222 |
Feature feature = null; |
|
219 | 223 |
|
220 | 224 |
try { |
221 | 225 |
ExportServiceManager serviceManager = ExportLocator.getServiceManager(); |
... | ... | |
271 | 275 |
} |
272 | 276 |
} |
273 | 277 |
|
278 |
if(targetGeometryIndex != -1){ |
|
279 |
GeometryCoercionContext coercionContext = (GeometryCoercionContext) theTargetFeatureType.getAttributeDescriptor(targetGeometryIndex).getCoercionContext(); |
|
280 |
if(coercionContext!=null){ |
|
281 |
coercionContext.setMode(GeometryCoercionContext.MODE_ONERROR_NULL); |
|
282 |
} |
|
283 |
} |
|
274 | 284 |
LOG.debug("Inserting rows"); |
275 | 285 |
getTaskStatus().message("Inserting rows"); |
276 | 286 |
it = featureSet.fastIterator(); |
277 | 287 |
while (it.hasNext()) { |
278 |
Feature feature = (Feature) it.next();
|
|
288 |
feature = (Feature) it.next(); |
|
279 | 289 |
this.getTaskStatus().setCurValue(featureCount); |
280 | 290 |
|
281 | 291 |
targetFeature = target.createNewFeature(theTargetFeatureType, true); |
Also available in: Unified diff