[GRASSLIST:4934] Re: distance

Glynn Clements glynn.clements at virgin.net
Mon Nov 11 15:09:53 EST 2002

J.c.m. van der Kwast wrote:

> Is it possible to fill a raster of an irregular shaped area with 
> distance values perpendicular to a part of the edge of the same area, so 
> that hat every cell has a distance value perpendicular and relative to a 
> part of the edge?
> I've been trying some things with mapcalc but without succes. So far 
> according to me, the only way to do it would be to raster the line, and 
> then buffer it with mask set to that polygon. Very tedious job if areas 
> are big (maybe script?). Another approach was to draw parallel lines in 
> a CAD program, depicting them as heightlines in Grass and then putting 
> them thru v.surf.contours or s.surf.contours. This is not working to my 
> satisfaction. I'll hope you'll have some insights, if it's possible at all.

If you create a map where the inside of the polygon has value 1 while
the outside has value 0, running r.cost with a start coordinate which
is outside of the polygon will give approximately the right result.

Glynn Clements <glynn.clements at virgin.net>

More information about the grass-user mailing list