QGIS API Documentation 3.41.0-Master (25ec5511245)
Loading...
Searching...
No Matches
Static Public Member Functions | Static Public Attributes | List of all members
QgsSensorThingsUtils Class Reference

Utility functions for working with OGC SensorThings API services. More...

#include <qgssensorthingsutils.h>

Static Public Member Functions

static QString asQueryString (Qgis::SensorThingsEntity baseType, const QList< QgsSensorThingsExpansionDefinition > &expansions)
 Returns a list of expansions as a valid SensorThings API query string, eg "$expand=Locations($orderby=id desc;$top=3;$expand=Datastreams($top=101))".
 
static QList< Qgis::GeometryTypeavailableGeometryTypes (const QString &uri, Qgis::SensorThingsEntity type, QgsFeedback *feedback=nullptr, const QString &authCfg=QString())
 Returns a list of available geometry types for the server at the specified uri and entity type.
 
static QString combineFilters (const QStringList &filters)
 Combines a set of SensorThings API filter operators.
 
static QString displayString (Qgis::SensorThingsEntity type, bool plural=false)
 Converts a Qgis::SensorThingsEntity type to a user-friendly translated string.
 
static Qgis::SensorThingsEntity entitySetStringToEntity (const QString &type)
 Converts a string value corresponding to a SensorThings entity set to a Qgis::SensorThingsEntity type.
 
static QString entityToSetString (Qgis::SensorThingsEntity type)
 Converts a SensorThings entity set to a SensorThings entity set string.
 
static bool entityTypeHasGeometry (Qgis::SensorThingsEntity type)
 Returns true if the specified entity type can have geometry attached.
 
static QList< Qgis::SensorThingsEntityexpandableTargets (Qgis::SensorThingsEntity type)
 Returns a list of permissible expand targets for a given base entity type.
 
static QgsFields fieldsForEntityType (Qgis::SensorThingsEntity type)
 Returns the fields which correspond to a specified entity type.
 
static QgsFields fieldsForExpandedEntityType (Qgis::SensorThingsEntity baseType, const QList< Qgis::SensorThingsEntity > &expandedTypes)
 Returns the fields which correspond to a specified entity baseType, expanded using the specified list of expandedTypes.
 
static QString filterForExtent (const QString &geometryField, const QgsRectangle &extent)
 Returns a filter string which restricts results to those within the specified extent.
 
static QString filterForWkbType (Qgis::SensorThingsEntity entityType, Qgis::WkbType wkbType)
 Returns a filter string which restricts results to those matching the specified entityType and wkbType.
 
static QString geometryFieldForEntityType (Qgis::SensorThingsEntity type)
 Returns the geometry field for a specified entity type.
 
static Qgis::GeometryType geometryTypeForEntity (Qgis::SensorThingsEntity type)
 Returns the geometry type for if the specified entity type.
 
static QStringList propertiesForEntityType (Qgis::SensorThingsEntity type)
 Returns the SensorThings properties which correspond to a specified entity type.
 
static Qgis::RelationshipCardinality relationshipCardinality (Qgis::SensorThingsEntity baseType, Qgis::SensorThingsEntity relatedType, bool &valid)
 Returns the cardinality of the relationship between a base entity type and a related entity type.
 
static Qgis::SensorThingsEntity stringToEntity (const QString &type)
 Converts a string value to a Qgis::SensorThingsEntity type.
 

Static Public Attributes

static constexpr int DEFAULT_EXPANSION_LIMIT = 100
 Default limit on number of expanded features fetched.
 
static constexpr int DEFAULT_FEATURE_LIMIT = 10000
 Default limit on number of features fetched.
 
static constexpr int DEFAULT_PAGE_SIZE = 200
 Default page size.
 

Detailed Description

Utility functions for working with OGC SensorThings API services.

Since
QGIS 3.36

Definition at line 33 of file qgssensorthingsutils.h.

Member Function Documentation

◆ asQueryString()

QString QgsSensorThingsUtils::asQueryString ( Qgis::SensorThingsEntity  baseType,
const QList< QgsSensorThingsExpansionDefinition > &  expansions 
)
static

Returns a list of expansions as a valid SensorThings API query string, eg "$expand=Locations($orderby=id desc;$top=3;$expand=Datastreams($top=101))".

The base entity type for the query must be specified.

Since
QGIS 3.38

Definition at line 1150 of file qgssensorthingsutils.cpp.

◆ availableGeometryTypes()

QList< Qgis::GeometryType > QgsSensorThingsUtils::availableGeometryTypes ( const QString &  uri,
Qgis::SensorThingsEntity  type,
QgsFeedback feedback = nullptr,
const QString &  authCfg = QString() 
)
static

Returns a list of available geometry types for the server at the specified uri and entity type.

This method will block while network requests are made to the server.

Definition at line 723 of file qgssensorthingsutils.cpp.

◆ combineFilters()

QString QgsSensorThingsUtils::combineFilters ( const QStringList &  filters)
static

Combines a set of SensorThings API filter operators.

See https://docs.ogc.org/is/18-088/18-088.html#requirement-request-data-filter

Since
QGIS 3.38

Definition at line 707 of file qgssensorthingsutils.cpp.

◆ displayString()

QString QgsSensorThingsUtils::displayString ( Qgis::SensorThingsEntity  type,
bool  plural = false 
)
static

Converts a Qgis::SensorThingsEntity type to a user-friendly translated string.

If plural is true then a plural string is returned (ie "Things" instead of "Thing").

Definition at line 296 of file qgssensorthingsutils.cpp.

◆ entitySetStringToEntity()

Qgis::SensorThingsEntity QgsSensorThingsUtils::entitySetStringToEntity ( const QString &  type)
static

Converts a string value corresponding to a SensorThings entity set to a Qgis::SensorThingsEntity type.

Returns Qgis::SensorThingsEntity::Invalid if the string could not be converted to a known entity set type.

Definition at line 324 of file qgssensorthingsutils.cpp.

◆ entityToSetString()

QString QgsSensorThingsUtils::entityToSetString ( Qgis::SensorThingsEntity  type)
static

Converts a SensorThings entity set to a SensorThings entity set string.

Since
QGIS 3.38

Definition at line 349 of file qgssensorthingsutils.cpp.

◆ entityTypeHasGeometry()

bool QgsSensorThingsUtils::entityTypeHasGeometry ( Qgis::SensorThingsEntity  type)
static

Returns true if the specified entity type can have geometry attached.

Definition at line 628 of file qgssensorthingsutils.cpp.

◆ expandableTargets()

QList< Qgis::SensorThingsEntity > QgsSensorThingsUtils::expandableTargets ( Qgis::SensorThingsEntity  type)
static

Returns a list of permissible expand targets for a given base entity type.

Since
QGIS 3.38

Definition at line 852 of file qgssensorthingsutils.cpp.

◆ fieldsForEntityType()

QgsFields QgsSensorThingsUtils::fieldsForEntityType ( Qgis::SensorThingsEntity  type)
static

Returns the fields which correspond to a specified entity type.

Definition at line 481 of file qgssensorthingsutils.cpp.

◆ fieldsForExpandedEntityType()

QgsFields QgsSensorThingsUtils::fieldsForExpandedEntityType ( Qgis::SensorThingsEntity  baseType,
const QList< Qgis::SensorThingsEntity > &  expandedTypes 
)
static

Returns the fields which correspond to a specified entity baseType, expanded using the specified list of expandedTypes.

Since
QGIS 3.38

Definition at line 582 of file qgssensorthingsutils.cpp.

◆ filterForExtent()

QString QgsSensorThingsUtils::filterForExtent ( const QString &  geometryField,
const QgsRectangle extent 
)
static

Returns a filter string which restricts results to those within the specified extent.

The extent should always be specified in EPSG:4326.

Since
QGIS 3.38

Definition at line 699 of file qgssensorthingsutils.cpp.

◆ filterForWkbType()

QString QgsSensorThingsUtils::filterForWkbType ( Qgis::SensorThingsEntity  entityType,
Qgis::WkbType  wkbType 
)
static

Returns a filter string which restricts results to those matching the specified entityType and wkbType.

Definition at line 672 of file qgssensorthingsutils.cpp.

◆ geometryFieldForEntityType()

QString QgsSensorThingsUtils::geometryFieldForEntityType ( Qgis::SensorThingsEntity  type)
static

Returns the geometry field for a specified entity type.

Definition at line 603 of file qgssensorthingsutils.cpp.

◆ geometryTypeForEntity()

Qgis::GeometryType QgsSensorThingsUtils::geometryTypeForEntity ( Qgis::SensorThingsEntity  type)
static

Returns the geometry type for if the specified entity type.

If there are no restrictions on the geometry type an ntity can have Qgis::GeometryType::Unknown will be returned.

Since
QGIS 3.38

Definition at line 649 of file qgssensorthingsutils.cpp.

◆ propertiesForEntityType()

QStringList QgsSensorThingsUtils::propertiesForEntityType ( Qgis::SensorThingsEntity  type)
static

Returns the SensorThings properties which correspond to a specified entity type.

Since
QGIS 3.38

Definition at line 377 of file qgssensorthingsutils.cpp.

◆ relationshipCardinality()

Qgis::RelationshipCardinality QgsSensorThingsUtils::relationshipCardinality ( Qgis::SensorThingsEntity  baseType,
Qgis::SensorThingsEntity  relatedType,
bool &  valid 
)
static

Returns the cardinality of the relationship between a base entity type and a related entity type.

Parameters
baseTypebase entity type
relatedTyperelated entity type
validwill be set to true if a relationship exists between the entity types, or false if no relationship exists
Returns
relationship cardinality
Since
QGIS 3.38

Definition at line 929 of file qgssensorthingsutils.cpp.

◆ stringToEntity()

Qgis::SensorThingsEntity QgsSensorThingsUtils::stringToEntity ( const QString &  type)
static

Converts a string value to a Qgis::SensorThingsEntity type.

Returns Qgis::SensorThingsEntity::Invalid if the string could not be converted to a known entity type.

Definition at line 271 of file qgssensorthingsutils.cpp.

Member Data Documentation

◆ DEFAULT_EXPANSION_LIMIT

constexpr int QgsSensorThingsUtils::DEFAULT_EXPANSION_LIMIT = 100
staticconstexpr

Default limit on number of expanded features fetched.

Definition at line 45 of file qgssensorthingsutils.h.

◆ DEFAULT_FEATURE_LIMIT

constexpr int QgsSensorThingsUtils::DEFAULT_FEATURE_LIMIT = 10000
staticconstexpr

Default limit on number of features fetched.

Definition at line 42 of file qgssensorthingsutils.h.

◆ DEFAULT_PAGE_SIZE

constexpr int QgsSensorThingsUtils::DEFAULT_PAGE_SIZE = 200
staticconstexpr

Default page size.

Definition at line 39 of file qgssensorthingsutils.h.


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