[gdal-dev] Re: several No data value

Frank Warmerdam warmerdam at pobox.com
Wed Dec 8 12:46:18 EST 2010


On 10-12-06 09:53 AM, ludovic wrote:
>
> Frank, thanks for your response :
>
> On 3 déc, 22:05, Frank Warmerdam<warmer... at pobox.com>  wrote:
>>
>> GDAL only supports single nodata values as part of the data model.  You
>> can add arbitrary metadata describing other nodata values, but generally
>> GDAL itself and other client software won't realize the significance of
>> these other values.
>
> Ok one data value is not a problem for my data if i can "merge" all
> invalid values.
> For this i thought modify the driver to add a parameter flag () :
> A) By default the behaviour will be the standard gdal process : only
> one null value
> B) if the parameter flag of this driver is set, then all invalid value
> is replaced by null standard value
> in the dataset.
> My question is : is it possible to modify the driver to have this
> behaviour ?
> It is not a problem for me to create a patch but i don't know is it
> possible to "overwrite" (or "change") the gdal read function in a
> driver ?
>
> If is the reading behaviour of gdal can't be changed in a driver, too
> bad ! I would do this has a higher level software.

Ludovic,

I have lost track of what driver we are discussing.  It is certainly
possible for a theory to remap various nodata values to a single one
if that is perceived as appropriate for that driver.  However, in the
situation you described it seems plausible that some folks would want
to distinguish the various kinds of nodata values and that merging
them is interfering with access to the original raster data in a way
that might be detrimental.

I hesitate to bring it up, but another option is to return a validity
mask for the dataset derived by checking for the various nodata values.
There is already automated support for generating validity masks from
regular bands with single nodata values built into the core.  One
downside to this approach (not counting complexity) is that relatively
few applications honour the mask concept at this time.

   http://trac.osgeo.org/gdal/wiki/rfc15_nodatabitmask

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent



More information about the gdal-dev mailing list