|
QGIS API Documentation 4.3.0-Master (bf28115e945)
|
QGIS Server OGC API endpoint. More...
#include <qgsserverogcapi.h>

Public Types | |
| enum | ContentType { GEOJSON , OPENAPI3 , JSON , SCHEMA_JSON , HTML , XML , FLATGEOBUF } |
| Media types used for content negotiation, insert more specific first. More... | |
| enum class | Profile { Unset , Rfc7946 , RelAsLink , RelAsKey , RelAsUri } |
| JSON profile. More... | |
| enum | Rel { alternate , describedBy , collection , item , self , service_desc , service_doc , prev , next , license , items , conformance , data , schema , profile } |
| Rel link types. More... | |
Public Member Functions | |
| QgsServerOgcApi (QgsServerInterface *serverIface, const QString &rootPath, const QString &name, const QString &description=QString(), const QString &version=QString()) | |
| QgsServerOgcApi constructor. | |
| ~QgsServerOgcApi () override | |
| const QString | description () const override |
| Returns the API description. | |
| void | executeRequest (const QgsServerApiContext &context) const override |
| Executes a request by passing the given context to the API handlers. | |
| const std::vector< std::shared_ptr< QgsServerOgcApiHandler > > | handlers () const |
| Returns registered handlers. | |
| const QString | name () const override |
| Returns the API name. | |
| template<class T, typename... Args> | |
| void | registerHandler (Args... args) |
| Registers an OGC API handler passing Args to the constructor. | |
| void | registerHandler (QgsServerOgcApiHandler *handler) |
| Registers an OGC API handler, ownership of the handler is transferred to the API. | |
| const QString | rootPath () const override |
| Returns the root path for the API. | |
| const QString | version () const override |
| Returns the version of the service. | |
| Public Member Functions inherited from QgsServerApi | |
| QgsServerApi (QgsServerInterface *serverIface) | |
| Creates a QgsServerApi object. | |
| virtual | ~QgsServerApi ()=default |
| virtual bool | accept (const QUrl &url) const |
Returns true if the given url is handled by the API, default implementation checks for the presence of rootPath inside the url path. | |
| QgsServerInterface * | serverIface () const |
| Returns the server interface. | |
Static Public Member Functions | |
| static const QHash< QgsServerOgcApi::ContentType, QList< QgsServerOgcApi::ContentType > > | contentTypeAliases () |
| Returns contentType specializations (e.g. | |
| static QgsServerOgcApi::ContentType | contentTypeFromExtension (const std::string &extension) |
| Returns the Content-Type value corresponding to extension. | |
| static const QMap< QgsServerOgcApi::ContentType, QStringList > | contentTypeMimes () |
| Returns a map of contentType => list of mime types. | |
| static QString | contentTypeToExtension (const QgsServerOgcApi::ContentType &ct) |
| Returns the file extension for a ct (Content-Type). | |
| static std::string | contentTypeToStdString (const QgsServerOgcApi::ContentType &ct) |
| Returns the string representation of a ct (Content-Type) attribute. | |
| static QString | contentTypeToString (const QgsServerOgcApi::ContentType &ct) |
| Returns the string representation of a ct (Content-Type) attribute. | |
| static Q_DECL_DEPRECATED QgsServerOgcApi::ContentType | contenTypeFromExtension (const std::string &extension) |
| Returns the Content-Type value corresponding to extension. | |
| static std::string | mimeType (const QgsServerOgcApi::ContentType &contentType) |
| Returns the mime-type for the contentType or an empty string if not found. | |
| static QString | profileToString (const QgsServerOgcApi::Profile &profile) |
| Returns a string representation of the profile. | |
| static QString | profileToUri (const QgsServerOgcApi::Profile &profile) |
| Returns a URI string representation of the profile. | |
| static std::string | relToString (const QgsServerOgcApi::Rel &rel) |
| Returns the string representation of rel attribute, to be used or "rel" link attribute in an OGC API response. | |
| static QUrl | sanitizeUrl (const QUrl &url) |
| Returns a sanitized url with extra slashes removed and the path URL component that always starts with a slash. | |
QGIS Server OGC API endpoint.
QgsServerOgcApi provides the foundation for the new generation of REST-API based OGC services (e.g. WFS3).
This class can be used directly and configured by registering handlers as instances of QgsServerOgcApiHandler.
Definition at line 47 of file qgsserverogcapi.h.
Media types used for content negotiation, insert more specific first.
| Enumerator | |
|---|---|
| GEOJSON | |
| OPENAPI3 | "application/openapi+json;version=3.0" |
| JSON | |
| SCHEMA_JSON | "application/schema+json" |
| HTML | |
| XML | |
| FLATGEOBUF | "application/flatgeobuf" |
Definition at line 81 of file qgsserverogcapi.h.
|
strong |
JSON profile.
| Enumerator | |
|---|---|
| Unset | No profile. |
| Rfc7946 | GeoJSON profile according to RFC7946. |
| RelAsLink | JSON responses that include links for referenced resources http://www.opengis.net/def/profile/ogc/0/rel-as-link. |
| RelAsKey | JSON responses that include key for referenced resources http://www.opengis.net/def/profile/ogc/0/rel-as-key. |
| RelAsUri | JSON responses that include URI for referenced resources http://www.opengis.net/def/profile/ogc/0/rel-as-uri. |
Definition at line 95 of file qgsserverogcapi.h.
| enum QgsServerOgcApi::Rel |
Rel link types.
Definition at line 55 of file qgsserverogcapi.h.
| QgsServerOgcApi::QgsServerOgcApi | ( | QgsServerInterface * | serverIface, |
| const QString & | rootPath, | ||
| const QString & | name, | ||
| const QString & | description = QString(), | ||
| const QString & | version = QString() ) |
QgsServerOgcApi constructor.
| serverIface | pointer to the server interface |
| rootPath | root path for this API (usually starts with a "/", e.g. "/wfs3") |
| name | API name |
| description | API description |
| version | API version |
Definition at line 51 of file qgsserverogcapi.cpp.
|
override |
Definition at line 59 of file qgsserverogcapi.cpp.
|
static |
Returns contentType specializations (e.g.
JSON => [GEOJSON, OPENAPI3], XML => [GML])
Definition at line 124 of file qgsserverogcapi.cpp.
|
static |
Returns the Content-Type value corresponding to extension.
Definition at line 226 of file qgsserverogcapi.cpp.
|
static |
Returns a map of contentType => list of mime types.
Definition at line 119 of file qgsserverogcapi.cpp.
|
static |
Returns the file extension for a ct (Content-Type).
Definition at line 208 of file qgsserverogcapi.cpp.
|
static |
Returns the string representation of a ct (Content-Type) attribute.
Definition at line 202 of file qgsserverogcapi.cpp.
|
static |
Returns the string representation of a ct (Content-Type) attribute.
Definition at line 195 of file qgsserverogcapi.cpp.
|
inlinestatic |
Returns the Content-Type value corresponding to extension.
Definition at line 201 of file qgsserverogcapi.h.
|
inlineoverridevirtual |
Returns the API description.
Implements QgsServerApi.
Definition at line 121 of file qgsserverogcapi.h.
|
overridevirtual |
Executes a request by passing the given context to the API handlers.
Implements QgsServerApi.
Definition at line 86 of file qgsserverogcapi.cpp.
| const std::vector< std::shared_ptr< QgsServerOgcApiHandler > > QgsServerOgcApi::handlers | ( | ) | const |
Returns registered handlers.
Definition at line 255 of file qgsserverogcapi.cpp.
|
static |
Returns the mime-type for the contentType or an empty string if not found.
Definition at line 246 of file qgsserverogcapi.cpp.
|
inlineoverridevirtual |
|
static |
Returns a string representation of the profile.
Definition at line 129 of file qgsserverogcapi.cpp.
|
static |
Returns a URI string representation of the profile.
Definition at line 156 of file qgsserverogcapi.cpp.
|
inline |
Registers an OGC API handler passing Args to the constructor.
Definition at line 163 of file qgsserverogcapi.h.
| void QgsServerOgcApi::registerHandler | ( | QgsServerOgcApiHandler * | handler | ) |
Registers an OGC API handler, ownership of the handler is transferred to the API.
Definition at line 64 of file qgsserverogcapi.cpp.
|
static |
Returns the string representation of rel attribute, to be used or "rel" link attribute in an OGC API response.
Definition at line 183 of file qgsserverogcapi.cpp.
|
inlineoverridevirtual |
Returns the root path for the API.
Implements QgsServerApi.
Definition at line 123 of file qgsserverogcapi.h.
|
static |
Returns a sanitized url with extra slashes removed and the path URL component that always starts with a slash.
Definition at line 70 of file qgsserverogcapi.cpp.
|
inlineoverridevirtual |
Returns the version of the service.
Reimplemented from QgsServerApi.
Definition at line 122 of file qgsserverogcapi.h.