opengeospatial / geopackage

An asciidoc version of the GeoPackage specification for easier collaboration
https://www.geopackage.org
Other
264 stars 71 forks source link

Storage Question on WKT for CRS Extension #642

Closed bosborn closed 1 year ago

bosborn commented 1 year ago

If storing feature data with the same dynamic CRS WKT and different epochs, the definition should be stored once as a SRS for each unique epoch?

GeoPackage producers often set the srs_id equal to the organization_coordsys_id, which would not work for multiple epochs of the same crs wkt. Since the epoch is stored in the SRS table, every instance of data with a different epoch requires a new SRS entry.

Example:

= ``` GEODCRS["WGS 84 (G1762)", DYNAMIC[ FRAMEEPOCH[2005.0]], DATUM["World Geodetic System 1984 (G1762)", ELLIPSOID["WGS 84",6378137,298.257223563, LENGTHUNIT["metre",1, ID["EPSG",9001]], ID["EPSG",7030]], ID["EPSG",1156]], CS[Cartesian,3, ID["EPSG",6500]], AXIS["Geocentric X (X)",geocentricX, LENGTHUNIT["metre",1, ID["EPSG",9001]]], AXIS["Geocentric Y (Y)",geocentricY, LENGTHUNIT["metre",1, ID["EPSG",9001]]], AXIS["Geocentric Z (Z)",geocentricZ, LENGTHUNIT["metre",1, ID["EPSG",9001]]], ID["EPSG",7664]] ``` Assume there are 3 feature tables with epochs of 2005, 2017.53, and 2022.84. `gpkg_geometry_columns` table_name | column_name | geometry_type_name | srs_id | z | m --- | --- | --- | --- | --- | --- epsg7664_2005 | geometry | GEOMETRY | 7664 | 0 | 0 epsg7664_2017_53 | geometry | GEOMETRY | 1234 | 0 | 0 epsg7664_2022_84 | geometry | GEOMETRY | 4321 | 0 | 0 `gpkg_spatial_ref_sys` srs_name | srs_id | organization | organization_coordsys_id | definition | description | definition_12_063 | epoch --- | --- | --- | --- | --- | --- | --- | --- WGS 84 (G1762) | 7664 | EPSG | 7664 | '' | | | WGS 84 (G1762) | 1234 | EPSG | 7664 | '' | | | 2017.53 WGS 84 (G1762) | 4321 | EPSG | 7664 | '' | | | 2022.84 Not sure if this is a common scenario or not, but is this the intention for storage? Bonus question: How are transformations performed between same crs wkt definitions with different epochs [without a Coordinate Operation / Point Motion Operation](https://docs.opengeospatial.org/as/18-005r4/18-005r4.html#13)?
rouault commented 1 year ago

Not sure if this is a common scenario or not, but is this the intention for storage?

FWIW, this is how this is implemented in the GDAL GeoPackage driver.

How are transformations performed between same crs wkt definitions with different epochs without a Coordinate Operation / Point Motion Operation?

Not GeoPackage specific. Short answer: you likely need a plate motion model, like the ITRF2014 plate motion model (https://academic.oup.com/gji/article/209/3/1906/3095992). As far as I can remember, the general topic of dynamic CRS is dealt in https://www.iogp.org/bookstore/product/geomatics-guidance-note-25-dynamic-versus-static-crss-and-use-of-the-itrf/

jyutzler commented 1 year ago

@bosborn you have answered your own question, no? I believe it is definite that you need different srs_ids when you have multiple epochs.

bosborn commented 1 year ago

Yes I guess so and I implemented this way after asking. Was just confirming the WKT for CRS Extension specification intention before implementing due to: