Hi to all,

We are using the following method in order to transform one point from a
certain CRS to EPSG 4326 and it correctly works until now.
However, when having as an input the CRS 3879, it gives as a result
90.0,25.0, and it is not correct. It does not give an error, but the result
is not correct.

Do you know what is happening?

Thanks you!

Cris
------

DirectPosition2D destDirectPosition2D = new DirectPosition2D();
        try {
            CoordinateReferenceSystem sourceCrs = CRS.decode("EPSG:" + srs);
            CoordinateReferenceSystem targetCrs = CRS.decode("EPSG:4326");
// WGS84

            MathTransform mathTransform = CRS.findMathTransform(sourceCrs,
targetCrs, true);
            DirectPosition2D srcDirectPosition2D = new
DirectPosition2D(sourceCrs, punto.getX(), punto.getY());

            try {
                mathTransform.transform(srcDirectPosition2D,
destDirectPosition2D);
            } catch (Exception e) {
                e.printStackTrace();
            }

            double pos1 = destDirectPosition2D.y;
            double pos2 = destDirectPosition2D.x;
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to