I'm really no projection wizard and again and again bang my head against
that wall.
I'm creating an operation that would like to reproject feature layers
and dump them to shapefile.
I'm going the usual way:
CoordinateReferenceSystem mapCrs = activeMap.getViewportModel()
.getCRS();
CoordinateReferenceSystem outputCrs = CRS.parseWKT(crsString);
MathTransform mathTransform = CRS.findMathTransform(outputCrs,
mapCrs);
aware of the fact that the bursa parameters could be problematic, I
decided to choose 2 projections that do not have towgs84 parameters: UTM
zone 32 on wgs84 and the latlong wgs84.
The error is:
org.geotools.referencing.operation.projection.PointOutsideEnvelopeException:
Longitude 703600°38.8'E is out of range (±180°).
which tells me that i probably can't hope to project between metric and
lat-long, since it interprets the metric values as degrees. Is that
true? How should this be done?
Also, since I didn't come to the end of the thing, I also would like to
ask if the following is ok to just change the geometries of a
featurecollection:
FeatureIterator fReader = featureCollection.features();
while (fReader.hasNext()) {
Feature tmpFeature = fReader.next();
Geometry featureGeometry = tmpFeature.getDefaultGeometry();
Geometry tmpGeometry = JTS.transform(featureGeometry,
mathTransform);
tmpFeature.setDefaultGeometry(tmpGeometry);
}
Ciao,
Andrea
_______________________________________________
User-friendly Desktop Internet GIS (uDig)
http://udig.refractions.net
http://lists.refractions.net/mailman/listinfo/udig-devel