[GRASS5] Asking about feasibility of an addition to r.recode

Hamish hamish_nospam at yahoo.com
Tue Apr 4 01:38:39 EDT 2006


> >> I'm involved in a project to develop a linkage between agent
> >based modeling > platforms and GRASS. One item that seems will be
> >very important is way to > change a group of cell values (i.e., cat
> >values) given their xy coordinates. > I realize that it is possible
> >to use the map calculator to create a new map > with 1 new cell
> >changed. But AFAICT, there is no way to send a set of xy > values,
> >along with new cat values for each xy pair and change cells in an >
> >existing map or create a new map with the changed cells (and old
> >values for > the rest of the cells).

easy enough in C, check out D_u_to_a_row() and friends in
lib/display/cnversions.c and cannibalize d.rast.edit.


> > If you can create a raster map containing only the new cells, with
> > null elsewhere, you can patch it together with the old map to get
> > the updated map. In 5.3, the first step could be done with
> > s.in.ascii + s.to.rast; does v.in.ascii + v.to.rast not work with
> > points?

probably the cleanest and easiest solution here.
v.in.ascii + v.to.rast works fine with points.

> However, what you suggest in the 'feature creep' section sounds like a
> command-line module to replace r.digit and which could be run from any
> generic GUI. That could be useful for dual purposes in this event. ;-)

For a r.digit replacement I think a GUI that builds up an input file
which is fed into r.in.poly is the simplest route.


Hamish




More information about the grass-dev mailing list