mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-24 00:47:57 -05:00
Plus removed sql injection protection from sanitize because: 1. it was not required: the value goes into a QgsExpression and it's never sent to a provider directly 2. it could have been misused with the wrong assumption that it was robust implementation (it wasn't)
149 lines
5.0 KiB
Plaintext
149 lines
5.0 KiB
Plaintext
/************************************************************************
|
|
* This file has been generated automatically from *
|
|
* *
|
|
* src/server/qgsserverapiutils.h *
|
|
* *
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class QgsServerApiUtils
|
|
{
|
|
%Docstring
|
|
The QgsServerApiUtils class contains helper functions to handle common API operations.
|
|
|
|
.. versionadded:: 3.10
|
|
%End
|
|
|
|
%TypeHeaderCode
|
|
#include "qgsserverapiutils.h"
|
|
%End
|
|
public:
|
|
|
|
static QgsRectangle parseBbox( const QString &bbox );
|
|
%Docstring
|
|
Parses a comma separated ``bbox`` into a (possibly empty) :py:class:`QgsRectangle`.
|
|
|
|
.. note::
|
|
|
|
Z values (i.e. a 6 elements bbox) are silently discarded
|
|
%End
|
|
|
|
static QList< QgsVectorLayerServerProperties::WmsDimensionInfo > temporalDimensions( const QgsVectorLayer *layer );
|
|
%Docstring
|
|
Returns a list of temporal dimensions information for the given ``layer`` (either configured in wmsDimensions or the first date/datetime field)
|
|
|
|
.. versionadded:: 3.12
|
|
%End
|
|
|
|
static QgsDateRange parseTemporalDateInterval( const QString &interval ) throw( QgsServerApiBadRequestException );
|
|
%Docstring
|
|
Parses a date ``interval`` and returns a :py:class:`QgsDateRange`
|
|
|
|
:raises QgsServerApiBadRequestException: if interval cannot be parsed
|
|
|
|
.. versionadded:: 3.12
|
|
%End
|
|
|
|
static QgsDateTimeRange parseTemporalDateTimeInterval( const QString &interval ) throw( QgsServerApiBadRequestException );
|
|
%Docstring
|
|
Parses a datetime ``interval`` and returns a :py:class:`QgsDateTimeRange`
|
|
|
|
:raises QgsServerApiBadRequestException: if interval cannot be parsed
|
|
|
|
.. versionadded:: 3.12
|
|
%End
|
|
|
|
|
|
|
|
static QgsExpression temporalFilterExpression( const QgsVectorLayer *layer, const QString &interval );
|
|
%Docstring
|
|
Parses the ``interval`` and constructs a (possibly invalid) temporal filter expression for the given ``layer``
|
|
|
|
Interval syntax:
|
|
|
|
interval-closed = date-time "/" date-time
|
|
interval-open-start = [".."] "/" date-time
|
|
interval-open-end = date-time "/" [".."]
|
|
interval = interval-closed / interval-open-start / interval-open-end
|
|
datetime = date-time / interval
|
|
|
|
.. versionadded:: 3.12
|
|
%End
|
|
|
|
|
|
|
|
static QVariantList temporalExtentList( const QgsVectorLayer *layer ) /PyName=temporalExtent/;
|
|
%Docstring
|
|
temporalExtent returns a json array with an array of [min, max] temporal extent for the given ``layer``.
|
|
In case multiple temporal dimensions are available in the layer, a union of all dimensions is returned.
|
|
|
|
From specifications: http://schemas.opengis.net/ogcapi/features/part1/1.0/openapi/schemas/extent.yaml
|
|
|
|
One or more time intervals that describe the temporal extent of the dataset.
|
|
The value `null` is supported and indicates an open time interval.
|
|
|
|
In the Core only a single time interval is supported. Extensions may support
|
|
multiple intervals. If multiple intervals are provided, the union of the
|
|
intervals describes the temporal extent.
|
|
|
|
:return: An array of intervals
|
|
|
|
.. versionadded:: 3.12
|
|
%End
|
|
|
|
static QgsCoordinateReferenceSystem parseCrs( const QString &bboxCrs );
|
|
%Docstring
|
|
Parses the CRS URI ``bboxCrs`` (example: "http://www.opengis.net/def/crs/OGC/1.3/CRS84") into a QGIS CRS object
|
|
%End
|
|
|
|
static const QVector<QgsVectorLayer *> publishedWfsLayers( const QgsServerApiContext &context );
|
|
%Docstring
|
|
Returns the list of layers accessible to the service for a given ``context``.
|
|
|
|
This method takes into account the ACL restrictions provided by QGIS Server Access Control plugins.
|
|
%End
|
|
|
|
|
|
|
|
static QString sanitizedFieldValue( const QString &value );
|
|
%Docstring
|
|
Sanitizes the input ``value`` by removing URL encoding.
|
|
|
|
.. note::
|
|
|
|
the returned value is meant to become part of a QgsExpression filter
|
|
%End
|
|
|
|
static QStringList publishedCrsList( const QgsProject *project );
|
|
%Docstring
|
|
Returns the list of CRSs (format: http://www.opengis.net/def/crs/OGC/1.3/CRS84) available for this ``project``.
|
|
Information is read from project WMS configuration.
|
|
%End
|
|
|
|
static QString crsToOgcUri( const QgsCoordinateReferenceSystem &crs );
|
|
%Docstring
|
|
Returns a ``crs`` as OGC URI (format: http://www.opengis.net/def/crs/OGC/1.3/CRS84)
|
|
Returns an empty string on failure.
|
|
%End
|
|
|
|
static QString appendMapParameter( const QString &path, const QUrl &requestUrl );
|
|
%Docstring
|
|
Appends MAP query string parameter from current ``requestUrl`` to the given ``path``
|
|
%End
|
|
|
|
};
|
|
/************************************************************************
|
|
* This file has been generated automatically from *
|
|
* *
|
|
* src/server/qgsserverapiutils.h *
|
|
* *
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
************************************************************************/
|