[GRASSLIST:4022] Re: r.neighbors

Glynn Clements glynn.clements at virgin.net
Thu Jul 4 07:42:17 EDT 2002


Elsa Rintala wrote:

> The size of the neighbourhood is limited to 25 piksels, why?

Probably because the author got fed up with typing at that point. The
option parser doesn't provide a way to specify "any odd value".

> I would like
> to know means for areas about twice that size - how can I do this? (By 
> creating new pixels, each from 4 original ones and then using the 
> r.neighbors?)
> 
> Would it be possible to just add more legal size values to the source code
> and then compile it into a functioning program?

Yes. The only reason for the limit is the "options" field for the
"size" option:

	parm.size->options    = "1,3,5,7,9,11,13,15,17,19,21,23,25" ;

If you delete this line, it will accept any neighbourhood size
(although it may fail if you specify an even value).

> (Sorry, if this is a silly
> question - I know practically nothing about programming.) And is it
> possible to compile only the r.neighbors and replace the old version (as a
> part of a running program) with the newly compiled one? I had problems
> compiling the entire GRASS on my Debian (stable), so I'm using downloaded
> binaries at the moment.

It's possible, but not entirely straightforward. It would be simpler
to attempt to compile everything; assuming that r.neighbors compiles
successfully, you could then install that in place of the existing
version.

But note that the file which you would need to replace is
etc/bin/cmd/r.neighbors, not bin/r.neighbors. Nearly all of the
"files" in the bin directory are actually hard links to etc/front.end,
which selects a program from either etc/bin/cmd or etc/bin/inter,
depending upon whether any command-line arguments are provided and
whether an interactive version exists.

-- 
Glynn Clements <glynn.clements at virgin.net>



More information about the grass-user mailing list