[GRASS-user] how to measure distances in a constrained space
glynn at gclements.plus.com
Thu Nov 13 13:40:18 EST 2008
Moritz Lennert wrote:
> > - have a look at the new r.grow.distance in GRASS 7, even faster
> r.grow.distance creates a distance map from each point, but there is no
> way of telling it anything about null cells or barriers. Even when
> setting a mask, r.grow.distance fills in the whole region, which seems
> like a bug to me.
A mask just forces some input cells to be null. As a general
principle, modules don't distinguish between cells which are null in
the map itself and those which are null due to the mask.
In any case, the specific purpose of r.grow.distance is:
r.grow.distance generates a raster map representing the distance to
the nearest non-null cell in the input map.
This is its only purpose, and it tries to do it as efficiently as
possible. In particular, it operates row-by-row, so it doesn't require
the map to fit into memory, nor does it use a segment cache (it does
use a temporary file, but this is read linearly).
There's no way to make the algorithm handle barriers, as it relies
upon the fact that the distance from a point increases monotonically
with each row.
Also, r.grow.distance will give true circles (for metric=euclidean and
metric=squared) rather than a polygonal approximation.
However, I have just noticed a bug: it performs the square root
calculation for all metrics, not just euclidean. I'll fix this
Glynn Clements <glynn at gclements.plus.com>
More information about the grass-user