QGIS API Documentation  3.22.4-Białowieża (ce8e65e95e)
Public Types | Static Public Member Functions | Friends | List of all members
QgsArcGisRestQueryUtils Class Reference

Utility functions for querying ArcGIS REST services. More...

#include <qgsarcgisrestquery.h>

Public Types

enum  ServiceTypeFilter { AllTypes , Vector , Raster }
 Service types. More...
 

Static Public Member Functions

static void addLayerItems (const std::function< void(const QString &parentLayerId, ServiceTypeFilter serviceType, QgsWkbTypes::GeometryType geometryType, const QString &layerId, const QString &name, const QString &description, const QString &url, bool isParentLayer, const QString &authid, const QString &format)> &visitor, const QVariantMap &serviceData, const QString &parentUrl, const QString &parentSupportedFormats, const ServiceTypeFilter filter=AllTypes)
 Calls the specified visitor function on all layer items found within the given service data. More...
 
static QVariantMap getLayerInfo (const QString &layerurl, const QString &authcfg, QString &errorTitle, QString &errorText, const QMap< QString, QString > &requestHeaders=QMap< QString, QString >())
 Retrieves JSON layer info for the specified layer URL. More...
 
static QVariantMap getObjectIds (const QString &layerurl, const QString &authcfg, QString &errorTitle, QString &errorText, const QMap< QString, QString > &requestHeaders=QMap< QString, QString >(), const QgsRectangle &bbox=QgsRectangle())
 Retrieves all object IDs for the specified layer URL. More...
 
static QList< quint32 > getObjectIdsByExtent (const QString &layerurl, const QgsRectangle &filterRect, QString &errorTitle, QString &errorText, const QString &authcfg, const QgsStringMap &requestHeaders=QgsStringMap(), QgsFeedback *feedback=nullptr)
 Gets a list of object IDs which fall within the specified extent. More...
 
static QVariantMap getObjects (const QString &layerurl, const QString &authcfg, const QList< quint32 > &objectIds, const QString &crs, bool fetchGeometry, const QStringList &fetchAttributes, bool fetchM, bool fetchZ, const QgsRectangle &filterRect, QString &errorTitle, QString &errorText, const QgsStringMap &requestHeaders=QgsStringMap(), QgsFeedback *feedback=nullptr)
 Retrieves all matching objects from the specified layer URL. More...
 
static QVariantMap getServiceInfo (const QString &baseurl, const QString &authcfg, QString &errorTitle, QString &errorText, const QMap< QString, QString > &requestHeaders=QMap< QString, QString >())
 Retrieves JSON service info for the specified base URL. More...
 
static QByteArray queryService (const QUrl &url, const QString &authcfg, QString &errorTitle, QString &errorText, const QgsStringMap &requestHeaders=QgsStringMap(), QgsFeedback *feedback=nullptr, QString *contentType=nullptr)
 Performs a blocking request to a URL and returns the retrieved data. More...
 
static QVariantMap queryServiceJSON (const QUrl &url, const QString &authcfg, QString &errorTitle, QString &errorText, const QgsStringMap &requestHeaders=QgsStringMap(), QgsFeedback *feedback=nullptr)
 Performs a blocking request to a URL and returns the retrieved JSON content. More...
 
static void visitFolderItems (const std::function< void(const QString &folderName, const QString &url)> &visitor, const QVariantMap &serviceData, const QString &baseUrl)
 Calls the specified visitor function on all folder items found within the given service data. More...
 
static void visitServiceItems (const std::function< void(const QString &serviceName, const QString &url, const QString &service, ServiceTypeFilter serviceType)> &visitor, const QVariantMap &serviceData, const QString &baseUrl)
 Calls the specified visitor function on all service items found within the given service data. More...
 

Friends

class TestQgsArcGisRestUtils
 

Detailed Description

Utility functions for querying ArcGIS REST services.

Since
QGIS 3.18

Definition at line 36 of file qgsarcgisrestquery.h.

Member Enumeration Documentation

◆ ServiceTypeFilter

Service types.

Enumerator
AllTypes 

All types.

Vector 

Vector type.

Raster 

Raster type.

Definition at line 43 of file qgsarcgisrestquery.h.

Member Function Documentation

◆ addLayerItems()

void QgsArcGisRestQueryUtils::addLayerItems ( const std::function< void(const QString &parentLayerId, ServiceTypeFilter serviceType, QgsWkbTypes::GeometryType geometryType, const QString &layerId, const QString &name, const QString &description, const QString &url, bool isParentLayer, const QString &authid, const QString &format)> &  visitor,
const QVariantMap &  serviceData,
const QString &  parentUrl,
const QString &  parentSupportedFormats,
const ServiceTypeFilter  filter = AllTypes 
)
static

Calls the specified visitor function on all layer items found within the given service data.

Definition at line 319 of file qgsarcgisrestquery.cpp.

◆ getLayerInfo()

QVariantMap QgsArcGisRestQueryUtils::getLayerInfo ( const QString &  layerurl,
const QString &  authcfg,
QString &  errorTitle,
QString &  errorText,
const QMap< QString, QString > &  requestHeaders = QMap< QString, QString >() 
)
static

Retrieves JSON layer info for the specified layer URL.

Definition at line 41 of file qgsarcgisrestquery.cpp.

◆ getObjectIds()

QVariantMap QgsArcGisRestQueryUtils::getObjectIds ( const QString &  layerurl,
const QString &  authcfg,
QString &  errorTitle,
QString &  errorText,
const QMap< QString, QString > &  requestHeaders = QMap< QString, QString >(),
const QgsRectangle bbox = QgsRectangle() 
)
static

Retrieves all object IDs for the specified layer URL.

Definition at line 51 of file qgsarcgisrestquery.cpp.

◆ getObjectIdsByExtent()

QList< quint32 > QgsArcGisRestQueryUtils::getObjectIdsByExtent ( const QString &  layerurl,
const QgsRectangle filterRect,
QString &  errorTitle,
QString &  errorText,
const QString &  authcfg,
const QgsStringMap requestHeaders = QgsStringMap(),
QgsFeedback feedback = nullptr 
)
static

Gets a list of object IDs which fall within the specified extent.

Definition at line 113 of file qgsarcgisrestquery.cpp.

◆ getObjects()

QVariantMap QgsArcGisRestQueryUtils::getObjects ( const QString &  layerurl,
const QString &  authcfg,
const QList< quint32 > &  objectIds,
const QString &  crs,
bool  fetchGeometry,
const QStringList &  fetchAttributes,
bool  fetchM,
bool  fetchZ,
const QgsRectangle filterRect,
QString &  errorTitle,
QString &  errorText,
const QgsStringMap requestHeaders = QgsStringMap(),
QgsFeedback feedback = nullptr 
)
static

Retrieves all matching objects from the specified layer URL.

Definition at line 71 of file qgsarcgisrestquery.cpp.

◆ getServiceInfo()

QVariantMap QgsArcGisRestQueryUtils::getServiceInfo ( const QString &  baseurl,
const QString &  authcfg,
QString &  errorTitle,
QString &  errorText,
const QMap< QString, QString > &  requestHeaders = QMap< QString, QString >() 
)
static

Retrieves JSON service info for the specified base URL.

Definition at line 31 of file qgsarcgisrestquery.cpp.

◆ queryService()

QByteArray QgsArcGisRestQueryUtils::queryService ( const QUrl &  url,
const QString &  authcfg,
QString &  errorTitle,
QString &  errorText,
const QgsStringMap requestHeaders = QgsStringMap(),
QgsFeedback feedback = nullptr,
QString *  contentType = nullptr 
)
static

Performs a blocking request to a URL and returns the retrieved data.

Definition at line 143 of file qgsarcgisrestquery.cpp.

◆ queryServiceJSON()

QVariantMap QgsArcGisRestQueryUtils::queryServiceJSON ( const QUrl &  url,
const QString &  authcfg,
QString &  errorTitle,
QString &  errorText,
const QgsStringMap requestHeaders = QgsStringMap(),
QgsFeedback feedback = nullptr 
)
static

Performs a blocking request to a URL and returns the retrieved JSON content.

Definition at line 176 of file qgsarcgisrestquery.cpp.

◆ visitFolderItems()

void QgsArcGisRestQueryUtils::visitFolderItems ( const std::function< void(const QString &folderName, const QString &url)> &  visitor,
const QVariantMap &  serviceData,
const QString &  baseUrl 
)
static

Calls the specified visitor function on all folder items found within the given service data.

Definition at line 271 of file qgsarcgisrestquery.cpp.

◆ visitServiceItems()

void QgsArcGisRestQueryUtils::visitServiceItems ( const std::function< void(const QString &serviceName, const QString &url, const QString &service, ServiceTypeFilter serviceType)> &  visitor,
const QVariantMap &  serviceData,
const QString &  baseUrl 
)
static

Calls the specified visitor function on all service items found within the given service data.

Definition at line 290 of file qgsarcgisrestquery.cpp.

Friends And Related Function Documentation

◆ TestQgsArcGisRestUtils

friend class TestQgsArcGisRestUtils
friend

Definition at line 108 of file qgsarcgisrestquery.h.


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