QGIS API Documentation 3.41.0-Master (25ec5511245)
Loading...
Searching...
No Matches
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.
 
QVariant cost (double distance, const QgsFeature &f) const override
 Returns edge cost.
 
QSet< int > requiredAttributes () const override
 Returns a list of the source layer attributes needed for cost calculation.
 
- Public Member Functions inherited from QgsNetworkStrategy
 QgsNetworkStrategy ()=default
 
virtual ~QgsNetworkStrategy ()=default
 

Detailed Description

Strategy for calculating edge cost based on travel time.

Should be used for finding fastest path between two points.

Definition at line 28 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: