Skip to content

Class QfGeofencer

ClassList > QfGeofencer

More...

  • #include <qfgeofencer.h>

Inherits the following classes: QObject

Public Types

Type Name
enum Behaviors

Public Properties

Type Name
property bool active
property QgsVectorLayer * areasLayer
property Behaviors behavior
property bool isAlerting
property bool isWithin
property QString isWithinAreaName
property QString lastWithinAreaName
property QgsPoint position
property QgsCoordinateReferenceSystem positionCrs

Public Signals

Type Name
signal void activeChanged
signal void areasLayerChanged
signal void behaviorChanged
signal void invertLogicChanged
signal void isAlertingChanged
signal void isWithinChanged
signal void positionChanged
signal void positionCrsChanged
signal void projectChanged

Public Functions

Type Name
QfGeofencer (QObject * parent=nullptr)
bool active () const
Q_INVOKABLE void applyProjectSettings (QgsProject * project)
QgsVectorLayer * areasLayer () const
Behaviors behavior () const
bool isAlerting () const
bool isWithin () const
QString isWithinAreaName () const
QString lastWithinAreaName () const
QgsPoint position () const
QgsCoordinateReferenceSystem positionCrs () const
void setActive (bool active)
void setAreasLayer (QgsVectorLayer * layer)
void setBehavior (Behaviors behavior)
void setPosition (const QgsPoint & position)
void setPositionCrs (const QgsCoordinateReferenceSystem & crs)
virtual ~QfGeofencer ()

Detailed Description

This class provides an interface to manage geofencing of areas as well as providing feedback whenever the position trespasses into or out of those areas.

Public Types Documentation

enum Behaviors

enum QfGeofencer::Behaviors {
    AlertWhenInsideGeofencedArea = 1,
    AlertWhenOutsideGeofencedArea,
    InformWhenEnteringLeavingGeofencedArea
};

Public Properties Documentation

property active [1/2]

bool QfGeofencer::active;

property areasLayer [1/2]

QgsVectorLayer * QfGeofencer::areasLayer;

property behavior [1/2]

Behaviors QfGeofencer::behavior;

property isAlerting [1/2]

bool QfGeofencer::isAlerting;

property isWithin [1/2]

bool QfGeofencer::isWithin;

property isWithinAreaName [1/2]

QString QfGeofencer::isWithinAreaName;

property lastWithinAreaName [1/2]

QString QfGeofencer::lastWithinAreaName;

property position [1/2]

QgsPoint QfGeofencer::position;

property positionCrs [1/2]

QgsCoordinateReferenceSystem QfGeofencer::positionCrs;

Public Signals Documentation

signal activeChanged

void QfGeofencer::activeChanged;

signal areasLayerChanged

void QfGeofencer::areasLayerChanged;

signal behaviorChanged

void QfGeofencer::behaviorChanged;

signal invertLogicChanged

void QfGeofencer::invertLogicChanged;

signal isAlertingChanged

void QfGeofencer::isAlertingChanged;

signal isWithinChanged

void QfGeofencer::isWithinChanged;

signal positionChanged

void QfGeofencer::positionChanged;

signal positionCrsChanged

void QfGeofencer::positionCrsChanged;

signal projectChanged

void QfGeofencer::projectChanged;

Public Functions Documentation

function QfGeofencer

explicit QfGeofencer::QfGeofencer (
    QObject * parent=nullptr
) 

function active [2/2]

inline bool QfGeofencer::active () const

Returns TRUE when geofencing is active.

See also: setActive


function applyProjectSettings

Q_INVOKABLE void QfGeofencer::applyProjectSettings (
    QgsProject * project
) 

Sets the polygon layer holding areas from a given project.


function areasLayer [2/2]

inline QgsVectorLayer * QfGeofencer::areasLayer () const

Returns the polygon layer holding areas.


function behavior [2/2]

inline Behaviors QfGeofencer::behavior () const

Returns thegeofencing behavior.


function isAlerting [2/2]

inline bool QfGeofencer::isAlerting () const

Returns TRUE when the geofencer's behavior is triggering an alarm.


function isWithin [2/2]

bool QfGeofencer::isWithin () const

Returns whether the current position is within an area.


function isWithinAreaName [2/2]

QString QfGeofencer::isWithinAreaName () const

Returns the area name within which the current position overlaps. If no overlap, an empty string will be returned.


function lastWithinAreaName [2/2]

QString QfGeofencer::lastWithinAreaName () const

Returns the last area name within which the position had overlapped. If no overlap has yet to occur, an empty string will be returned.


function position [2/2]

inline QgsPoint QfGeofencer::position () const

Returns the position to be used to check for overlap with areas.


function positionCrs [2/2]

inline QgsCoordinateReferenceSystem QfGeofencer::positionCrs () const

Returns the position's coordinate reference system (CRS).


function setActive

void QfGeofencer::setActive (
    bool active
) 

Sets the geofencing active state.

See also: active


function setAreasLayer

void QfGeofencer::setAreasLayer (
    QgsVectorLayer * layer
) 

Sets the polygon layer holding areas.


function setBehavior

void QfGeofencer::setBehavior (
    Behaviors behavior
) 

Sets the geofencing behavior.


function setPosition

void QfGeofencer::setPosition (
    const QgsPoint & position
) 

Sets the position to be used to check for overlap with areas.


function setPositionCrs

void QfGeofencer::setPositionCrs (
    const QgsCoordinateReferenceSystem & crs
) 

Sets the position's coordinate reference system (CRS).


function ~QfGeofencer

virtual QfGeofencer::~QfGeofencer () 


The documentation for this class was generated from the following file src/core/positioning/qfgeofencer.h