[Geotools-devel] Help with GeoTools : Trouble transforming coordinates
Hello everyone, I hope this message finds you well. My name is Mourad Harmim, a Data Engineer consultant from France. Still getting used to GeoTools, I’m facing an issue when I try to transform coordinates from Lambert 2 extended (EPSG :27572) to Lambert 93 (EPSE :2154). Here is my current situation : * When I use : this.mathTransform = CRS.findMathTransform(CRS.decode("EPSG:27572") , CRS.decode("EPSG:2154"), false) there is an error telling that Bursa Wolf parameters are missing * When I use : this.mathTransform = CRS.findMathTransform(CRS.decode("EPSG:27572") , CRS.decode("EPSG:2154"), true) I get coordinates but they seem inaccurate (I guess it is about a missing grid shift) * When I use intermediate system : Lambert 2 extended (EPSG :27572) to WSG84 (EPSG:4326) to Lambert 93 (EPSE :2154) I get better results but still inaccurate. I would like to know what it is the correct approch to have an accurate transformation between these two systems. I hope that it is not inappropriate to ask for your help through this email and I hope to hear from you soon. Thank you. Mourad Harmim. ___ GeoTools-Devel mailing list GeoTools-Devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-devel
Re: [Geotools-devel] Help with GeoTools : Trouble transforming coordinates
Hello everyone, Unfortunately I could not find any clues in the public resources. Should I try a specifc version of GeoTools java dependency ? Any suggestion is warmly welcomed. Thank you, Mourad Harmim. De : Mourad HARMIM Envoyé : lundi 15 juillet 2024 09:52 À : Jody Garnett Objet : RE: [Geotools-devel] Help with GeoTools : Trouble transforming coordinates Hello Jody, Thank you for your early reply. I actually added the dependency gt-epsg-hsql where the thecoordinate references are supposed to be. I also tried passing wkt definitions (which reliability are not sure) but still not working. I'll lookup the guide you provided. Let's keep in touch. Best regards, Mourad Harmim. De : Jody Garnett Envoyé : lundi 15 juillet 2024 03:08 À : Mourad HARMIM Cc : geotools-devel@lists.sourceforge.net ; geotools-gt2-us...@lists.sourceforge.net Objet : Re: [Geotools-devel] Help with GeoTools : Trouble transforming coordinates The user list is the right place to ask. I do not work on the coordinate reference system so much myself, there is a handy guide for configuring here: https://docs.geoserver.org/main/en/user/configuration/crshandling/index.html Using this approach you can provide the transform, however I am curious why GeoTools does not have the required information. Are you using gt-epsg-shall for definitions or the wkt one? If you look up online can you compare the information to what is included in GeoTools? -- Jody Garnett On Sun, Jul 14, 2024 at 5:31 PM Mourad HARMIM mailto:mourad.har...@live.fr>> wrote: Hello everyone, I hope this message finds you well. My name is Mourad Harmim, a Data Engineer consultant from France. Still getting used to GeoTools, I’m facing an issue when I try to transform coordinates from Lambert 2 extended (EPSG :27572) to Lambert 93 (EPSE :2154). Here is my current situation : * When I use : this.mathTransform = CRS.findMathTransform(CRS.decode("EPSG:27572") , CRS.decode("EPSG:2154"), false) there is an error telling that Bursa Wolf parameters are missing * When I use : this.mathTransform = CRS.findMathTransform(CRS.decode("EPSG:27572") , CRS.decode("EPSG:2154"), true) I get coordinates but they seem inaccurate (I guess it is about a missing grid shift) * When I use intermediate system : Lambert 2 extended (EPSG :27572) to WSG84 (EPSG:4326) to Lambert 93 (EPSE :2154) I get better results but still inaccurate. I would like to know what it is the correct approch to have an accurate transformation between these two systems. I hope that it is not inappropriate to ask for your help through this email and I hope to hear from you soon. Thank you. Mourad Harmim. ___ GeoTools-Devel mailing list GeoTools-Devel@lists.sourceforge.net<mailto:GeoTools-Devel@lists.sourceforge.net> https://lists.sourceforge.net/lists/listinfo/geotools-devel ___ GeoTools-Devel mailing list GeoTools-Devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-devel
Re: [Geotools-devel] Help with GeoTools : Trouble transforming coordinates
Hello Ian, Thank you for your reply. Unfortunatly a was unable to find a corresponding grid shift nor the right parameters for this specific transformation. What is suprising is epsg.io online transformer it is actually possible to do it : Transform coordinates - GPS online converter (epsg.io)<https://epsg.io/transform#s_srs=27572&t_srs=2154&x=601218.2709050&y=2428184.1367070> I found the source code of epsg.io and they implemented the transformation using "osr" library in python : epsg.io/app.py at master · maptiler/epsg.io · GitHub<https://github.com/maptiler/epsg.io/blob/master/app.py#L1380> However I could not find anything similair in java. Kind regards, Mourad Harmim. De : Ian Turton Envoyé : jeudi 1 août 2024 10:32 À : Mourad HARMIM Cc : geotools-gt2-us...@lists.sourceforge.net ; geotools-devel@lists.sourceforge.net Objet : Re: [Geotools-devel] Help with GeoTools : Trouble transforming coordinates >From a quick look on epsg.io<http://epsg.io> there seems not to be a direct >transform from 27572 to 2154 so that is why the TOWGS or Bursa Wolf transform >is needed. These would appear to have a 2m accuracy so some transformation >error is to be expected. If you have a grid shift or other transformation file available then you can add it to GeoTools as described here - https://gis.stackexchange.com/questions/313512/specifying-epsg-transformation-method-in-geotools/313523#313523 Ian On Mon, 15 Jul 2024 at 01:31, Mourad HARMIM mailto:mourad.har...@live.fr>> wrote: Hello everyone, I hope this message finds you well. My name is Mourad Harmim, a Data Engineer consultant from France. Still getting used to GeoTools, I’m facing an issue when I try to transform coordinates from Lambert 2 extended (EPSG :27572) to Lambert 93 (EPSE :2154). Here is my current situation : * When I use : this.mathTransform = CRS.findMathTransform(CRS.decode("EPSG:27572") , CRS.decode("EPSG:2154"), false) there is an error telling that Bursa Wolf parameters are missing * When I use : this.mathTransform = CRS.findMathTransform(CRS.decode("EPSG:27572") , CRS.decode("EPSG:2154"), true) I get coordinates but they seem inaccurate (I guess it is about a missing grid shift) * When I use intermediate system : Lambert 2 extended (EPSG :27572) to WSG84 (EPSG:4326) to Lambert 93 (EPSE :2154) I get better results but still inaccurate. I would like to know what it is the correct approch to have an accurate transformation between these two systems. I hope that it is not inappropriate to ask for your help through this email and I hope to hear from you soon. Thank you. Mourad Harmim. ___ GeoTools-Devel mailing list GeoTools-Devel@lists.sourceforge.net<mailto:GeoTools-Devel@lists.sourceforge.net> https://lists.sourceforge.net/lists/listinfo/geotools-devel -- Ian Turton ___ GeoTools-Devel mailing list GeoTools-Devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-devel