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

Jonathan Kane jontkane at uw.edu
Thu Jun 15 13:00:56 PDT 2023


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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/proj/attachments/20230615/a936c3cd/attachment.htm>


More information about the PROJ mailing list