Class: QgsNetworkStrategy¶
-
class
qgis.analysis.
QgsNetworkStrategy
¶ Bases:
sip.wrapper
Default constructor
QgsNetworkStrategy(
QgsNetworkStrategy
)QgsNetworkStrategy
defines strategy used for calculation of the edge cost. For example it can take into account travel distance, amount of time or money. Currently there are two strategies implemented in the analysis library:QgsNetworkDistanceStrategy
and QgsNetworkSpeedStrategy.QgsNetworkStrategy
implemented using “strategy” design pattern.Methods
Returns edge cost
Returns a list of the source layer attributes needed for cost calculation.
-
cost
(self, distance: float, f: QgsFeature) → Any¶ Returns edge cost
- Parameters
distance (float) –
f (QgsFeature) –
- Return type
Any
-
requiredAttributes
(self) → object¶ Returns a list of the source layer attributes needed for cost calculation. This is method called by
QgsGraphDirector
.- Return type
object
-