-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Incorrect unit conversion on affine transformation #9732
Comments
Projinfo prints a warning, I do not know what it means. At least changing CS into ID is not a right fix.
|
@jratike80 The warning is caused by the CS definition in the BASEPROJCRS. You could remove that part but it results in the same issue. |
email sent to crs.swg@lists.ogc.org:
Working on workaround on PROJ (and potentially GDAL) side |
…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)
…ns where there's ambiguity Cf OSGeo/gdal#9732 (comment)
…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)
…ns where there's ambiguity Cf OSGeo/gdal#9732 (comment)
We export CRS objects to PROJJSON rather than WKT2:2019 because PROJJSON is a bit more verbose, which helps in situations like OSGeo#9732 / OSGeo/PROJ#4124 where we want to export a DerivedProjectedCRS whose base ProjectedCRS has non-metre axis. Fixes OSGeo#9732
We export CRS objects to PROJJSON rather than WKT2:2019 because PROJJSON is a bit more verbose, which helps in situations like OSGeo#9732 / OSGeo/PROJ#4124 where we want to export a DerivedProjectedCRS whose base ProjectedCRS has non-metre axis. Fixes OSGeo#9732
We export CRS objects to PROJJSON rather than WKT2:2019 because PROJJSON is a bit more verbose, which helps in situations like OSGeo#9732 / OSGeo/PROJ#4124 where we want to export a DerivedProjectedCRS whose base ProjectedCRS has non-metre axis. Fixes OSGeo#9732
We export CRS objects to PROJJSON rather than WKT2:2019 because PROJJSON is a bit more verbose, which helps in situations like #9732 / OSGeo/PROJ#4124 where we want to export a DerivedProjectedCRS whose base ProjectedCRS has non-metre axis. Fixes #9732
…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)
…ns where there's ambiguity Cf OSGeo/gdal#9732 (comment)
What is the bug?
I get different results between the cs2cs app and the c# bindings when trying to transform a coordinate to a simple derived CRS. This only happens for coordinate systems that are not in foot.
I have prepared a basic example where I use a derived CRS to offset the X coordinate by 1000ftUS.
The result when using cs2cs is what I would expect. The c# version first seems to do an unnecessary unit conversion.
Input: 2300000.00 2000000.00 0.0
Output cs2cs: 2301000.00 2000000.00 0.00
Output c#: 702041.4020828041, 609601.2192024384, 0
Steps to reproduce the issue
Using C# bindings:
Using cs2cs in command line:
For readability I repeat the WKT of the derived CRS:
Versions and provenance
I'm using GDAL 3.8.4 (with proj 9.3.0) downloaded from https://www.gisinternals.com/release.php.
Additional context
No response
The text was updated successfully, but these errors were encountered: