[GRASS-dev] more interesting failure for reading fp_range of a NULL map

Glynn Clements glynn at gclements.plus.com
Wed Mar 6 10:05:35 PST 2013


Yann Chemin wrote:

> dealing with large amount of maps, some of them process to NULL on all
> pixels.
> when accessing fp_range in cell_misc, the file is empty, thus returning
> such an error:
> 
> WARNING: Unable to read fp range file for <NULL_map_test at PERMANENT>
> 
> While I understand this is undefined because of all pixels being NULL,
> would it be possible to have a more interesting output?

lib/raster/range.c is inconsistent in this regard. When writing an FP
range, it writes an empty file if the range is null:

    /* if range hasn't been updated, write empty file meaning Nulls */

When reading an empty f_range file, it generates the above warning
(the FPRange structure is initialised with min and max both null).

It would be a simple matter to change the warning (e.g. "range is
null") or remove it. A warning might be useful, as I can imagine
modules failing in interesting ways if an input map is all-null.

-- 
Glynn Clements <glynn at gclements.plus.com>


More information about the grass-dev mailing list