Skip to content
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

Coordinate transformation: enhacements related to PointMotionOperation and CoordinateMetadata #8340

Merged
merged 9 commits into from
Sep 15, 2023

Conversation

rouault
Copy link
Member

@rouault rouault commented Sep 6, 2023

Builds upon the enhancements of PROJ OSGeo/PROJ#3884 "Add support for transformations involving coordinate epoch changes (PointMotionOperation), mostly for Canadian NAD83(CSRS) case"

  • OSR SetFromUserInput(): add support for urn:ogc:def:coordinateMetadata (if PROJ >= 9.4)
  • OSR SetFromUserInput(): recognize 'EPSG:XXXX@YYYY' (PROJ >= 9.4)
  • Add OSRHasPointMotionOperation() (PROJ >= 9.4)
  • OGR_CT: handle point motion operations (PROJ >= 9.4)
  • gdalwarp and ogr2ogr: tune usage to allow both -s_coord_epoch and -t_coord_epoch
  • GDALCreateGenImgProjTransformer2(): correctly deal with same CRS but SRC_COORDINATE_EPOCH != DST_COORDINATE_EPOCH
  • gdaltransform: add -s_coord_epoch and -t_coord_epoch
  • OGR_CT: display epochs in debug messages

With that PR and PROJ's PR:

$ echo 268955 5540412 0  |  PROJ_NETWORK=ON gdaltransform -s_srs urn:ogc:def:coordinateMetadata:NRCAN::NAD83_CSRS_1997_MTM7_HT2_1997 -t_srs urn:ogc:def:coordinateMetadata:NRCAN::NAD83_CSRS_2010_UTM19_CGVD2013_2010
356670.104248718 5540546.58404172 -0.306164898123019
$ echo -79.5 60.5 | PROJ_NETWORK=ON gdaltransform -s_srs EPSG:8254 -s_coord_epoch 2002 -t_srs EPSG:8254 -t_coord_epoch 2010
-79.499999630188 60.4999999378478 0.0603169668465853
$ echo -79.5 60.5 | PROJ_NETWORK=ON  gdaltransform -s_srs "EPSG:8254 @ 2002" -t_srs "EPSG:8254 @ 2010"
-79.499999630188 60.4999999378478 0.0603169668465853

@rouault rouault added this to the 3.8.0 milestone Sep 6, 2023
@rouault rouault force-pushed the pointmotionoperation branch from 4020da6 to bdb654c Compare September 6, 2023 08:56
rouault added a commit to rouault/PDAL that referenced this pull request Sep 6, 2023
…nce built from SetFromUserInput()

This is useful to get the epoch for a SpatialReference built from a
string like 'urn:ogc:def:coordinateMetadata:AUTHORTIY::CODE code' (since
OSGeo/gdal#8340 and OSGeo/PROJ#3884), which
resolves to a CoordinateMetadata object with a CRS and potentially a
coordinate epoch
rouault added a commit to rouault/PDAL that referenced this pull request Sep 11, 2023
…nce built from SetFromUserInput()

This is useful to get the epoch for a SpatialReference built from a
string like 'urn:ogc:def:coordinateMetadata:AUTHORTIY::CODE code' (since
OSGeo/gdal#8340 and OSGeo/PROJ#3884), which
resolves to a CoordinateMetadata object with a CRS and potentially a
coordinate epoch
@rouault rouault force-pushed the pointmotionoperation branch from bdb654c to c4f5b92 Compare September 15, 2023 09:42
@rouault rouault merged commit 566204a into OSGeo:master Sep 15, 2023
29 checks passed
rouault added a commit to rouault/PDAL that referenced this pull request Sep 15, 2023
…nce built from SetFromUserInput()

This is useful to get the epoch for a SpatialReference built from a
string like 'urn:ogc:def:coordinateMetadata:AUTHORTIY::CODE code' (since
OSGeo/gdal#8340 and OSGeo/PROJ#3884), which
resolves to a CoordinateMetadata object with a CRS and potentially a
coordinate epoch
hobu pushed a commit to PDAL/PDAL that referenced this pull request Sep 18, 2023
* SpatialReference::set(): store coordinate epoch from OGRSpatialReference built from SetFromUserInput()

This is useful to get the epoch for a SpatialReference built from a
string like 'urn:ogc:def:coordinateMetadata:AUTHORTIY::CODE code' (since
OSGeo/gdal#8340 and OSGeo/PROJ#3884), which
resolves to a CoordinateMetadata object with a CRS and potentially a
coordinate epoch

* SrsTransform: make sure to propagate coordinate epoch when rebuilding OGRSpatialReference objects

* SpatialReference: add a m_wkt2 member filled in set() and returned by getWKT2()

* SrsTransform: use SpatialReference::getWKT2()

This limits the loss of information, particularly for CRS like
'urn:ogc:def:coordinateMetadata:NRCAN::NAD83_CSRS_1997_MTM7_HT2_1997'
which include a GEOIDMODEL[] node, that would be lost otherwise

* SpatialReference::isWKT2(): add missing keywords, and fix typo VERITCALCRS -> VERTICALCRS
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.

1 participant