I'm trying to transform a JTS geometry from EPSG 3035 to 4326 with the code attached below. However, when I'm just reading the geometry from a WKT, the results are different from the expected value (should be
long: 48°16'17.626", lat: 14°16'55.125", according to epsg.io, but is
POINT (61.90... -19.77...)).
However, when I switch the coordinate order in the WKT I get the expected results. Is there any way to tell the
JTS.transform to switch up the coordinate order internally?
final WKTReader reader = new WKTReader(); final Geometry geom = reader.read("POINT (4638804.944501147 2804557.565404966)"); final CoordinateReferenceSystem crs3035 = CRS.decode("EPSG:3035"); final CoordinateReferenceSystem crs4326 = CRS.decode("EPSG:4326"); final MathTransform metersToDeg = CRS.findMathTransform(crs3035, crs4326); final Geometry transformed = JTS.transform(geom, metersToDeg); System.out.println(transformed);