[GRASS-user] Distance layer
nomadrain at gmail.com
Sun Oct 29 13:08:24 EST 2006
Jachym, thank you for reply, I am going the same way.
The solution for the problem has been already published by David
Finlayson in his r.eucdist - I found it on GRAS wiki ((C) 2006 by the
GRASS Development Team). I think it is desirable to include it in
GRASS distribution for a lot of applications need to find result of
function from distance of certain points and r.eucdist is a fine
example how2do it without programming.
r.eucdist is a script wich uses replacement of null values and then -
r.cost + r.mapcalc's nsres() to find the Euclidean distance from
points to every pixel. The COSTS input map for r.cost is set equal to
nsres(), as a value for every pixel. However, as I know,
(nsres()+ewres())/2) is more correct, maybe becouse I have not met the
maps with very different NS and EW resolutions.
IMHO man page for r.cost doesn't clearly define procedures like this.
I am still working on my script and going to publish it under GPL
> would it be problem to separate NULL values from your map? e.g.
> r.mapcalc yourmap2=if(isnull(yourmap),1,null())
> than you can use r.distance
> On Sat, Oct 28, 2006 at 07:11:04PM +0300, Nomad Rain wrote:
>> Thank you, Dylan and Jachym
>> I tried r.distance (the problem mentioned doesn't prevent)
>> Yes it gives me distances between raster pixels. However I need to
>> calculate in cycle all the distances from the only point to every NULL
>> pixel in region on new layer.
>> And r.distance does not work with null values, do it?
>> Help please, because my intuition keeps silence
More information about the grass-user