[GIS] How to estimate distance from points to line feature with v.distance

grass

I'm trying to use the v.distance module in GRASS 6.4.3 to estimate the distance from a series of point features (animal tracking locations) to the nearest point along a line feature (a coastline). I load in the two shapefiles (both UTM/WGS84),create a new column in the attribute table of the point features to take the estimated distances and start v.distance. I set the 'from' vector map to be the point layer and the 'to' vector map to be the coastline, tick "distance to the nearest point on the 'to' feature along that linear feature", and set the column to upload to be my new distance column.

The script runs ok but the estimated values in the attribute table are complete nonsense. At least half the values are identical, even though the animal was progressively moving away from the coastline and therefore distance should have been increasing. When the animal was 2000km from the coast the distance estimate is 166m, but right nect to the coast it is often >3000m! Funnily though, if I select the option to create an output vector map containing lines connecting the nearest elements, the lines perfectly connect each point to the nearest part of the coastline and are all different lengths.

What is going wrong here?! The frustrating thing is that I ran it once when testing and it worked perfectly, but all subsequent attempts have resulted in the same problems. I can't remember if I used any different settings on the first go. I'm sure it's something simple but it is driving me nuts trying to work out what it is! I know it may be hard to comment without seeing the data, but i'm really hoping someone has run into this before or has some idea where my mistake might be.

All help greatly appreciated! Many thanks,

Best Answer

If you're selecting "distance to the nearest point on the 'to' feature along that feature" then you're asking for the distance along that line feature from it's start. If you want the distance from the points then just choose "minimum distance to nearest feature". The command at the bottom of the v.distance window should include: "upload=dist" and NOT "upload=to_along".

Related Question