Revision 44469 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
AbstractExportParametersGeometry.java | ||
---|---|---|
12 | 12 |
import org.gvsig.fmap.geom.GeometryManager; |
13 | 13 |
import org.gvsig.fmap.geom.type.GeometryType; |
14 | 14 |
import org.gvsig.export.ExportParametersGeometry; |
15 |
import org.gvsig.fmap.dal.feature.FeatureAttributeDescriptor; |
|
16 |
import org.gvsig.fmap.geom.Geometry; |
|
15 | 17 |
import org.gvsig.tools.ToolsLocator; |
16 | 18 |
import org.gvsig.tools.dynobject.DynStruct; |
17 | 19 |
import org.gvsig.tools.persistence.PersistenceManager; |
... | ... | |
250 | 252 |
this.geometrySubtype = state.getInt("geometrySubtype"); |
251 | 253 |
} |
252 | 254 |
|
255 |
@Override |
|
256 |
public ICoordTrans getTransformationToUse() { |
|
257 |
FeatureAttributeDescriptor geo_att = this.getSourceFeatureType().getDefaultGeometryAttribute(); |
|
258 |
|
|
259 |
IProjection sourceProjection; |
|
260 |
ICoordTrans coord_trans = null; |
|
261 |
Geometry reproj_geom; |
|
262 |
IProjection targetProjection = this.getTargetProjection(); |
|
263 |
if (geo_att != null) { |
|
264 |
sourceProjection = geo_att.getSRS(); |
|
265 |
// this comparison is perhaps too preventive |
|
266 |
// we could have two instances of same projection |
|
267 |
// so we would do more computations than needed |
|
268 |
if (sourceProjection != null && targetProjection != null && sourceProjection != targetProjection) { |
|
269 |
if (this.getTargetTransformation() != null) { |
|
270 |
coord_trans = this.getTargetTransformation(); |
|
271 |
} else { |
|
272 |
coord_trans = sourceProjection.getCT(targetProjection); |
|
273 |
} |
|
274 |
} |
|
275 |
|
|
276 |
} |
|
277 |
return coord_trans; |
|
278 |
} |
|
253 | 279 |
} |
Also available in: Unified diff