Arbitrary metadata not read from rasters in GDAL
See the files in this zipfile: https://github.com/user-attachments/files/19419830/sub_leaf_type_2021.zip
using ArchGDAL
dataset = ArchGDAL.read("sub_leaf_type_2021/sub_leaf_type_2021.tif")
ArchGDAL.metadata(dataset)
yields
2-element Vector{String}:
"AREA_OR_POINT=Area"
"DataType=Generic"
but if I open it as a Raster
using Rasters
r1 = Raster("sub_leaf_type_2021/sub_leaf_type_2021.tif")
Rasters.metadata(r1)
yields
Metadata{Rasters.GDALsource} of Dict{String, Any} with 1 entry:
"filepath" => "/Users/anshul/Downloads/sub_leaf_type_2021/sub_leaf_type_2021.tif"
which doesn't contain GDAL's keys...
edit: ah, this specific metadata seems to be read when constructing dims. But the general point stands, since the Rasters method is not actually checking the GDAL metadata at all...
Huh. But what does ArchGDAL.metadata call?
The first one we actually dont want/would always filter out in any case. Its encoded in the dimensions.
https://github.com/rafaqz/Rasters.jl/blob/09a29d3936c591fee00e7a14efffa95a4a8d24f1/ext/RastersArchGDALExt/gdal_source.jl#L206-L230
we don't even read the metadata there, is the main issue...