[GRASS-user] Measuring Distance Along a Line

Marcello Gorini gorini at gmail.com
Wed Jan 18 14:58:28 EST 2012


On Wed, Jan 18, 2012 at 4:07 PM, Rich Shepard <rshepard at appl-ecosys.com>wrote:

>  I have a map with a couple of transect lines that intersect points on a
> separate map. I want to measure the distance from one end of each transect
> line to the point which it overlays. While I thought there was a v. module
> to do this, I'm not seeing it. If it's v.distance, I don't see how to apply
> that module to measuring a distance along one line interactively.
>
>
Again, vectors are not my thing, but maybe you could include the end point
into your vector and use v.to.db with option=length to get the distance
along your line vector.

A raster solution to similar problems that you could maybe use somehow is
to generate distance maps from target points, lines or areas and then
extract the values of these maps through other vectors or using r.mapcalc.

I've used this solution in many different cases and it is very nice to see
the distance maps. The procedure is described in the GRASS book as:

r.mapcalc area_one=1
r.cost -k in=area_one out=distance_to_something start_rast=something
r.mapcalc approx_distance_in_meters=dist_to_something * (ewres() + nsres())
/ 2.)"

Hope it gives you some insights.

Marcello.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/grass-user/attachments/20120118/2aa05f75/attachment.html


More information about the grass-user mailing list