rio-tiler icon indicating copy to clipboard operation
rio-tiler copied to clipboard

Forward statistics metadata in ImageData

Open vincentsarago opened this issue 2 years ago • 0 comments

When reading a GeoTIFF dataset, we can have access to GDAL statistics dataset (if added by the user). I think it will be great if we could forward those in the ImageData (output of image methods, e.g. tile(), preview()...).

STATISTICS_MEAN: mean
STATISTICS_MINIMUM: minimum
STATISTICS_MAXIMUM: maximum
STATISTICS_STDDEV: standard deviation
STATISTICS_APPROXIMATE: only present if GDAL has computed approximate statistics
STATISTICS_VALID_PERCENT: percentage of valid (not nodata) pixel

ref: https://gdal.org/user/raster_data_model.html#metadata

If we are able to ship those in the ImageData object then we could maybe use them here https://github.com/cogeotiff/rio-tiler/blob/master/rio_tiler/models.py#L333 instead of the min/max of the datatype 🤷‍♂️

vincentsarago avatar Mar 25 '22 09:03 vincentsarago