[GRASS-dev] Re: [GRASS-user] how to measure distances in a constrained space

On 13/11/08 10:04, Hamish wrote:

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.

perhaps if you invert the map?

ie put starting point in null space and it will grow until/around cells
with value?

You mean invert the mask, so that land masses are nulls and water non-nulls ?

Doesn't work.

r.grow.distance just seems to ignore the mask. Glynn ?

Moritz

Moritz Lennert wrote:

>> 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.
>
>
> perhaps if you invert the map?
>
>
> ie put starting point in null space and it will grow until/around cells
> with value?

You mean invert the mask, so that land masses are nulls and water
non-nulls ?

Doesn't work.

r.grow.distance just seems to ignore the mask. Glynn ?

As I wrote in this thread on grass-user:

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.

IOW, the mask just makes some input cells "disappear".

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

is it ok to backport r.grow.distance to devbr6 for 6.4.0?

AFAICT there are no issues.

Hamish

Hamish wrote:

is it ok to backport r.grow.distance to devbr6 for 6.4.0?

I can't think of any reason not to.

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