[GRASS-user] Count points in a network between two locations

Johannes Radinger johannesradinger at gmail.com
Fri Feb 1 02:44:14 PST 2013


On Thu, Jan 31, 2013 at 3:10 PM, Moritz Lennert
<mlennert at club.worldonline.be> wrote:
> On 30/01/13 14:18, Johannes Radinger wrote:
>>
>> Hi,
>>
>> I have a network (proper GRASS network) and two point vectors.
>> One is representing sampling stations the second contains locations
>> of migration barriers with a certain value for its permeability (0-1).
>> Both point vectors are located on the network (snapped via v.distance
>> and v.in.db).
>
>
> Note that v.net allows you to easily connect points to the network. And in
> Grass7, it allows you to snap the points onto the network.
>
>
>> Now I'd like to get all the migration barriers that
>> are between any pairwise combination of the sampling stations. In other
>> words, I want to get all sampling stations that are located between one
>> sampling station and another one (all possible combinations). Moreover
>> I'd like to get the sum and product of the permeability values of all
>> barriers inbetween. Is there such a tool in GRASS GIS?
>>
>> What I thought about the solution: 1) Getting paths (vectors) connecting
>> all pairwise sampling stations (but how)
>
>
> v.net.allpairs, if you set the cost of all arcs to 0 and only assign the
> permeability values as costs to the barrier nodes, then I guess the cost
> value in the resulting attribute table should give you the sum of
> permeability values (but I'm not sure, you'll have to test).

Thank you, that might work. I just realized that my permeabilities are
given as probability and they are added up by a multiplication rule. Thus
I don't need the sum but rather the product or at least a list of all barries
between to sampling stations....


>
>
>> and 2) extracting the barriers
>> that are located on each connecting line?
>
>
> I guess a simple v.distance between the v.net.allpairs vector lines and the
> barriers plus some SQL should give you that info.

Hi,

thats what I tried now, v.distance to get from barriers to nearest
vector lines from v.net.allpairs,
 but the problem is that the v.net.allpairs lines are partly
overlapping (sharing parts). So there
are several barriers on partly overlapping lines, but I want to select
all barriers per line category.

So, a solution could be to loop over the all lines (categories) and
use v.select as
v.select does not have any option for stratified selection (e.g. per
category)...
I'll try that now, but any other recommendations are mostly welcome...



Johannes


>
> Moritz


More information about the grass-user mailing list