You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
getTOWGS84Parameters(): return the inverted values for an inverse Helmert transformation - #4914
When EPSG only defines a 7-parameter Helmert transformation from WGS 84 to a datum, the bound CRS export writes its forward parameters as +towgs84, so the shift goes the wrong way. projinfo EPSG:6991 --boundcrs-to-wgs84 -o PROJ gives a string that PROJ itself places ~156 m from its own EPSG:4326 to EPSG:6991 result. proj_coordoperation_get_towgs84_values() returns the same forward values for every such reversed transformation, 17 of them among the operations to WGS 84.
A 7-parameter inverse stays an InverseTransformation, which keeps the parameter values of the forward one. This PR makes getTOWGS84Parameters() use the approximate inverse there, as _exportToWKT() already does.
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
The exported string lands 155 m from PROJ's own result. EPSG:9189 is defined from WGS 84 to IG05/12, so +towgs84 needs its inverse, but the export writes the forward parameters. --boundcrs-to-wgs84 gives the same string.
With this PR, projinfo EPSG:6991 -o PROJ gives +towgs84=23.772,17.49,17.859,-0.3132,-1.85274,1.67299,-5.4262, and the same cs2cs call returns 219660.851 631746.029, identical to EPSG:4326 to EPSG:6991.
This branch has not been deployed
No deployments
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When EPSG only defines a 7-parameter Helmert transformation from WGS 84 to a datum, the bound CRS export writes its forward parameters as
+towgs84, so the shift goes the wrong way.projinfo EPSG:6991 --boundcrs-to-wgs84 -o PROJgives a string that PROJ itself places ~156 m from its own EPSG:4326 to EPSG:6991 result.proj_coordoperation_get_towgs84_values()returns the same forward values for every such reversed transformation, 17 of them among the operations to WGS 84.A 7-parameter inverse stays an
InverseTransformation, which keeps the parameter values of the forward one. This PR makesgetTOWGS84Parameters()use the approximate inverse there, as_exportToWKT()already does.