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

Possibility of using TIFF encoding with integer datatype for 2d-gridded-coverage #680

Open
gcebelieu opened this issue Feb 26, 2024 · 3 comments

Comments

@gcebelieu
Copy link

Reading 17-066r2 Geopackage Extension for Tiled Gridded Coverage Data it is unclear to me if it is possible to use TIFF encoding together with values of type integer in conformance with this extension.

In Annex A, Test case ID /extensions/coverage/table_val/tpudt seems to clearly forbid this use:

If datatype is integer, fail if tile_data is not a valid PNG image

but Requirement 13 Req/gpkg-pyramid-user-data-datatype-integer

For data where the datatype column of the corresponding row in the gpkg_2d_gridded_coverage_ancillary table is integer, the tile_data BLOB in the tile pyramid user data table containing tiled, gridded data SHALL be of MIME type image/png or image/tiff. If type png is being used, the data SHALL be 16-bit unsigned integer (single channel - "greyscale").

and Requirement 17 Req/gpkg-tiff-datatype

A` TIFF file storing tiled GeneralGridCoverage, class grid-regular (such as elevation data) SHALL have 32-bit floating (FLOAT - 11) data type or have a binary data type where the SampleFormat has a value of either 1 (unsigned integer) or 2 (signed integer) AND the BitsPerSample is either 8, 16, or 32.

seem to allow this this type of encoding using TIFF.

What is the correct interpretation to have?

@rouault
Copy link
Contributor

rouault commented Feb 27, 2024

Not speaking on behalf the authors, but there are several other mentions in the spec where integer datatype for TIFF is mentioned. That said, from a practical point of view, that's not super interesting as PNG deflate compression + filters are likely going to outperform TIFF LZW compression from a compression rate point of view.

@rouault
Copy link
Contributor

rouault commented Feb 27, 2024

actually clearly identified in #552 and https://portal.ogc.org/files/98334#_issue_552_request_ability_to_support_additional_data_types_in_geopackage_coverages as a 1.1 change (and I now realize that GDAL hasn't caught up with that v1.1 extension and only handles TIFF Float32 or PNG 8 and 16 bits (possibly with offset, scale))

@gcebelieu
Copy link
Author

gcebelieu commented Feb 28, 2024

Thank you for your answer. I understand this is a possible use but may be not a good practice compared to PNG encoding.

Shouldn't the ATS test /extensions/coverage/table_val/tpudt be modified in order to be consistent with this possible use stated in the standard?

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

2 participants