Skip to content

krovak: fix inverse when the false easting and false northing differ - #4915

Open
birkskyum wants to merge 2 commits into
OSGeo:masterfrom
birkskyum:krovak-inverse-false-origin
Open

birkskyum wants to merge 2 commits into
OSGeo:masterfrom
birkskyum:krovak-inverse-false-origin

Conversation

@birkskyum

Copy link
Copy Markdown

+proj=krovak with different +x_0 and +y_0 doesn't round-trip. With +x_0=100 +y_0=0, 16.85°E 50.21°N comes back ~280 m away, because the inverse applies the false easting to the northing and the false northing to the easting. All EPSG Krovak CRSs use equal values, so they aren't affected.

This PR applies each offset to its own axis, the same way as the forward.

  • AI (Copilot or something similar) supported my development of this PR. See our policy about AI tool use. Use of AI tools must be indicated. (Claude Opus 5.5)
  • Tests added
  • Added clear title that can be used to generate release notes

@jjimenezshaw

Copy link
Copy Markdown
Contributor

Hi. Why were you testing krovak with false easting or northing? Is there any official CRS like that?

@birkskyum

birkskyum commented Oct 17, 2026 •

Copy link
Copy Markdown
Author

No, not that I know of. All the EPSG ones use the same value for both.

We're adding projection support in MapLibre, so I was fuzzing PROJ and proj4js for inconsistencies, and this was one of them. It still matters for custom strings, since the forward already handles different values correctly and only the inverse mixes them up. It's been like this since 9.4.0, when mod_krovak was added.

Comment thread test/gie/builtins.gie Outdated

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.

2 participants