[STATSGRASS] NULL values and readRAST6

Roger Bivand Roger.Bivand at nhh.no
Tue Oct 9 08:03:08 EDT 2007


On Tue, 9 Oct 2007, Markus Neteler wrote:

>
>
> Roger Bivand wrote:
>>
>> On Tue, 9 Oct 2007, Roger Bivand wrote:
>>> On Tue, 9 Oct 2007, Carlos "Guâno" Grohmann wrote:
>>>
>>>>  Hi,
>>>>  Can readRAST6 handle NULL values? How?
>>>>
>>>>  I tried NODATA=NULL but it needs a numeric value..
>>>
>>> This is passed to r.out.bin, which says:
>>>
>>> null=integer
>>>     Value to write out for null
>>>     Default: 0
>>>
>>> so in fact it has to be an integer - I'll fix the documentation and
>>> function
>>> (which didn't check what value was assigned to NODATA).
>>
>> To make this a bit clearer - the raster layer in GRASS has missing values
>> set to NULL, but NULL cannot be exported by r.out.bin. So r.out.bin is
>> given a NODATA value to assign to NULL cells, which are then read into R,
>> and the NODATA valued cells are set to NA. The only need for the value is
>> to keep r.out.bin (and r.in.bin) happy, because they do not encode NULL
>> directly.
>>
>> Roger
>>
>
> Could this be automated by using
> r.info -r map
> to get the range and then auto-use a value outside
> of this range as NULL encoder and something in R with
> min()/max() to do the same in the other direction?

Yes, I think that it could, I'll take a look - thanks!

Roger

>
> But maybe I misunderstand the problem.
>
> Markus
>

-- 
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Helleveien 30, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43
e-mail: Roger.Bivand at nhh.no


More information about the grass-stats mailing list