Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feat] Implement Functional CRS Comparison in r.in.gdal to Avoid Unnecessary (?) WKT Mismatch Errors #4296

Open
fxi opened this issue Sep 9, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@fxi
Copy link

fxi commented Sep 9, 2024

Is your feature request related to a problem? Please describe.

When using r.in.gdal, I’ve encountered cases where GRASS GIS flags functionally equivalent CRS (Coordinate Reference Systems) as mismatched due to differences in their WKT representations. This can lead to warnings or errors, even when the projections are functionally identical. In contrast, tools like R's sf package use GDAL's OGRSpatialReference::IsSame to check for functional equivalence, focusing on essential projection parameters rather than strict WKT matching.

I might be missing some specific logic in GRASS GIS, but based on my experience, this behavior feels stricter than necessary for practical use.

Describe the solution you'd like

If feasible, it might be helpful for r.in.gdal (in proj.c?) to incorporate a functional CRS equivalence check, such as GDAL's OGRSpatialReference::IsSame, in the projection comparison logic. This could reduce false positives in CRS mismatches caused by minor WKT differences, while still ensuring accurate CRS handling.

Describe alternatives you've considered

  • Current workaround: Using the -o flag to override CRS checks, which works but skips potentially important projection validation. On my side, its validated earlier by sf, but it could be cleaner to handle this in GRASS. Maybe.

Additional context

If this enhancement is appropriate, it would align GRASS with the behavior of other tools like R's sf package, potentially improving usability by avoiding unnecessary CRS mismatch errors without sacrificing accuracy. However, if there are existing mechanisms in GRASS that already handle this, I’d appreciate clarification on how best to approach these scenarios. Thanks !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant