Open CloudNiner opened 3 years ago
Probably connected with https://github.com/geotrellis/gdal-warp-bindings/issues/70
It looks like the issue happens on this line when we try to access band 0 metadata:
import geotrellis.raster.gdal._
val ds = GDALDataset("/vsis3/aviris-data/test/f130329t01p00r06_corr_v1.tiff")
ds.getAllMetadata(GDALDataset.SOURCE, 0)
//> geotrellis.raster.gdal.MalformedProjectionException: Unable to get the metadata. GDAL Error Code: 1
// at geotrellis.raster.gdal.GDALDataset$.getMetadata$extension3(GDALDataset.scala:73)
// at geotrellis.raster.gdal.GDALDataset$.getMetadata$extension2(GDALDataset.scala:63)
// at geotrellis.raster.gdal.GDALDataset$.$anonfun$getAllMetadata$1(GDALDataset.scala:37)
// at scala.collection.immutable.List.map(List.scala:293)
// at geotrellis.raster.gdal.GDALDataset$.getAllMetadata$extension1(GDALDataset.scala:37)
// ... 36 elided
However the following part still works:
import geotrellis.raster.gdal._
val ds = GDALDataset("/vsis3/aviris-data/test/f130329t01p00r06_corr_v1.tiff")
(1 until ds.bandCount).toList.map(ds.getMetadata(GDALDataset.SOURCE, GDALMetadataDomain.ALL, _))
//>: List[Map[geotrellis.raster.gdal.GDALMetadataDomain,Map[String,String]]] = List(
// Map( -> Map(wavelength -> 365.9136593, wavelength_units -> Nanometers)),
// Map( -> Map(wavelength -> 375.5776593, wavelength_units -> Nanometers)),
// Map( -> Map(wavelength -> 385.2466593, wavelength_units -> Nanometers)),
// Map( -> Map(wavelength -> 394.9196593, wavelength_units -> Nanometers)),
// Map( -> Map(wavelength -> 404.5966593, wavelength_units -> Nanometers)),
// Map( -> Map(wavelength -> 414.2786593, wavelength_units -> Nanometers)),
// Map( -> Map(wavelength -> 423.9646593, wavelength_units -> Nanometers)),
// Map( -> Map(wavelength -> 433.6546593, wavelength_units -> Nanometers)),
// Map( -> Map(wavelength -> 443.3496593, wavelength_units -> Nanometers)),
// Map( -> Map(wavelength -> 45...
GDALRasterSource, using these bindings, throws an error when attempting to read metadata for files that use the PAM xml metadata specification.
Open a GeoTrellis 3.5.1+ SBT console:
Then try to read metadata of a tiff with external PAM metadata using GDALRasterSource
See:
I'm able to read all metadata for this COG with gdalinfo, the Python GDAL bindings, and Rasterio. For example,
gdalinfo /vsis3/aviris-data/test/f130329t01p00r06_corr_v1.tiff
prints all metadata contained in associated xml file.