Thanks all for the replies. Yaniv,
Using CRS.parseWKT(...) instead of CRS.decode(...) works indeed. That's a nice workaround for a quick fix. The results are very close but not equal to the epsg.io website (1m difference). Mark, Thanks for the input, that helped me a lot. I swapped my x/y values as a quick test and this indeed worked too. I'm therefore guessing the axis order were swapped (I didn't check CRS.AxisOrder directly though). As for Yaniv's solution the results are about 1m away from what epsg.io gives. I then started looking into the accuracy as you mentioned it and as the difference I found aroused my curiosity. Using Postgres/PostGIS to perform the same conversion gives me the same results (precision aside) as the epsg.io website. I would therefore tend to trust those two rather than what I get from my current implementation. select * from ST_AsText(ST_Transform(ST_SetSRID(ST_Point(2572506.000,5757839.000),22192),4326)) >>> POINT(-68.1718113362886 -38.328903154386) I will investigate the gt-epsg-hsql library and see if I can use it. Thanks, Julien ________________________________ From: Phil Scadden <p.scad...@gns.cri.nz> Sent: Friday, July 10, 2020 7:26 AM To: geotools-gt2-users@lists.sourceforge.net <geotools-gt2-users@lists.sourceforge.net> Subject: Re: [Geotools-gt2-users] EPSG 22192 It looks to me like geotools def, the false origin easting coordinate power of 10 out. 2500000.0 instead of 25000000. Remove the decimal point and it should improve things no end. -----Original Message----- From: Mark Prins <mc.pr...@gmail.com> Sent: Friday, 10 July 2020 01:09 To: geotools-gt2-users@lists.sourceforge.net Subject: Re: [Geotools-gt2-users] EPSG 22192 On 09-07-2020 15:07, Mark Prins wrote: > It seems the axis are swapped (check CRS.AxisOrder is correct) . > > also (not sure about this) I think you may get more accurate results > for reprojections when using one of the database-based projection libs eg. > gt-epsg-hsql and not the wkt/propery file based one. > > As is noted on https://docs.geotools.org/stable/userguide/library/referencing/wkt.html "It is not quite as good as the official EPSG database; as the codes represented here do not express the full range of bursa wolf parameters available in the official EPSG database. Some liberty has also been taken with axis order with the contents often presented is "x/y" order as expected by a simple drawing application." -M _______________________________________________ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users Notice: This email and any attachments are confidential and may not be used, published or redistributed without the prior written consent of the Institute of Geological and Nuclear Sciences Limited (GNS Science). If received in error please destroy and immediately notify GNS Science. Do not copy or disclose the contents. _______________________________________________ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
_______________________________________________ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users