GeoTIFF / georaster

Wrapper around Georeferenced Rasters like GeoTIFF and soon JPG and PNG that provides a standard interface
Apache License 2.0
81 stars 32 forks source link

noDataValue is not ignored to compute mins #87

Closed jfoclpf closed 4 months ago

jfoclpf commented 4 months ago

Describe the bug

The value of noDataValue is not ignored to compute mins[0]

To Reproduce

The geotiff fetched from the urlToGeoTiff file has Int16 point values and -32768 should be considered as noDataValue.

// path /geotiff maps to directory resources/res/altimetria/tif/regions/
const urlToGeoTiff = `/geotiff/lisbon.tif`

fetch(urlToGeoTiff)
  .then(res => res.arrayBuffer())
  .then(arrayBuffer => {
    parseGeoraster(arrayBuffer, { noDataValue: -32768 }).then(georaster => {
     console.log(georaster.mins[0]) // `-32768`

Expected behavior To compute mins or maxs by ignoring the points with value of noDataValue

jfoclpf commented 4 months ago

apparently noDataValue comes from the geotiff file itself

this solved my problem https://gis.stackexchange.com/questions/369064/how-to-convert-0-values-to-nodata-values-with-rasterio/413666#413666