[GRASS5] [bug #3742] (grass) r.out.bin output incorrect compared with r.out.netcdf

Glynn Clements glynn at gclements.plus.com
Tue Oct 18 11:05:39 EDT 2005


Hamish wrote:

> > Subject: r.out.bin output incorrect compared with r.out.netcdf
> > 
> > Platform: GNU/Linux/i386
> > grass binary for platform: Compiled from Sources
> > GRASS Version: 6.0.1
> > 
> > r.out.bin fails with the -h option on DCELL maps. 
> 
> "fails" how? Segmentation Fault? Runs ok, but output not as expected?
> Try byte swapping the output of r.out.bin and try again (-s)?
> 
> 
> > see http://thread.gmane.org/gmane.comp.gis.grass.user/7618
> > > []% r.out.bin -h null=NaN in=srtm out=srtm.grd
> 
> note null=NaN should not work [yet it does! G_parser bug!].

G_parser() doesn't actually check that argument values are legitimate
unless the ->options field is non-null.

> As written
> r.out.bin will only take an integer for the null value at the command
> line. I don't know if this should be allowed to be something of another
> type. A char string seems wrong for a binary file, I don't know if floats 
> and double are ok or if the cast to int for CELL maps would be "wrong" 
> in that case. Allowing float or double for that would be the only way to
> get "nan" accepted for null= as it doesn't exist for integers (yet 
> G_parser() allows any string for parm->type = TYPE_INTEGER; ??).
> Test added to r.out.bin disallow this in future.

r.out.bin doesn't check the return value from sscanf().

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




More information about the grass-dev mailing list