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

[Backport 9.4] DerivedProjectedCRS: deal with lack of explicit CS in BASEPROJCRS in WKT #4139

Merged
merged 3 commits into from
May 9, 2024

Conversation

rouault
Copy link
Member

@rouault rouault commented May 7, 2024

Backport #4124
Authored by: @rouault

…EPROJCRS

Current WKT2 grammar doesn't allow an explicit CS (Coordinate System) in the BASEPROJCRS of
a DERIVEDPROJCRS. This leads to ambiguities when instanciating the
BASEPROJCRS. Cf OSGeo/gdal#9732 (comment)
for a longer analysis

When importing such a DerivedProjectedCRS, we apply the following
strategy to try to reconstrut the CS of the baseProjCRS:
- if the baseProjCRS has an ID[], do a datebase lookup for this object,
  and if found, use its CS
- otherwise, do a database lookup from the name of the baseProjCRS, and
  if found, use its CS
- otherwise, browse through the PARAMETERs of the CONVERSION of the
  BASEPROJCRS, and if there is at least one such PARAMETER that has a
  linear unit, and if all PARAMETERs with a linear unit have the same
  one, then use it to reconstruct a Easting/Northing CartesianCS.
- otherwise, fallback to current behaviour, that is return a
  Easting/Northing CartesianCS with metre unit.

Fixes OSGeo/gdal#9732
Current WKT grammar (as of WKT2 18-010r11) does not allow a
BASEPROJCRS.CS node, but there are situations where this is
ambiguous and we want to allow one.
Cf OSGeo/gdal#9732 (comment)
@rouault rouault added this to the 9.4.1 milestone May 9, 2024
@rouault rouault merged commit 5e9c999 into 9.4 May 9, 2024
45 checks passed
@rouault rouault deleted the backport-4124-to-9.4 branch May 9, 2024 19:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant