[GRASS-stats] spgrass problem importing category 999 when plugin is FALSE

Roger Bivand Roger.Bivand at nhh.no
Fri Apr 3 05:00:03 EDT 2009


On Fri, 3 Apr 2009, Markus Neteler wrote:

> On Fri, Apr 3, 2009 at 9:07 AM, Roger Bivand <Roger.Bivand at nhh.no> wrote:
>> On Fri, 3 Apr 2009, Jarek Jasiewicz wrote:
>>
>>> Hi
>>>
>>> I during batch processing of couple of maps I found strange behaviour of
>>> readRAST6 when I import cell map with value 999.
>>> Instead of 999 Na is imported (?? _
>>>
>>> It is for me completely strange, so I test it with folowing:
>>
>> OK. This is a consequence of trying to guess the NODATA value to pass to
>> r.out.gdal,
>
> The C version of r.out.gdal has a nodata parameter.

Yes, this is what is used, NODATA is the argument name in readRAST6.

>
>> and I don't see it in 0.5-19 (my local slightly changed from
>> CRAN latest 0.5-18). For certain range values retrieved from r.info, NODATA
>> is assigned the value 999 (R/bin_link.R, about line 113). Please try 0.5-18,
>> I suspect that the condition was changed. Alternatively, set NODATA to a
>> suitable value outside the range of the data. Note that I don't have a 6.5
>> GRASS, and if r.info output has changed format, the parsing will be wrong,
>
> It didn't change the format to my knowledge. BUT:
> To get the range, use
> r.info -r test_map
> min=999
> max=999
>
> The parsing of plain r.info will fail in non-English locales (or enforce C
> locale).

I use r.info -r test_map in the function, but was replying without 
checking properly, sorry.

I guess it's an spgrass6 version issue.

Best wishes,

Roger

>
> ...
>> I guess that there is a smarter way of getting the raster min/max too, isn't
>> there?
>
> Yes, please always use the script output flags which are not subject to locale
> and way easier to parse. If missing in a module, we are happy to add it.
> It also exists in GRASS 6.3:
> http://trac.osgeo.org/grass/browser/grass/branches/releasebranch_6_3/raster/r.info/main.c#L74
>
> Best
> 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