6#ifndef OWSSERVICEMANAGER_H
7#define OWSSERVICEMANAGER_H
11#include <QNetworkAccessManager>
27enum OwsCapabilitiesStatus {
29 OwsCapabilitiesSuccess,
30 OwsCapabilitiesNoOwsServer,
31 OwsCapabilitiesReplyUnreadable,
39 WmsImageFailedServerMessage
42class OwsMappingCapabilities
45 OwsMappingCapabilities();
47 void setVersion(
const QString &version);
48 QString version()
const;
50 void setTitle(
const QString &title);
51 QString title()
const;
53 void setAbstract(
const QString &abstract);
54 QString abstract()
const;
56 QStringList layers()
const;
58 QString title(
const QString &layer);
59 QString abstract(
const QString &layer);
60 QString style(
const QString &layer);
62 void setOwsLayerMetaInfo(
const QMap<QString, QStringList> &wmsLayerMetaInfo);
63 QMap<QString, QStringList> owsLayerMetaInfo()
const;
70 QMap<QString, QStringList> m_owsLayerMetaInfo;
73class WmsCapabilities :
public OwsMappingCapabilities
78 void setContactInformation(
const QString &info);
79 QString contactInformation()
const;
81 void setFees(
const QString &fee);
84 QStringList projections(
const QString &layer);
85 QString boundingBox(
const QString &layer,
const QString &projection);
86 QString legendUrl(
const QString &layer);
87 QStringList styles(
const QStringList &layers);
88 QString boundingBoxNSEWDegrees(
const QStringList &layers,
const QString &projection);
90 void setReferenceSystemType(
const QString &refSystem);
91 QString referenceSystemType()
const;
93 void setWmsLayerCoordinateSystems(
const QMap<QString, QMap<QString, QString>> &wmsLayerCoordinateSystems);
94 QMap<QString, QMap<QString, QString>> wmsLayerCoordinateSystems()
const;
96 void setFormats(
const QStringList &formats);
97 QStringList formats();
99 QString m_referenceSystemType;
101 QString m_contactInformation;
104 QMap<QString, QMap<QString, QString>> m_wmsLayerCoordinateSystems;
106 QStringList m_formats;
109class WmtsCapabilities :
public OwsMappingCapabilities
114 void setWmtsTileMatrixSets(
const QMap<QString, QStringList> &wmtsTileMatrixSets);
115 QMap<QString, QStringList> wmtsTileMatrixSets()
const;
116 void setWmtsTileResource(
const QMap<QString, QMap<QString, QString>> &wmtsTileResource);
117 QMap<QString, QMap<QString, QString>> wmtsTileResource()
const;
119 QMap<QString, QStringList> m_wmtsTileMatrixSets;
120 QMap<QString, QMap<QString, QString>> m_wmtsTileResource;
123enum ImageResultType {
130class ImageRequestResult
133 ImageRequestResult();
135 void setImageStatus(WmsImageStatus imageStatus);
136 WmsImageStatus imageStatus()
const;
138 void setResultImage(
const QImage &image);
139 QImage resultImage()
const;
141 void setResultRaw(
const QByteArray &resultRaw);
142 QByteArray resultRaw()
const;
144 void setResultFormat(
const QString &resultFormat);
145 QString resultFormat()
const;
147 void setResultType(
const ImageResultType);
148 ImageResultType resultType()
const;
151 WmsImageStatus m_imageStatus;
152 QImage m_resultImage;
153 QByteArray m_resultRaw;
154 QString m_resultFormat;
155 ImageResultType m_resultType;
158class OwsServiceManager :
public QObject
165 void queryOwsCapabilities(
const QUrl &queryUrl,
const QString &serviceString = QStringLiteral(
"WMS"));
166 void queryWmsMap(
const QUrl &url,
167 const QString &layers,
168 const QString &projection,
170 const QString &format,
171 const QString &styles = QString());
172 void queryWmsLevelZeroTile(
const QUrl &url,
const QString &layers,
const QString &projection,
const QString &format,
const QString &styles = QString());
173 void queryWmsPreviewImage(
const QUrl &url,
const QString &layers,
const QString &projection,
const QString &format,
const QString &styles = QString());
174 void queryWmsLegendImage(
const QUrl &url);
176 void queryWmtsLevelZeroTile(
const QString &url,
const QString &style,
const QString &tileMatrixSet);
177 void queryWmtsPreviewImage(
const QString &url,
const QString &style,
const QString &tileMatrixSet);
178 void queryWmtsTile(
const QString &url,
179 const QString &style,
180 const QString &tileMatrixSet,
181 const QString &tileMatrix,
182 const QString &tileRow,
183 const QString &tileCol);
185 void queryXYZPreviewImage(
const QString &urlString);
186 void queryXYZLevelZeroTile(
const QString &urlString);
187 void queryXYZImage(
const QString urlString);
189 void handleAuthentication(QNetworkReply *reply, QAuthenticator *authenticator);
191 void setCapabilitiesStatus(OwsCapabilitiesStatus capabilitiesStatus);
192 OwsCapabilitiesStatus capabilitiesStatus()
const;
194 OwsServiceType owsServiceType();
195 WmsCapabilities wmsCapabilities();
196 WmtsCapabilities wmtsCapabilities();
197 ImageRequestResult imageRequestResult();
199 QImage resultImage();
200 QByteArray resultRaw();
201 QString resultFormat();
202 ImageResultType resultType();
205 void wmsCapabilitiesReady();
206 void wmtsCapabilitiesReady();
207 void imageRequestResultReady();
210 void parseOwsCapabilities(QNetworkReply *reply);
211 void parseWmsCapabilities(QNetworkReply *reply);
212 void parseWmtsCapabilities(QNetworkReply *reply);
213 void parseImageResult(QNetworkReply *reply);
218 QNetworkAccessManager m_capabilitiesAccessManager;
219 QNetworkAccessManager m_imageAccessManager;
220 OwsCapabilitiesStatus m_capabilitiesStatus;
221 OwsServiceType m_owsServiceType;
222 WmsCapabilities m_wmsCapabilities;
223 WmtsCapabilities m_wmtsCapabilities;
224 ImageRequestResult m_imageRequestResult;
Binds a QML item to a specific geodetic location in screen coordinates.
QObject * parent() const const