BjornNyberg / NetworkGT

The NetworkGT (Network Geometry and Topology) Toolbox is a set of tools designed for the geometrical and topological analysis of fracture networks.
GNU General Public License v3.0
30 stars 3 forks source link

How to inperpret weights in Shortest Pathway? #17

Closed tanyapdv closed 2 years ago

tanyapdv commented 2 years ago

Hi!

I am currently working with the topology section, with the tool "Shortest Pathway". I need to create accessibility zones, but to put weights on the road segments from a particular column in the attribute table. According to the description, if no weight are selected, the tool uses just the lengths of the segments, and it works great (screenshot 1). image

As you can see - when I visualize it by new Distance attribute - the numbers in the intervals are normal.

But I also have a separate column with lengths of the road segments. And if I apply it as a weight - the interwals are very far from default (screenshot 2). image

And also I have a column with the weights, that is also, when applied, gives huge numbers (screenshot 3). image

Can you please help, why it's happening? And, maybe, if it's possible, provide the formula, how weights are applied to the initial value, so I can compare weighted and default? (I thought the tool takes the weight and multiply it with the length, but, apparently, it's not..) Thank you!

BjornNyberg commented 2 years ago

Hi @tanyapdv

Did you resolve the problem? It is as you say weighted by the length of each segment multiplied by its weight. This is stated in the code here on lines 196-199 by

if wF:
    w = float(feature[wF])*feature.geometry().length()
else:
    w = feature.geometry().length()

where wF is the weighted field and feature.geometry().length() is the geometry length in map units.

Do you have a sample dataset that you could perhaps provide?

Cheers, Björn