[Geoserver-devel] Problem Coordinate Transformation

Hi!

I would like to transform Coordinates from EPSG:4326 to EPSG:3035.
My aim is to calculate the area of a polygon and 3035 is area true.
The suggested solution on the geotools website is following:

DefaultFactory df = (DefaultFactory) FactoryFinder.getCRSAuthorityFactory("EPSG",new Hints(Hints.CRS_AUTHORITY_FACTORY, DefaultFactory.class));
        
CoordinateReferenceSystem sourceCRS = df.createCoordinateReferenceSystem("EPSG:4326");
CoordinateReferenceSystem targetCRS = df.createCoordinateReferenceSystem("EPSG:3035");
        
CoordinateOperationFactory coFactory = FactoryFinder.getCoordinateOperationFactory(null);
CoordinateOperation op = coFactory.createOperation(sourceCRS, targetCRS);
MathTransform oMathTransformer = op.getMathTransform();

Feature f = ...

Geometry oGeometry = f.getGeometry();
oGeometry = JTS.transform(oGeometry,oMathTransformer);

I included the epsg-hsql library in the classpath which also includes the required Bursa-Wolf-Parameter for the Datum-Shift (if I understood correct)

I calculated so the area for Germany and became a completly wrong result >> 5.5E11 instead of 3.5E11

If I do the same calculation based on the epsg-wkt library (what is not recommended) which does NOT include the required Bursa-Wolf-Parameter for the Datum-Shift I get the correct result for the calculated area!
I set the Hints.LENIENT_DATUM_SHIFT:

EPSGCRSAuthorityFactory ef = new EPSGCRSAuthorityFactory();
CoordinateReferenceSystem sourceCRS = ef.createCoordinateReferenceSystem(codeSource);
CoordinateReferenceSystem targetCRS = ef.createCoordinateReferenceSystem(codeTarget);
        
Hints hints = new Hints(Hints.LENIENT_DATUM_SHIFT, Boolean.TRUE);
CoordinateOperationFactory coFactory = FactoryFinder.getCoordinateOperationFactory(hints);
CoordinateOperation op = coFactory.createOperation(sourceCRS, targetCRS);
...

Am I doing something wrong in the hsql solution???

Thanks for your help!
Beate

_____________________________________________________________________
Der WEB.DE SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
http://smartsurfer.web.de/?mc=100071&distributionid=000000000066