-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Improve support for dynamic crs -> dynamic CRS transform at different epochs (since PROJ 9.4.0) #57719
Comments
There's no reason this shouldn't already be working in QGIS now -- the limitation was entirely on the PROJ side |
Even using QGIS 3.36.3 with PRJ 9.4.0 (OSGeo4W), the following error message is sometimes displayed, e.g.:
Using the GUI, it is not possible to set or change the Epoch for a layer or for the project. It is not possible to set the Epoch in the "Reproject layer" or "Assign projection" processing algorithm's dialog windows or in the "Save Vector Layer as..." dialog window. It is not possible to to set the Epoch in the Setting the Epoch for layer and project using PyQGIS, the coordinate transformation between different CRS @ Epoch doesn't give the same result as using ogr2ogr or cs2cs in some cases. For example, Pointz_9989-2024_249.zip is a PointZ layer "EPSG:9989 - ITRF2020 @ 2024.25" (actually 2024.249: Apr 1st, 2024) with 1 PointZ having coordinates: Adding such layer to a new project in QGIS, the error message "CRITICAL Cannot transform between dynamic CRS at difference coordinate epochs" is displayed. Reprojecting such layer using the "Convert format" processing algorithm with the additional options The same as using the cs2cs tool or the Natural Resources Canada TRX tool:
Using QGIS, either with the on-the-fly reprojection or using the "Reproject layer" processing algorithm (whichever transformation is selected) or the "Save Vector Layer as..." dialog window (whichever transformation is set in the project between such CRS's), the reprojected coordinates are different: The same occurs using QgsCoordinateTransform: sourceCrs = QgsCoordinateReferenceSystem('EPSG:9989')
sourceCrs.setCoordinateEpoch(2024.249)
destCrs = QgsCoordinateReferenceSystem('EPSG:22717')
destCrs.setCoordinateEpoch(2010)
tr = QgsCoordinateTransform(sourceCrs, destCrs, QgsProject.instance())
geom = QgsGeometry(QgsPoint(-80.09282164175, 43.918799362083334, 387.746))
geom.transform(tr)
print(geom)
<QgsGeometry: PointZ (572832.25049596535973251 4863253.04105716664344072 387.7459999999999809)> In the QgsCoordinateTransoform API docs:
|
Feature description
Since PROJ 9.4.0, the PROJ library can perform transformations involving coordinate epoch changes OSGeo/PROJ#3884, OSGeo/gdal#8340.
Refs.: #43143, #43188.
Additional context
No response
The text was updated successfully, but these errors were encountered: