QGIS API Documentation  3.8.0-Zanzibar (11aff65)
Public Member Functions | List of all members
QgsNetworkSpeedStrategy Class Reference

Strategy for calculating edge cost based on travel time. More...

#include <qgsnetworkspeedstrategy.h>

Inheritance diagram for QgsNetworkSpeedStrategy:
Inheritance graph
[legend]

Public Member Functions

 QgsNetworkSpeedStrategy (int attributeId, double defaultValue, double toMetricFactor)
 Default constructor. More...
 
QVariant cost (double distance, const QgsFeature &f) const override
 Returns edge cost. More...
 
QSet< int > requiredAttributes () const override
 Returns a list of the source layer attributes needed for cost calculation. More...
 
- Public Member Functions inherited from QgsNetworkStrategy
 QgsNetworkStrategy ()=default
 Default constructor. More...
 
virtual ~QgsNetworkStrategy ()=default
 

Detailed Description

Strategy for calculating edge cost based on travel time.

Should be used for finding fastest path between two points.

Since
QGIS 3.0

Definition at line 29 of file qgsnetworkspeedstrategy.h.

Constructor & Destructor Documentation

◆ QgsNetworkSpeedStrategy()

QgsNetworkSpeedStrategy::QgsNetworkSpeedStrategy ( int  attributeId,
double  defaultValue,
double  toMetricFactor 
)

Default constructor.

Definition at line 18 of file qgsnetworkspeedstrategy.cpp.

Member Function Documentation

◆ cost()

QVariant QgsNetworkSpeedStrategy::cost ( double  distance,
const QgsFeature f 
) const
overridevirtual

Returns edge cost.

Implements QgsNetworkStrategy.

Definition at line 25 of file qgsnetworkspeedstrategy.cpp.

◆ requiredAttributes()

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

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

This is method called by QgsGraphDirector.

Reimplemented from QgsNetworkStrategy.

Definition at line 39 of file qgsnetworkspeedstrategy.cpp.


The documentation for this class was generated from the following files: