Skip to content

Conversation

@phaarnes
Copy link
Contributor

@phaarnes phaarnes commented Dec 7, 2025

Fix tests to pass for PROJ 9.7.0+ EPSG database changes

Description

This PR updates two tests (test_datum_horizontal and test_sub_crs) that fail with PROJ 9.7.0+ due to changes in the EPSG database.

Background

Starting with PROJ 9.7.0 (which includes EPSG v12.022), the EPSG database introduced national realizations of ETRS89 to better reflect how countries actually implement the European Terrestrial Reference System.

Norway uses ETRS89-NOR (also known as EUREF89), which is a specific national realization tied to epoch 1995. This is technically more correct than using the generic ETRS89 ensemble, as Norway's coordinates are tied to a specific realization.

What changed in PROJ 9.7.0

For Norwegian CRS definitions:

PROJ < 9.7.0 PROJ >= 9.7.0
EPSG:5972 ETRS89 ensemble (EPSG:6258) ETRS89-NOR (EPSG:1407)
EPSG:5972 horizontal sub-CRS EPSG:25832 (ETRS89 / UTM zone 32N) EPSG:11022 (ETRS89-NOR / UTM zone 32N)

Similar changes have been made for other Nordic countries (Denmark, Sweden, Finland) and will likely continue for other nations.

Changes

  • Added PROJ_GTE_97 version check constant in test/conftest.py
  • Updated test_datum_horizontal to test against the appropriate datum based on PROJ version
  • Updated test_sub_crs to test against the appropriate projected CRS (EPSG:25832 or EPSG:11022) based on PROJ version

@phaarnes phaarnes force-pushed the fix/tests_for_proj97 branch from 85887ed to cbac679 Compare December 7, 2025 07:43
@codecov
Copy link

codecov bot commented Dec 7, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.85%. Comparing base (b78a50d) to head (2c3b7e6).
⚠️ Report is 32 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1557      +/-   ##
==========================================
- Coverage   96.55%   95.85%   -0.71%     
==========================================
  Files          20       20              
  Lines        1827     1832       +5     
==========================================
- Hits         1764     1756       -8     
- Misses         63       76      +13     

☔ View full report in Codecov by Sentry.
📢 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.

@phaarnes
Copy link
Contributor Author

phaarnes commented Dec 7, 2025

@snowman2
Looks like all the tests passes now.

@snowman2 snowman2 added the test Test related issues label Dec 7, 2025
@snowman2 snowman2 added this to the 3.8.0 milestone Dec 7, 2025
@snowman2 snowman2 merged commit 055cab9 into pyproj4:main Dec 7, 2025
18 checks passed
@snowman2
Copy link
Member

snowman2 commented Dec 7, 2025

Thanks @phaarnes 👍

@phaarnes phaarnes deleted the fix/tests_for_proj97 branch December 11, 2025 13:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test Test related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Test failures with PROJ 9.7.1

2 participants