Skip to content

Return datum ensemble from CRS.datum for vertical CRS (issue #1679) - #1680

Open
phaarnes wants to merge 1 commit into
pyproj4:mainfrom
phaarnes:fix/vertical-crs-datum-ensemble
Open

phaarnes wants to merge 1 commit into
pyproj4:mainfrom
phaarnes:fix/vertical-crs-datum-ensemble

Conversation

@phaarnes

Copy link
Copy Markdown
Contributor

CRS.datum returned None for a vertical CRS based on a datum ensemble, such as EPSG:5799 and EPSG:9451. The same happened for the vertical part of a compound CRS in sub_crs_list.

With this change, CRS.from_epsg(5799).datum returns the Dansk Vertikal Reference 1990 ensemble datum ensemble.

Changes

  • _CRS.datum falls back to proj_crs_get_datum_ensemble() when proj_crs_get_datum() and proj_crs_get_horizontal_datum() both return NULL.
  • VerticalCRS now accepts a datum ensemble, as GeographicCRS already does. This is needed because to_cf() now writes geopotential_datum_name for these CRS, and from_cf() builds a VerticalCRS from that name.

Tested locally against PROJ 9.8.1.

@codecov

codecov Bot commented Nov 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.82%. Comparing base (cce793d) to head (be1856f).
⚠️ Report is 12 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1680   +/-   ##
=======================================
  Coverage   95.81%   95.82%           
=======================================
  Files          20       20           
  Lines        1886     1890    +4     
=======================================
+ Hits         1807     1811    +4     
  Misses         79       79           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

This branch has not been deployed

No deployments
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.

CRS.datum is None for a vertical CRS whose datum is a datum ensemble

1 participant