[GRASS-dev] standarizing range syntax
Michael Barton
michael.barton at asu.edu
Wed Aug 13 01:41:37 EDT 2008
On Aug 12, 2008, at 10:29 PM, Glynn Clements wrote:
>
> Michael Barton wrote:
>
>> Currently, due to its history, GRASS has various ways of
>> designating a
>> range of values.
>>
>> In raster displays (d.rast) ranges are expressed as 'n-n';
>> for color tables, they are implied but not explicitly given;
>> for raster reclass maps (r.reclass), they are expressed as 'n thru n'
>> for raster recode (r.recode), they are expressed as 'n:n';
>> for vector reclass (actually a recode, v.reclass), ranges are
>> expressed in SQL syntax
>>
>> At least for rasters, I'd like to suggest that we standardize range
>> notation.
>>
>> I recommend 'n-n'. It is compact, widely recognized, and doesn't
>> use a
>> misspelled english word ("thru"). The syntax 'n:n' is used in some
>> programming, but not a lot beyond that.
>
> One issue with "m-n" is that it could be quite easy to inadvertently
> write code which doesn't handle negative values correctly, e.g.
> "-10--5". IMHO, it's also less clear than "-10:-5".
OK. What about "m to n"?
Michael
More information about the grass-dev
mailing list