QGIS API Documentation 3.41.0-Master (3440c17df1d)
Loading...
Searching...
No Matches
Public Member Functions | List of all members
QgsNetworkStrategy Class Referenceabstract

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

#include <qgsnetworkstrategy.h>

Inheritance diagram for QgsNetworkStrategy:
Inheritance graph
[legend]

Public Member Functions

 QgsNetworkStrategy ()=default
 
virtual ~QgsNetworkStrategy ()=default
 
virtual QVariant cost (double distance, const QgsFeature &f) const =0
 Returns edge cost.
 
virtual QSet< int > requiredAttributes () const
 Returns a list of the source layer attributes needed for cost calculation.
 

Detailed Description

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.

Definition at line 40 of file qgsnetworkstrategy.h.

Constructor & Destructor Documentation

◆ QgsNetworkStrategy()

QgsNetworkStrategy::QgsNetworkStrategy ( )
default

◆ ~QgsNetworkStrategy()

virtual QgsNetworkStrategy::~QgsNetworkStrategy ( )
virtualdefault

Member Function Documentation

◆ cost()

virtual QVariant QgsNetworkStrategy::cost ( double  distance,
const QgsFeature f 
) const
pure virtual

Returns edge cost.

Implemented in QgsNetworkDistanceStrategy, and QgsNetworkSpeedStrategy.

◆ requiredAttributes()

virtual QSet< int > QgsNetworkStrategy::requiredAttributes ( ) const
inlinevirtual

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

This is method called by QgsGraphDirector.

Reimplemented in QgsNetworkSpeedStrategy.

Definition at line 64 of file qgsnetworkstrategy.h.


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