QGIS API Documentation  3.26.3-Buenos Aires (65e4edfdad)
qgsarcgisrestutils.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsarcgisrestutils.h
3  --------------------
4  begin : Nov 25, 2015
5  copyright : (C) 2015 by Sandro Mani
6  email : [email protected]
7  ***************************************************************************
8  * *
9  * This program is free software; you can redistribute it and/or modify *
10  * it under the terms of the GNU General Public License as published by *
11  * the Free Software Foundation; either version 2 of the License, or *
12  * (at your option) any later version. *
13  * *
14  ***************************************************************************/
15 #ifndef QGSARCGISRESTUTILS_H
16 #define QGSARCGISRESTUTILS_H
17 
18 #include "qgswkbtypes.h"
19 #include "qgsrectangle.h"
20 #include "qgsmarkersymbollayer.h"
21 
22 #include "qgis_sip.h"
23 
24 #include <QStringList>
25 #include <QVariant>
26 #include <functional>
27 #include <memory>
28 
29 class QNetworkReply;
31 class QgsFields;
35 class QgsFeedback;
36 class QgsSymbol;
37 class QgsLineSymbol;
38 class QgsFillSymbol;
39 class QgsMarkerSymbol;
40 class QgsFeatureRenderer;
41 class QgsPoint;
43 class QgsCircularString;
44 class QgsCompoundCurve;
45 class QgsMultiPoint;
46 class QgsMultiSurface;
47 class QgsPolygon;
48 class QgsMultiCurve;
49 
58 class CORE_EXPORT QgsArcGisRestUtils
59 {
60  public:
61 
65  static QVariant::Type convertFieldType( const QString &type );
66 
70  static QgsWkbTypes::Type convertGeometryType( const QString &type );
71 
85  static QgsAbstractGeometry *convertGeometry( const QVariantMap &geometry, const QString &esriGeometryType, bool hasM, bool hasZ, QgsCoordinateReferenceSystem *crs SIP_OUT = nullptr ) SIP_FACTORY;
86 
90  static QgsCoordinateReferenceSystem convertSpatialReference( const QVariantMap &spatialReferenceMap );
91 
97  static QgsSymbol *convertSymbol( const QVariantMap &definition ) SIP_FACTORY;
98 
104  static QgsFeatureRenderer *convertRenderer( const QVariantMap &rendererData ) SIP_FACTORY;
105 
111  static QgsAbstractVectorLayerLabeling *convertLabeling( const QVariantList &data ) SIP_FACTORY;
112 
116  static QString convertLabelingExpression( const QString &string );
117 
121  static QColor convertColor( const QVariant &data );
122 
126  static Qt::PenStyle convertLineStyle( const QString &style );
127 
131  static Qt::BrushStyle convertFillStyle( const QString &style );
132 
136  static QDateTime convertDateTime( const QVariant &value );
137 
138  private:
139 
143  static std::unique_ptr< QgsPoint > convertPoint( const QVariantList &list, QgsWkbTypes::Type type );
144 
150  static std::unique_ptr< QgsCircularString > convertCircularString( const QVariantMap &data, QgsWkbTypes::Type type, const QgsPoint &startPoint );
151 
155  static std::unique_ptr< QgsCompoundCurve > convertCompoundCurve( const QVariantList &list, QgsWkbTypes::Type type );
156 
160  static std::unique_ptr< QgsPoint > convertGeometryPoint( const QVariantMap &data, QgsWkbTypes::Type pointType );
161 
165  static std::unique_ptr< QgsMultiPoint > convertMultiPoint( const QVariantMap &geometryData, QgsWkbTypes::Type pointType );
166 
170  static std::unique_ptr< QgsMultiCurve > convertGeometryPolyline( const QVariantMap &data, QgsWkbTypes::Type pointType );
171 
175  static std::unique_ptr< QgsMultiSurface > convertGeometryPolygon( const QVariantMap &data, QgsWkbTypes::Type pointType );
176 
180  static std::unique_ptr< QgsPolygon > convertEnvelope( const QVariantMap &data );
181 
182  static std::unique_ptr< QgsLineSymbol > parseEsriLineSymbolJson( const QVariantMap &symbolData );
183  static std::unique_ptr< QgsFillSymbol > parseEsriFillSymbolJson( const QVariantMap &symbolData );
184  static std::unique_ptr< QgsFillSymbol > parseEsriPictureFillSymbolJson( const QVariantMap &symbolData );
185  static std::unique_ptr< QgsMarkerSymbol > parseEsriMarkerSymbolJson( const QVariantMap &symbolData );
186  static std::unique_ptr< QgsMarkerSymbol > parseEsriPictureMarkerSymbolJson( const QVariantMap &symbolData );
187 
188  static Qgis::MarkerShape parseEsriMarkerShape( const QString &style );
189 
190  friend class TestQgsArcGisRestUtils;
191 };
192 
193 #endif // QGSARCGISRESTUTILS_H
QgsPolygon
Polygon geometry type.
Definition: qgspolygon.h:33
qgsrectangle.h
QgsPoint
Point geometry type, with support for z-dimension and m-values.
Definition: qgspoint.h:48
SIP_OUT
#define SIP_OUT
Definition: qgis_sip.h:58
crs
const QgsCoordinateReferenceSystem & crs
Definition: qgswfsgetfeature.cpp:105
QgsFields
Container of fields for a vector layer.
Definition: qgsfields.h:44
qgsmarkersymbollayer.h
QgsWkbTypes::Type
Type
The WKB type describes the number of dimensions a geometry has.
Definition: qgswkbtypes.h:69
QgsSymbol
Abstract base class for all rendered symbols.
Definition: qgssymbol.h:92
QgsMultiSurface
Multi surface geometry collection.
Definition: qgsmultisurface.h:32
SIP_FACTORY
#define SIP_FACTORY
Definition: qgis_sip.h:76
QgsCircularString
Circular string geometry type.
Definition: qgscircularstring.h:34
QgsMultiCurve
Multi curve geometry collection.
Definition: qgsmulticurve.h:29
QgsMarkerSymbol
A marker symbol type, for rendering Point and MultiPoint geometries.
Definition: qgsmarkersymbol.h:30
QgsFeedback
Base class for feedback objects to be used for cancellation of something running in a worker thread.
Definition: qgsfeedback.h:44
qgis_sip.h
QgsLineSymbol
A line symbol type, for rendering LineString and MultiLineString geometries.
Definition: qgslinesymbol.h:29
QgsNetworkAccessManager
network access manager for QGIS
Definition: qgsnetworkaccessmanager.h:269
QgsMultiPoint
Multi point geometry collection.
Definition: qgsmultipoint.h:29
QgsCoordinateReferenceSystem
This class represents a coordinate reference system (CRS).
Definition: qgscoordinatereferencesystem.h:211
QgsAbstractGeometry
Abstract base class for all geometries.
Definition: qgsabstractgeometry.h:79
QgsAbstractVectorLayerLabeling
Abstract base class - its implementations define different approaches to the labeling of a vector lay...
Definition: qgsvectorlayerlabeling.h:41
QgsFeatureRenderer
Definition: qgsrenderer.h:101
QgsFillSymbol
A fill symbol type, for rendering Polygon and MultiPolygon geometries.
Definition: qgsfillsymbol.h:29
Qgis::MarkerShape
MarkerShape
Marker shapes.
Definition: qgis.h:1370
QgsArcGisRestUtils
Utility functions for working with ArcGIS REST services.
Definition: qgsarcgisrestutils.h:58
qgswkbtypes.h
QgsCompoundCurve
Compound curve geometry type.
Definition: qgscompoundcurve.h:31