[GRASS-user] Euclidean distance (grow.distance) on raster to certain extent?

Marcello Gorini gorini at gmail.com
Mon May 7 09:33:53 EDT 2012


 Tanya wrote:


> I am trying to run the grow.distance command to create a raster that
> displays the euclidean distance from an 'orchard' outward to 1108m.  I am
> not trying to measure the distance between 2 non-null features, but simply
> wish to have the euclidean distance extend out from the orchard to 1108m.
>
>
>
 I don´t know r.grow.distance or why it is not working for you, but every
time I need distance rasters, I use the procedure found in the GRASS book,
as follows:

r.mapcalc area1=1
r.cost -k in=area1 out=distance_to_orchard start_rast=orchard_location  --o
--q
r.mapcalc  "distance_to_orchard=distance_to_orchard * (ewres() +
nsres())/2."

It is an approximate measure, but you can evolve this idea for a better
solution for your case. Then you only need to use your buffer as a mask to
get the final raster you want or simply use:

r.mapcalc
"final_raster=if(distance_to_orchard<=1108,distance_to_orchard,null())"

Hope it helps.
Cheers,
Marcello.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/grass-user/attachments/20120507/c6cfc2c8/attachment-0001.html


More information about the grass-user mailing list