[PROJ] Determining that two CRSes are "close enough"

Even Rouault even.rouault at spatialys.com
Thu Jun 15 13:08:14 PDT 2023


Jonathan,

if the CRS come from a "known object" (like EPSG:XXXX), then you could 
use proj_identify(), cf 
https://proj.org/en/9.2/development/reference/functions.html#c.proj_identify, 
on both CRS and check if there's a common match with a confidence >= 90% 
(you could possibly lower to 70%)

Even

Le 15/06/2023 à 22:00, Jonathan Kane a écrit :
> Is there a way in the PROJ API to detect that two CRSes are identical 
> enough that the transform between them is the identity transform? 
> Context below.
>
> I'm currently writing software, where, as a debug/sanity check, I 
> double check that my data objects have the same CRS, 
> with proj_is_equivalent_to(...,...,PJ_COMP_EQUIVALENT). The problem 
> I'm encountering is that, sometimes, the difference in how CRSes are 
> stored in different file formats causes that function to return false 
> even when they're really 'the same'. Like, for example, if I write a 
> .tif file using GDAL with a given WKT string, and then read that file 
> off the harddrive later, it won't register as equivalent to the CRS, 
> and inspecting the WKT, it's very minorly different (one of the two 
> will have a field listed as unknown, but the other will specify that 
> field; that sort of thing).
>
> I get that this is probably unavoidable to some extent, because not 
> every file format contains enough information to reproduce the 
> original WKT. But is there any way to detect that two CRSes are 
> basically the same? All I really care about is if I need to transform. 
> If the transform between them is an identity, I don't care if the 
> details are different.
>
> _______________________________________________
> PROJ mailing list
> PROJ at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/proj

-- 
http://www.spatialys.com
My software is free, but my time generally not.



More information about the PROJ mailing list