computationalgeography / lue

LUE Scientific Database and Environmental Modelling Framework
https://lue.computationalgeography.org
MIT License
12 stars 4 forks source link

[Bug]: to_gdal creates file with incorrect statistics #690

Open OliverSchmitz opened 3 months ago

OliverSchmitz commented 3 months ago

Describe the bug

In a script I only use from_gdal (reading a DEM) and to_gdal. The output TIFF receives

Band 1 Block=3081x1 Type=Float32, ColorInterp=Gray
  Min=436.726 Max=436.726 
  NoData Value=nan
  Metadata:
    STATISTICS_APPROXIMATE=YES
    STATISTICS_MAXIMUM=436.7262878418
    STATISTICS_MEAN=436.7262878418
    STATISTICS_MINIMUM=436.7262878418
    STATISTICS_STDDEV=0
    STATISTICS_VALID_PERCENT=84.03

which is clearly incorrect, min!=max in the data

Expected behaviour

No response

Steps to reproduce

No response

Additional information

On Linux

kordejong commented 2 months ago

I downloaded some DEM and I can't reproduce the issue. Can you share the data and script maybe?