You have the wrong TOWGS84[601.705, 84.263, 485.227, 4.7354, -1.3145, -5.393, -2.3887], in both of your CRS, the correct values are
TOWGS84[577.326,90.129,463.919,5.137,1.474,5.297,2.4232], Cheers On Tue, Dec 4, 2018 at 10:35 AM Clemens Eisserer <linuxhi...@gmail.com> wrote: > Hi, > > Being a complete newbie to geotools I would like to use geotools to > transform a Point supplied in Gauss-Krueger (EPSG:31257) coordinate > system to lambert (used by the database): > > CoordinateReferenceSystem gkCRS = CRS.decode("EPSG:31257"); > CoordinateReferenceSystem dbCRS = > dataBaseFeatureType.getCoordinateReferenceSystem(); > > GeometryBuilder geometryBuilder = new GeometryBuilder(gkCRS); > org.opengis.geometry.primitive.Point point = > geometryBuilder.createPoint(-46001.68, 5251934.86); > org.opengis.geometry.primitive.Point transformedPoint = > (org.opengis.geometry.primitive.Point) point.transform(dbCRS); > Point trJTSPoint = JTS.toGeometry(transformedPoint.getDirectPosition()); > > According to the test-data I got, the transformed point should be ( > 127778.84 395783.40 ) - however instead I get Point(400000.0 > 6251760.423548385). > > Any idea whats going wrong here? > > Thank you advance and best regards, Clemens > > gkCRS is: > PROJCS["MGI / Austria GK M28", > GEOGCS["MGI", > DATUM["Militar-Geographische Institut", > SPHEROID["Bessel 1841", 6377397.155, 299.1528128, > AUTHORITY["EPSG","7004"]], > TOWGS84[601.705, 84.263, 485.227, 4.7354, -1.3145, -5.393, -2.3887], > AUTHORITY["EPSG","6312"]], > PRIMEM["Greenwich", 0.0, AUTHORITY["EPSG","8901"]], > UNIT["degree", 0.017453292519943295], > AXIS["Geodetic longitude", EAST], > AXIS["Geodetic latitude", NORTH], > AUTHORITY["EPSG","4312"]], > PROJECTION["Transverse_Mercator"], > PARAMETER["central_meridian", 10.333333333333334], > PARAMETER["latitude_of_origin", 0.0], > PARAMETER["scale_factor", 1.0], > PARAMETER["false_easting", 150000.0], > PARAMETER["false_northing", -5000000.0], > UNIT["m", 1.0], > AXIS["Easting", EAST], > AXIS["Northing", NORTH], > AUTHORITY["EPSG","31257"]] > > while dbCRS is: > PROJCS["MGI / Austria Lambert", > GEOGCS["MGI", > DATUM["Militar-Geographische Institut", > SPHEROID["Bessel 1841", 6377397.155, 299.1528128, > AUTHORITY["EPSG","7004"]], > TOWGS84[601.705, 84.263, 485.227, 4.7354, -1.3145, -5.393, -2.3887], > AUTHORITY["EPSG","6312"]], > PRIMEM["Greenwich", 0.0, AUTHORITY["EPSG","8901"]], > UNIT["degree", 0.017453292519943295], > AXIS["Geodetic longitude", EAST], > AXIS["Geodetic latitude", NORTH], > AUTHORITY["EPSG","4312"]], > PROJECTION["Lambert_Conformal_Conic_2SP"], > PARAMETER["central_meridian", 13.333333333333334], > PARAMETER["latitude_of_origin", 47.5], > PARAMETER["standard_parallel_1", 49.0], > PARAMETER["false_easting", 400000.0], > PARAMETER["false_northing", 400000.0], > PARAMETER["scale_factor", 1.0], > PARAMETER["standard_parallel_2", 46.0], > UNIT["m", 1.0], > AXIS["Easting", EAST], > AXIS["Northing", NORTH], > AUTHORITY["EPSG","31287"]] > > > _______________________________________________ > GeoTools-GT2-Users mailing list > GeoTools-GT2-Users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users > -- DI Christian Mueller MSc (GIS), MSc (IT-Security) OSS Open Source Solutions GmbH
_______________________________________________ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users