locationtech / geotrellis

GeoTrellis is a geographic data processing engine for high performance applications.
http://geotrellis.io
Other
1.34k stars 361 forks source link

Geotiff Tags not fully compatible with GDAL #3496

Open jdries opened 1 year ago

jdries commented 1 year ago

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: https://github.com/locationtech/geotrellis/blob/fa88aeddab0849cdb8f830d3747554bc7adceb1f/raster/src/main/scala/geotrellis/raster/io/geotiff/Tags.scala#L52

Originally reported here: https://github.com/Open-EO/openeo-geopyspark-driver/issues/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 commented 1 year ago

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