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

GeoPackage WKT Extension 21-057 EPOCH #675

Open
jamesresslernga opened this issue Feb 5, 2024 · 4 comments
Open

GeoPackage WKT Extension 21-057 EPOCH #675

jamesresslernga opened this issue Feb 5, 2024 · 4 comments

Comments

@jamesresslernga
Copy link

jamesresslernga commented Feb 5, 2024

Ref: GeoPackage WKT Extension 1.1 (21-057): http://www.opengis.net/doc/IS/geopackage-crs-wkt/1.1
Epoch date.
I understand the EPOCH implementation in 21-057 enables GeoPackage to specify a CRS realization (such as WGS 84 G1150, EPSG 9055) and a coordinate EPOCH in the GeoPackage gpkg_spatial_ref_sys table. The Epoch value is a Gregorian date such as "2024.10" , which is 2/5/2024 = 36/366).

Do you know of any GeoPackage implementations and sample data using the EPOCH field in GeoPackage WKT (OGC 21-057) ?

Can the EPOCH be used for the vertical CRS?

@jyutzler
Copy link
Contributor

jyutzler commented Feb 7, 2024

I would advise against abusing the EPOCH for another purpose like vertical CRS. Don't we have CRSs with vertical components that can be used for this purpose?

@jratike80
Copy link

jratike80 commented Feb 13, 2024

Do you know of any GeoPackage implementations and sample data using the EPOCH field in GeoPackage WKT (OGC 21-057) ?

GDAL can do it. Below are example commands provided by Even Rouault. For those who do not know GDAL well, the gdal_translate command saves a tiff image small_world.tif into GeoPackage and attaches a compound CRS with an epoch 2024.123. The gdalinfo command proves that the epoch can be read back from the GeoPackage as it was set.

$ docker run --rm -it -v $PWD:$PWD ghcr.io/osgeo/gdal:alpine-small-3.8.3 gdal_translate https://raw.githubusercontent.com/OSGeo/gdal/master/autotest/gdrivers/data/small_world.tif $PWD/out.gpkg -a_srs EPSG:9057+3855 -a_coord_epoch 2024.123

$ docker run --rm -it -v $PWD:$PWD ghcr.io/osgeo/gdal:alpine-small-3.8.3 gdalinfo $PWD/out.gpkg
Driver: GPKG/GeoPackage
Files: /home/even/gdal/gdal/build_cmake/out.gpkg
Size is 400, 200
Coordinate System is:
COMPOUNDCRS["WGS 84 (G1762) + EGM2008 height",
    GEOGCRS["WGS 84 (G1762)",
        DYNAMIC[
            FRAMEEPOCH[2005]],
        DATUM["World Geodetic System 1984 (G1762)",
            ELLIPSOID["WGS 84",6378137,298.257223563,
                LENGTHUNIT["metre",1]]],
        PRIMEM["Greenwich",0,
            ANGLEUNIT["degree",0.0174532925199433]],
        CS[ellipsoidal,2],
            AXIS["geodetic latitude (Lat)",north,
                ORDER[1],
                ANGLEUNIT["degree",0.0174532925199433]],
            AXIS["geodetic longitude (Lon)",east,
                ORDER[2],
                ANGLEUNIT["degree",0.0174532925199433]],
        USAGE[
            SCOPE["Geodesy. Navigation and positioning using GPS satellite system."],
            AREA["World."],
            BBOX[-90,-180,90,180]],
        ID["EPSG",9057]],
    VERTCRS["EGM2008 height",
        VDATUM["EGM2008 geoid"],
        CS[vertical,1],
            AXIS["gravity-related height (H)",up,
                LENGTHUNIT["metre",1]],
        USAGE[
            SCOPE["Geodesy."],
            AREA["World."],
            BBOX[-90,-180,90,180]],
        ID["EPSG",3855]]]
Data axis to CRS axis mapping: 2,1,3
Coordinate epoch: 2024.123

@jamesresslernga
Copy link
Author

The feedback and meeting on 2/13/2024 was very helpful. DGIWG web services technical panel (P5) is going to use the WKT extension 21-057 with the optional epoch field with implementation guidance as follows. Conditional requirements will verify the format of the epoch field and presence of the DYNAMIC[FRAMEEPOCH] for the horizontal CRS.

SWG members of welcome to comment on this guidance, this issue can be closed.

Proposed wording in DGIWG-126.

With GeoPackage WKT Extension v1.1, the epoch column is added to gpkg_spatial_ref_sys. Use of epoch for gridded data is optional. If the epoch is defined for the SRS, it represents the Coordinate Epoch for the gridded data, which is the date to which the gridded data is referenced (e.g. the observation date). GDAL defines the epoch as: "In a dynamic CRS, coordinates of a point on the surface of the Earth may change with time. To be unambiguous the coordinates must always be qualified with the epoch at which they are valid." When the Coordinate Epoch is defined in GeoPackage, the horizontal SRS in the GeoPackage must contain a dynamic frame element as expressed in WKT2. Distinct from the Coordinate Epoch, the SRS Epoch of the horizontal SRS is expressed in the WKT2 elements DYNAMIC[FRAMEEPOCH[]], where is a real number of the SRS Epoch date. If the Coordinate Epoch is defined, the SRS epoch must also be defined in the DYNAMIC CRS. Logically the Coordinate Epoch date should be greater than or equal to <frame_date>, but that condition is not enforced in the profile.

The epoch column in gpkg_spatial_ref_sys is defined as a real number in the form of YYYY.DDDD, the same format as , where YYYY is the year and DDDD are 4 significant digits of the date. The Coordinate Epoch is a floating point number expressing the year and fraction of year for the date of the gridded data coordinates. Even though many examples of epoch only depict 2 digits, DDDD should contain 4 digits to represent a single day, and may be omitted if equal to 0. The fraction DDDD accounts for leap years. For example, 03/25/2016 is day 85 of 2016, so the epoch is equal to 2016.2329. Likewise, 03/25/2017 is day 84 of 2017, represented as epoch 2017.2301.

@jamesresslernga
Copy link
Author

Closing this issue. Multiple CRS IDs can be used for different epoch dates with the same geographic CRS.

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

No branches or pull requests

3 participants