[GRASS-dev] New option in r.neighbors

Soeren Gebbert soerengebbert at googlemail.com
Tue Jan 19 03:02:54 EST 2010


Hi Glynn,

2010/1/19 Glynn Clements <glynn at gclements.plus.com>:
>
> Soeren Gebbert wrote:
>
>> JFYI: i have added a new option "selection" to r.neighbors.
>
> A few points about the change:
>
> 1. Human-readable strings (option descriptions, messages) should be
> localised with _(...).

Sorry, i will check other modules, which i modified, to make sure i did
not forget the localization.

>
> 2. There's no need to read the map using its native type
> (CELL/FCELL/DCELL); reading as DCELL will suffice, and requires less

Ok.

> code. Better still, as you only care whether or not cells are null,
> you can use Rast_get_null_value_row().

I see, i never used Rast_get_null_value_row() before, thanks for your advise.

>
> 3. It reads the input a second time (at its native type, then converts
> to DCELL) when the input row will already be in ncb.buf[ncb.dist] (as
> DCELL).
>
> 4. There are a couple of deviations from the GRASS formatting
> conventions (see tools/grass_indent.sh), specifically space between
> "if" and "(" and "else" on a separate line to a preceding closing
> brace.

I german we call the coding which i have done "verschlimmbessern",
translated into english this means "Trying to improve things but
actually make them worse."

>
> Please check r40541.

Code looks much better now, thanks.

Soeren

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


More information about the grass-dev mailing list