[GRASS-dev] Re: big region r.watershed

Glynn Clements glynn at gclements.plus.com
Sat Oct 11 02:18:28 EDT 2008


Hamish wrote:

> and other modules like r.in.xyz have percent= (0-100) for how much of the
> map to keep in memory at once.

I'm wondering if it would be worth adding a switch to r.in.xyz to
indicate that the points have been pre-sorted in descending order of
their Y coordinate (which can be done with "sort -nr"). In that
situation, you would be able to import the data in a single pass while
only holding a single row in memory.

I would expect implementing such a feature to be relatively
straightforward. Set rows=1, npasses=region.rows, skip the rewind() at
the beginning of each pass, and terminate each pass at the first point
below the current row. The only slight complication is that you need
to retain that point for the next pass.

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


More information about the grass-dev mailing list