QGIS API Documentation 3.41.0-Master (fda2aa46e9a)
Loading...
Searching...
No Matches
qgssensorthingsprovider.h
Go to the documentation of this file.
1/***************************************************************************
2 qgssensorthingsprovider.h
3 ----------------
4 begin : November 2023
5 copyright : (C) 2013 Nyall Dawson
6 email : nyall dot dawson at gmail dot com
7 ***************************************************************************/
8
9/***************************************************************************
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 ***************************************************************************/
17
18#ifndef QGSSENSORTHINGSPROVIDER_H
19#define QGSSENSORTHINGSPROVIDER_H
20
23#include "qgsprovidermetadata.h"
24
25#define SIP_NO_FILE
27
33class CORE_EXPORT QgsSensorThingsProvider final : public QgsVectorDataProvider
34{
35 Q_OBJECT
36
37 public:
38
39 static const inline QString SENSORTHINGS_PROVIDER_KEY = QStringLiteral( "sensorthings" );
40 static const inline QString SENSORTHINGS_PROVIDER_DESCRIPTION = QStringLiteral( "OGC SensorThings API data provider" );
41
42 QgsSensorThingsProvider( const QString &uri, const QgsDataProvider::ProviderOptions &providerOptions, Qgis::DataProviderReadFlags flags = Qgis::DataProviderReadFlags() );
43
45 QString storageType() const final;
46 QgsFeatureIterator getFeatures( const QgsFeatureRequest &request = QgsFeatureRequest() ) const final;
47 Qgis::WkbType wkbType() const final;
48 long long featureCount() const final;
49 QgsFields fields() const final;
50 QgsLayerMetadata layerMetadata() const final;
51 QString htmlMetadata() const final;
52
53 Qgis::DataProviderFlags flags() const final;
55 bool supportsSubsetString() const final;
56 QString subsetStringDialect() const override;
57 QString subsetStringHelpUrl() const override;
58 QString subsetString() const final;
59 bool setSubsetString( const QString &subset, bool updateFeatureCount = true ) final;
61 void setDataSourceUri( const QString &uri ) final;
62 QgsRectangle extent() const final;
63 bool isValid() const final { return mValid; }
64
65 QString name() const final;
66 QString description() const final;
67 bool renderInPreview( const QgsDataProvider::PreviewContext &context ) final;
68
69 static QString providerKey();
70
72
73 private:
74 bool mValid = false;
75 std::shared_ptr<QgsSensorThingsSharedData> mSharedData;
76
77 QgsLayerMetadata mLayerMetadata;
78
79 void reloadProviderData() final;
80};
81
82class QgsSensorThingsProviderMetadata final: public QgsProviderMetadata
83{
84 Q_OBJECT
85
86 public:
87 QgsSensorThingsProviderMetadata();
88 QIcon icon() const final;
89 QList<QgsDataItemProvider *> dataItemProviders() const final;
90 QVariantMap decodeUri( const QString &uri ) const final;
91 QString encodeUri( const QVariantMap &parts ) const final;
92 QgsSensorThingsProvider *createProvider( const QString &uri, const QgsDataProvider::ProviderOptions &options, Qgis::DataProviderReadFlags flags = Qgis::DataProviderReadFlags() ) final;
93 QList< Qgis::LayerType > supportedLayerTypes() const final;
94
95 // handling of stored connections
96
97 QMap<QString, QgsAbstractProviderConnection *> connections( bool cached ) final;
98 QgsAbstractProviderConnection *createConnection( const QString &name ) final;
99 void deleteConnection( const QString &name ) final;
100 void saveConnection( const QgsAbstractProviderConnection *connection, const QString &name ) final;
101
102};
103
105#endif // QGSSENSORTHINGSPROVIDER_H
The Qgis class provides global constants for use throughout the application.
Definition qgis.h:54
QFlags< DataProviderFlag > DataProviderFlags
Data provider flags.
Definition qgis.h:2147
QFlags< DataProviderReadFlag > DataProviderReadFlags
Flags which control data provider construction.
Definition qgis.h:450
QFlags< VectorProviderCapability > VectorProviderCapabilities
Vector data provider capabilities.
Definition qgis.h:500
WkbType
The WKB type describes the number of dimensions a geometry has.
Definition qgis.h:256
Base class that can be used for any class that is capable of returning features.
The QgsAbstractProviderConnection provides an interface for data provider connections.
This class represents a coordinate reference system (CRS).
This is the interface for those who want to add custom data items to the browser tree.
Abstract base class for spatial data provider implementations.
virtual QString subsetString() const
Returns the subset definition string currently in use by the layer and used by the provider to limit ...
virtual QString name() const =0
Returns a provider name.
virtual Qgis::DataProviderFlags flags() const
Returns the generic data provider flags.
virtual bool supportsSubsetString() const
Returns true if the provider supports setting of subset strings.
virtual QgsCoordinateReferenceSystem crs() const =0
Returns the coordinate system for the data source.
virtual QString subsetStringHelpUrl() const
Returns a URL pointing to documentation describing the dialect which is supported for subset strings ...
virtual QgsLayerMetadata layerMetadata() const
Returns layer metadata collected from the provider's source.
virtual bool isValid() const =0
Returns true if this is a valid layer.
virtual void setDataSourceUri(const QString &uri)
Set the data source specification.
virtual bool setSubsetString(const QString &subset, bool updateFeatureCount=true)
Set the subset string used to create a subset of features in the layer.
virtual QString description() const =0
Returns description.
virtual QString subsetStringDialect() const
Returns a user-friendly string describing the dialect which is supported for subset strings by the pr...
virtual QString htmlMetadata() const
Obtain a formatted HTML string containing assorted metadata for this data provider.
virtual bool renderInPreview(const QgsDataProvider::PreviewContext &context)
Returns whether the layer must be rendered in preview jobs.
virtual QgsRectangle extent() const =0
Returns the extent of the layer.
Wrapper for iterator of features from vector data provider or vector layer.
This class wraps a request for features to a vector layer (or directly its vector data provider).
Container of fields for a vector layer.
Definition qgsfields.h:46
A structured metadata store for a map layer.
Holds data provider key, description, and associated shared library file or function pointer informat...
virtual QIcon icon() const
Returns an icon representing the provider.
A rectangle specified with double values.
This is the base class for vector data providers.
long long featureCount() const override=0
Number of features in the layer.
virtual QString storageType() const
Returns the permanent storage type for this layer as a friendly name.
virtual Q_INVOKABLE Qgis::VectorProviderCapabilities capabilities() const
Returns flags containing the supported capabilities.
virtual void handlePostCloneOperations(QgsVectorDataProvider *source)
Handles any post-clone operations required after this vector data provider was cloned from the source...
virtual QgsAbstractFeatureSource * featureSource() const =0
Returns feature source object that can be used for querying provider's data.
QgsFields fields() const override=0
Returns the fields associated with this data provider.
Qgis::WkbType wkbType() const override=0
Returns the geometry type which is returned by this layer.
QgsFeatureIterator getFeatures(const QgsFeatureRequest &request=QgsFeatureRequest()) const override=0
Query the provider for features specified in request.
Stores settings related to the context in which a preview job runs.
Setting options for creating vector data providers.