15#ifndef QGSARCGISRESTQUERY_H
16#define QGSARCGISRESTQUERY_H
54 static QVariantMap getServiceInfo(
const QString &baseurl,
const QString &authcfg, QString &errorTitle, QString &errorText,
const QgsHttpHeaders &requestHeaders =
QgsHttpHeaders() );
59 static QVariantMap getLayerInfo(
const QString &layerurl,
const QString &authcfg, QString &errorTitle, QString &errorText,
const QgsHttpHeaders &requestHeaders =
QgsHttpHeaders() );
64 static QVariantMap getObjectIds(
const QString &layerurl,
const QString &authcfg, QString &errorTitle, QString &errorText,
const QgsHttpHeaders &requestHeaders =
QgsHttpHeaders(),
66 const QString &whereClause = QString() );
79 static QVariantMap getObjects(
const QString &layerurl,
const QString &authcfg,
const QList<quint32> &objectIds,
const QString &
crs,
80 bool fetchGeometry,
const QStringList &fetchAttributes,
bool fetchM,
bool fetchZ,
86 static QList<quint32> getObjectIdsByExtent(
const QString &layerurl,
const QgsRectangle &filterRect, QString &errorTitle, QString &errorText,
const QString &authcfg,
const QgsHttpHeaders &requestHeaders =
QgsHttpHeaders(),
QgsFeedback *feedback =
nullptr,
87 const QString &whereClause = QString() );
92 static QByteArray queryService(
const QUrl &url,
const QString &authcfg, QString &errorTitle, QString &errorText,
const QgsHttpHeaders &requestHeaders =
QgsHttpHeaders(),
QgsFeedback *feedback =
nullptr, QString *contentType =
nullptr );
97 static QVariantMap queryServiceJSON(
const QUrl &url,
const QString &authcfg, QString &errorTitle, QString &errorText,
const QgsHttpHeaders &requestHeaders =
QgsHttpHeaders(),
QgsFeedback *feedback =
nullptr );
102 static void visitFolderItems(
const std::function<
void (
const QString &folderName,
const QString &url )> &visitor,
const QVariantMap &serviceData,
const QString &baseUrl );
107 static void visitServiceItems(
const std::function<
void (
const QString &serviceName,
const QString &url,
Qgis::ArcGisRestServiceType serviceType )> &visitor,
const QVariantMap &serviceData,
const QString &baseUrl );
112 static void addLayerItems(
const std::function<
void (
const QString &parentLayerId, ServiceTypeFilter serviceType,
Qgis::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 = ServiceTypeFilter::AllTypes );
117 static QUrl parseUrl(
const QUrl &url,
bool *isTestEndpoint =
nullptr );
121 static void adjustBaseUrl( QString &baseUrl,
const QString &name );
123 friend class TestQgsArcGisRestUtils;
127class CORE_EXPORT QgsArcGisAsyncQuery :
public QObject
131 QgsArcGisAsyncQuery( QObject *parent =
nullptr );
132 ~QgsArcGisAsyncQuery()
override;
134 void start(
const QUrl &url,
const QString &authCfg, QByteArray *result,
bool allowCache =
false,
const QgsHttpHeaders &headers =
QgsHttpHeaders() );
137 void failed( QString errorTitle, QString errorName );
142 QNetworkReply *mReply =
nullptr;
143 QByteArray *mResult =
nullptr;
146class CORE_EXPORT QgsArcGisAsyncParallelQuery :
public QObject
150 QgsArcGisAsyncParallelQuery(
const QString &authcfg,
const QgsHttpHeaders &requestHeaders, QObject *parent =
nullptr );
151 void start(
const QVector<QUrl> &urls, QVector<QByteArray> *results,
bool allowCache =
false );
154 void finished( QStringList errors );
159 QVector<QByteArray> *mResults =
nullptr;
160 int mPendingRequests = 0;
ArcGisRestServiceType
Available ArcGIS REST service types.
GeometryType
The geometry types are used to group Qgis::WkbType in a coarse way.
Utility functions for querying ArcGIS REST services.
ServiceTypeFilter
Service types.
Base class for feedback objects to be used for cancellation of something running in a worker thread.
A rectangle specified with double values.
const QgsCoordinateReferenceSystem & crs