[GRASS-user] How to assign costs to nodes using v.net.distance

Moritz Lennert mlennert at club.worldonline.be
Sat Mar 30 03:17:14 PDT 2013


On Fri, 29 Mar 2013 16:58:06 +0100, Markus Metz wrote:
> On Thu, Mar 28, 2013 at 2:52 PM, דור פרידמן <dof1985 at gmail.com> 
> wrote:
>> Hello all,
>>
>> After I've got my v.net.distance up and running I have to adjust my 
>> analysis
>> method to the software's capabilities. Basically, I have a 3 layered
>> network: myroads_net2 which contain layers as follow:
>>
>> Layer 1: Arch (roads)
>> Layer 2: Points (Landfills - destinations)
>> Layer 3: Points (Settlements - source)
>>
>> As one might understood I'm trying to calculate the lowest cost 
>> route
>> between each settlement (layer 3) to each landfill (layer 2).
>
> I think v.net.distance is the wrong module for this task because it
> finds for each 'from' feature the nearest 'to' feature and not the
> shortest path from each 'from' feature to each 'to' feature. 
> Actually,
> I don't think any of the v.net.* modules does exactly that. You could
> file a ticket for enhancement to request such a module.

You can use v.net.allpairs, but you would have to put all points into 
the same layer. (Actually if you use grass 6.4 arcs and points will have 
to be in the same layer. I would recommend using grass7 for these 
tasks).

In GRASS7, just put all points into nlayer=2 with different cat values 
(example have all the landfills be in the 10000s and all the settlements 
in the 20000s - you can use v.category for that). Then run 
v.net.allpairs and filter out only the results showing the distance 
between a landfill and a settlement.

Moritz


More information about the grass-user mailing list