QGIS API Documentation 3.36.0-Maidenhead (09951dc0acf)
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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 QgsSensorThingsProvider : 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, QgsDataProvider::ReadFlags flags = QgsDataProvider::ReadFlags() );
43
45 QString storageType() const override;
46 QgsFeatureIterator getFeatures( const QgsFeatureRequest &request = QgsFeatureRequest() ) const override;
47 Qgis::WkbType wkbType() const override;
48 long long featureCount() const override;
49 QgsFields fields() const override;
50 QgsLayerMetadata layerMetadata() const override;
51 QString htmlMetadata() const override;
52
53 QgsVectorDataProvider::Capabilities capabilities() const override;
54
55 QgsCoordinateReferenceSystem crs() const override;
56 void setDataSourceUri( const QString &uri ) override;
57 QgsRectangle extent() const override;
58 bool isValid() const override { return mValid; }
59
60 QString name() const override;
61 QString description() const override;
62
63 static QString providerKey();
64
65 void handlePostCloneOperations( QgsVectorDataProvider *source ) override;
66
67 private:
68 bool mValid = false;
69 std::shared_ptr<QgsSensorThingsSharedData> mSharedData;
70
71 QgsLayerMetadata mLayerMetadata;
72
73 void reloadProviderData() override;
74};
75
76class QgsSensorThingsProviderMetadata: public QgsProviderMetadata
77{
78 Q_OBJECT
79
80 public:
81 QgsSensorThingsProviderMetadata();
82 QIcon icon() const override;
83 QList<QgsDataItemProvider *> dataItemProviders() const override;
84 QVariantMap decodeUri( const QString &uri ) const override;
85 QString encodeUri( const QVariantMap &parts ) const override;
86 QgsSensorThingsProvider *createProvider( const QString &uri, const QgsDataProvider::ProviderOptions &options, QgsDataProvider::ReadFlags flags = QgsDataProvider::ReadFlags() ) override;
87 QList< Qgis::LayerType > supportedLayerTypes() const override;
88
89 // handling of stored connections
90
91 QMap<QString, QgsAbstractProviderConnection *> connections( bool cached ) override;
92 QgsAbstractProviderConnection *createConnection( const QString &name ) override;
93 void deleteConnection( const QString &name ) override;
94 void saveConnection( const QgsAbstractProviderConnection *connection, const QString &name ) override;
95
96};
97
99#endif // QGSSENSORTHINGSPROVIDER_H
WkbType
The WKB type describes the number of dimensions a geometry has.
Definition qgis.h:182
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).
virtual QString name() const =0
Returns a provider name.
virtual QgsCoordinateReferenceSystem crs() const =0
Returns the coordinate system for the data source.
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 QString description() const =0
Returns description.
virtual QString htmlMetadata() const
Obtain a formatted HTML string containing assorted metadata for this data provider.
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:45
A structured metadata store for a map layer.
Holds data provider key, description, and associated shared library file or function pointer informat...
virtual void deleteConnection(const QString &name)
Removes the connection with the given name from the settings.
virtual QIcon icon() const
Returns an icon representing the provider.
virtual QgsDataProvider * createProvider(const QString &uri, const QgsDataProvider::ProviderOptions &options, QgsDataProvider::ReadFlags flags=QgsDataProvider::ReadFlags())
Class factory to return a pointer to a newly created QgsDataProvider object.
virtual QString encodeUri(const QVariantMap &parts) const
Reassembles a provider data source URI from its component paths (e.g.
virtual QgsAbstractProviderConnection * createConnection(const QString &uri, const QVariantMap &configuration)
Creates a new connection from uri and configuration, the newly created connection is not automaticall...
virtual void saveConnection(const QgsAbstractProviderConnection *connection, const QString &name)
Stores the connection in the settings.
virtual QMap< QString, QgsAbstractProviderConnection * > connections(bool cached=true)
Returns a dictionary of stored provider connections, the dictionary key is the connection identifier.
virtual QList< Qgis::LayerType > supportedLayerTypes() const
Returns a list of the map layer types supported by the provider.
virtual QList< QgsDataItemProvider * > dataItemProviders() const
Returns data item providers.
virtual QVariantMap decodeUri(const QString &uri) const
Breaks a provider data source URI into its component paths (e.g.
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 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.
virtual Q_INVOKABLE QgsVectorDataProvider::Capabilities capabilities() const
Returns flags containing the supported capabilities.
Setting options for creating vector data providers.