Closed ebocher closed 1 year ago
Another issue is reported in H2GIS when a transform is created from 2249 to 4326
https://github.com/orbisgis/h2gis/issues/1266
@mukoki Can you take a look inside CTS ? You will be much more efficient than me Cheers
the same for "from EPSG:4326 to EPSG:31467" is there any update? i would like to use this Lib but EPSG:31467 is critical for my project
Same for 26911 and 3857 web merkator.
I ran into the same problem trying to transform coordinates from 31466
to 25832
. I studied the code and as far as I can tell this error occurrs when either the source or target EPSG definition have no valid towgs84
parameter. See:
So maybe adding an updated epsg defintion file to src/main/resources/org/cts/registry
fixes the problem. I haven't tested this yet though.
I wanted to transform the coordinates from 4326 (WGS 84)
to 31255 (Austria GK Central)
and ran into the same problem.
The error is definitely caused by the missing towgs84
parameter. I also tried to add the correct towgs84
parameter in the epsg definition file but this didn't solve the problem.
The epsg:31255 has another column datum=hermannskogel
. The value from this "key" is stored in the GeodeticDatum.java
file.
public final static GeodeticDatum HERMANNSKOGEL = new GeodeticDatum( new Identifier("EPSG", "4312", "Militar-Geographische Institut", "MGI"), PrimeMeridian.GREENWICH, Ellipsoid.BESSEL1841, null, new GeographicExtent("Austria", 46.4, 49.02, 9.53, 17.17), "", "");
The null value is the towgs84
value. If I edit the code like
public final static GeodeticDatum HERMANNSKOGEL = new GeodeticDatum( new Identifier("EPSG", "4312", "Militar-Geographische Institut", "MGI"), PrimeMeridian.GREENWICH, Ellipsoid.BESSEL1841, SevenParameterTransformation.createBursaWolfTransformation(577.326,90.129,463.919,5.1366,1.4742,5.2970,2.4232), new GeographicExtent("Austria", 46.4, 49.02, 9.53, 17.17), "", "");
the transformation doesn't throw an error but returns completely wrong values. Hope someone finds a solution.
Thanks a lot for feedbak. Currently we have no time and no ressources to fix this issue, so any PR are welcome ! Sorry for that.
I finally found the problem. You have to edit the code like I mentioned before in the GeodeticDatum.java file. I only forgot to delete some test code.
public final static GeodeticDatum HERMANNSKOGEL = new GeodeticDatum( new Identifier("EPSG", "4312", "Militar-Geographische Institut", "MGI"), PrimeMeridian.GREENWICH, Ellipsoid.BESSEL1841, SevenParameterTransformation.createBursaWolfTransformation(577.326,90.129,463.919,5.1366,1.4742,5.2970,2.4232), new GeographicExtent("Austria", 46.4, 49.02, 9.53, 17.17), "", "");
Instead of null you have to call the method SevenParameterTransformation.createBursaWolfTransformation()
. The parameters for the specific transformations can be found in the internet. This should be done for all frames of reference.
Fix done in CTS see https://github.com/orbisgis/cts/pull/147 Note that NAD83 is not yet supported yet.
This issue has been reported on H2 database group. See : https://groups.google.com/g/h2-database/c/kR10UNaGs00
CTS unit for EPSGTransformTest