Revision 44300 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
ExportShapeService.java | ||
---|---|---|
110 | 110 |
); |
111 | 111 |
newStoreParameters.setDynValue("Encoding", this.getParameters().getEncoding()); |
112 | 112 |
newStoreParameters.setDynValue("CRS", this.getParameters().getTargetProjection()); |
113 |
AttributeNamesTranslator nameTranslator = ExportLocator.getServiceManager().createAttributeNamesTranslator( |
|
114 |
MAX_FIELD_NAME_LENGTH |
|
115 |
); |
|
113 |
// AttributeNamesTranslator nameTranslator = ExportLocator.getServiceManager().createAttributeNamesTranslator(); |
|
114 |
AttributeNamesTranslator nameTranslator = this.getFactory().createAttributeNamesTranslator(); |
|
116 | 115 |
ExportAttributes exportAttr = this.getParameters().getExportAttributes(); |
117 | 116 |
exportAttr.setNamesTranslator(nameTranslator); |
118 | 117 |
FeatureType ft; |
... | ... | |
212 | 211 |
String geomFieldName = this.getParameters().getSourceGeometryFieldName(); |
213 | 212 |
|
214 | 213 |
FeatureAttributeDescriptor geomFieldDescSource = (FeatureAttributeDescriptor) type.getDefaultGeometryAttribute(); |
215 |
if( geomFieldDescSource!=null ) {
|
|
214 |
if (geomFieldDescSource != null) {
|
|
216 | 215 |
type.remove(geomFieldDescSource.getName()); |
217 | 216 |
} |
218 | 217 |
EditableFeatureAttributeDescriptor geomFieldDescTarget = type.add( |
... | ... | |
277 | 276 |
// we could have two instances of same projection |
278 | 277 |
// so we would do more computations than needed |
279 | 278 |
if (sourceProjection != null && sourceProjection != this.getParameters().getTargetProjection()) { |
280 |
if( this.getParameters().getTargetTransformation()!=null ) {
|
|
279 |
if (this.getParameters().getTargetTransformation() != null) {
|
|
281 | 280 |
coord_trans = this.getParameters().getTargetTransformation(); |
282 | 281 |
} else { |
283 | 282 |
coord_trans = sourceProjection.getCT(this.getParameters().getTargetProjection()); |
... | ... | |
286 | 285 |
// ================================================ |
287 | 286 |
|
288 | 287 |
List<Geometry> extracted; |
289 |
Geometry gitem ;
|
|
288 |
Geometry gitem; |
|
290 | 289 |
DataTypesManager.Coercion toGeometry = ToolsLocator.getDataTypesManager() |
291 | 290 |
.get(DataTypes.GEOMETRY).getCoercion(); |
292 | 291 |
|
293 | 292 |
while (it.hasNext()) { |
294 | 293 |
|
295 | 294 |
Feature feature = (Feature) it.next(); |
296 |
if( geomFieldName==null ) {
|
|
295 |
if (geomFieldName == null) {
|
|
297 | 296 |
edit_feat = target.createNewFeature(true); |
298 | 297 |
// |
299 | 298 |
// Accumulate error in boolean. |
300 | 299 |
// This also fixes field names (using origNameToDbfName) |
301 | 300 |
// |
302 |
there_was_error = there_was_error |
|
|
303 |
setNonNulls( |
|
301 |
there_was_error = there_was_error |
|
302 |
| setNonNulls(
|
|
304 | 303 |
getParameters().getSourceFeatureType(), |
305 | 304 |
targetType, |
306 | 305 |
feature, |
... | ... | |
510 | 509 |
} |
511 | 510 |
} |
512 | 511 |
|
513 |
|
|
514 | 512 |
/** |
515 | 513 |
* @param feature |
516 | 514 |
* @param edit_feat |
... | ... | |
536 | 534 |
dbf_name = orig_name; |
537 | 535 |
} |
538 | 536 |
val = feat.get(orig_name); |
539 |
if (val != null && target_ft.getAttributeDescriptor(dbf_name)!=null) {
|
|
537 |
if (val != null && target_ft.getAttributeDescriptor(dbf_name) != null) {
|
|
540 | 538 |
edit_f.set(dbf_name, val); |
541 | 539 |
} |
542 |
}catch (Exception ex) { |
|
540 |
} catch (Exception ex) {
|
|
543 | 541 |
LOG.info("Error while getting/setting value", ex); |
544 | 542 |
error = true; |
545 | 543 |
} |
... | ... | |
551 | 549 |
private Geometry union(List<Geometry> geoms) |
552 | 550 |
throws GeometryOperationNotSupportedException, GeometryOperationException { |
553 | 551 |
|
554 |
if ( geoms == null || geoms.isEmpty()) {
|
|
552 |
if (geoms == null || geoms.isEmpty()) { |
|
555 | 553 |
return null; |
556 | 554 |
} |
557 | 555 |
|
Also available in: Unified diff