QgsNetworkSpeedStrategy class

Strategy for calculating edge cost based on travel time.

Should be used for finding fastest path between two points.

Base classes

class QgsNetworkStrategy
QgsNetworkStrategy defines strategy used for calculation of the edge cost.

Constructors, destructors, conversion operators

QgsNetworkSpeedStrategy(int attributeId, double defaultValue, double toMetricFactor)
Default constructor.

Public functions

auto cost(double distance, const QgsFeature& f) const -> QVariant override
Returns edge cost.
auto requiredAttributes() const -> QSet<int> override
Returns a list of the source layer attributes needed for cost calculation.

Function documentation

QSet<int> QgsNetworkSpeedStrategy::requiredAttributes() const override

Returns a list of the source layer attributes needed for cost calculation.

This is method called by QgsGraphDirector.