Skip to content

Geotiff Tags not fully compatible with GDAL #3496

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

Closed
jdries opened this issue Jan 25, 2023 · 1 comment · Fixed by #3570
Closed

Geotiff Tags not fully compatible with GDAL #3496

jdries opened this issue Jan 25, 2023 · 1 comment · Fixed by #3570
Labels

Comments

@jdries
Copy link
Contributor

jdries commented Jan 25, 2023

Describe the bug

It seems not possible to write a band name to geotiff metadata that is compatible with GDAL.
Geotrellis writes this:

<GDALMetadata>
  <Item name="DESCRIPTION" sample="0">B02</Item>
</GDALMetadata>

While GDAL would like to also see a "role" attribute:

<GDALMetadata>
  <Item name="DESCRIPTION" sample="0" role="description">B02</Item>
</GDALMetadata>

In the Geotrellis code, it is very clear that the role attribute is not used:

<Item name={key} sample={i.toString}>{value}</Item>

Originally reported here:
Open-EO/openeo-geopyspark-driver#257

To Reproduce

Simply write a geotiff with tags, trying to set a DESCRIPTION on the bands.

Expected behavior

Geotrellis can generate metadata compliant with GDAL, as it already tries to do that.

Environment

Geotrellis 3.6.x

@pomadchin
Copy link
Member

Hey @jdries thanks for reporting, definitely sounds like a bug / oversight to me.

jdries added a commit to VitoTAP/geotrellis that referenced this issue Mar 20, 2025
jdries added a commit to VitoTAP/geotrellis that referenced this issue Apr 1, 2025
jdries added a commit to VitoTAP/geotrellis that referenced this issue Apr 2, 2025
pomadchin pushed a commit that referenced this issue Apr 4, 2025
* set gdal roles for well known tags
#3496

* support more tags + simplify
#3496
https://github.com/OSGeo/gdal/blob/b8f2a16baa8fe866c8cd053d89120844d51ca94f/frmts/gtiff/gtiffdataset_write.cpp#L4208

* Use Set instead of Array
#3496

* more robust XML equality check
#3496
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants