Closed tanyapdv closed 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
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](https://user-images.githubusercontent.com/101888209/159045141-e2f947ac-5cd0-4912-8666-4538e2bb5bdd.png)
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](https://user-images.githubusercontent.com/101888209/159046000-778b5df8-c443-46ba-b4d0-748ae242c8eb.png)
And also I have a column with the weights, that is also, when applied, gives huge numbers (screenshot 3).![image](https://user-images.githubusercontent.com/101888209/159047029-67b41d78-5469-48c5-aa9f-2e3e4cb73561.png)
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!