Opened 17 years ago
Closed 16 years ago
#1672 closed defect (fixed)
NaNs are not ignored when computing raster min/max
Reported by: | jluis | Owned by: | Mateusz Łoskot |
---|---|---|---|
Priority: | normal | Milestone: | 1.6.0 |
Component: | GDAL_Raster | Version: | 1.4.1 |
Severity: | normal | Keywords: | nan infinite |
Cc: | warmerdam, Even Rouault |
Description
Attachments (5)
Change History (12)
comment:1 by , 17 years ago
Cc: | added |
---|---|
Keywords: | nan added |
Milestone: | → 1.5.0 |
Owner: | changed from | to
comment:2 by , 16 years ago
I'm attaching a patch (quite trivial) do do the CPLIsNan test in GDALRasterBand::ComputeStatistics. (I didn't find a "generic min/max computation code")
I've tested it on a 10000x10000 float32 GTiff and 10000*5000 float64 GTiff. The timings are a bit difficult to interpret as there is a lot of I/O implied. I think we must consider the 'user' part of the timing. They would show that in the 32bit case, CPU time is about 2x longer. But for 64bit case, no significant difference. I'm a bit skeptical on my timing method...
by , 16 years ago
Attachment: | gdal_svn_trunk_nans_ignore_1672.patch added |
---|
by , 16 years ago
Attachment: | stats_and_timings_before_patch.txt added |
---|
by , 16 years ago
Attachment: | stats_and_timings_after_patch.txt added |
---|
comment:3 by , 16 years ago
Summary: | NaNs are not ignored when computing raster min/max → [PATCH] NaNs are not ignored when computing raster min/max |
---|
by , 16 years ago
Attachment: | gdal_misc.cpp-mloskot.patch added |
---|
In my opinion, this function should be patched too
comment:4 by , 16 years ago
Keywords: | infinite added |
---|---|
Status: | new → assigned |
comment:5 by , 16 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
comment:6 by , 16 years ago
Cc: | added |
---|---|
Milestone: | 1.5.0 |
Resolution: | fixed |
Status: | closed → reopened |
Summary: | [PATCH] NaNs are not ignored when computing raster min/max → NaNs are not ignored when computing raster min/max |
We are getting the following errors in the VC7.1 build on Tamas' buildbot. We need to fix one way or another.
------------ Failures ------------ Script: gcore/stats.py TEST: stats_nan_1 ... fail Checksum for band 1 in "nan32.tif" is 978, but expected 874. TEST: stats_nan_2 ... fail Checksum for band 1 in "nan64.tif" is 4942, but expected 4414. ----------------------------------
comment:7 by , 16 years ago
Milestone: | → 1.6.0 |
---|---|
Resolution: | → fixed |
Status: | reopened → closed |
Fixed in trunk in r13893
Mateusz,
I would like you to try and address this for 1.5.0. We should prepare some test files with NaNs, and ensure they will be ignored by the generic min/max computation code, and the stats code.
Please do some review of the performance effects of this change (is the NaN test expensive?) and ensure this feature gets tested in the test suite.
It should be possible to use the CPLIsNan() macro to test for NaN.
This checking should of course only be done for float and double pixel types.