I have a layer of address points and a layer of polling stations. My task is to determine the three closest polling stations to each address on the street network.

I think that the answer is in v.distance, but I am stuck trying to use this tool. I have merged my two point layers, each having a "type" field (either 'address' or 'voting'). It seems that the tool wants the From WHERE condition to be


...and the To WHERE condition to be


I have used v.net.maintenance to make a network of the streets with the merged points as the input point vector map. However, the resulting layer only has attributes of the street network, such as COST. If I input this layer to v.distance as


...I can use the COST field, but there is no type field for from_where or to_where.

I've seen several postings about using this tool, but no answers.


Please consider to use v.net.path - finds shortest path on vector network or v.net.alloc - allocates subnets for nearest centers. See also the list of available vector network algorithms. The v.distance command will find the shortest direct distance but you likely want to follow the network in order to obtain more realistic distances.

  • v.net.path shows the shortest path from one node to any number of other nodes, but through those other nodes. In this case, the second shortest path to a polling station might be on the other side of the shortest path to a polling station. I don't think v.net.path can do that. v.net.alloc will allocate lines to a given polling station, but will not tell me which three polling stations are closest to a given address points. Thanks for the suggestions, though. Nov 21 '14 at 15:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.