QGIS API Documentation  3.20.0-Odense (decaadbb31)
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 QgsSimpleMarkerSymbolLayerBase::Shape parseEsriMarkerShape( const QString &style );
189 
190  friend class TestQgsArcGisRestUtils;
191 };
192 
193 #endif // QGSARCGISRESTUTILS_H
Abstract base class for all geometries.
Abstract base class - its implementations define different approaches to the labeling of a vector lay...
Utility functions for working with ArcGIS REST services.
Circular string geometry type.
Compound curve geometry type.
This class represents a coordinate reference system (CRS).
Base class for feedback objects to be used for cancellation of something running in a worker thread.
Definition: qgsfeedback.h:45
Container of fields for a vector layer.
Definition: qgsfields.h:45
A fill symbol type, for rendering Polygon and MultiPolygon geometries.
Definition: qgsfillsymbol.h:30
A line symbol type, for rendering LineString and MultiLineString geometries.
Definition: qgslinesymbol.h:30
A marker symbol type, for rendering Point and MultiPoint geometries.
Multi curve geometry collection.
Definition: qgsmulticurve.h:30
Multi point geometry collection.
Definition: qgsmultipoint.h:30
Multi surface geometry collection.
network access manager for QGIS
Point geometry type, with support for z-dimension and m-values.
Definition: qgspoint.h:49
Polygon geometry type.
Definition: qgspolygon.h:34
Abstract base class for all rendered symbols.
Definition: qgssymbol.h:38
Type
The WKB type describes the number of dimensions a geometry has.
Definition: qgswkbtypes.h:70
#define SIP_OUT
Definition: qgis_sip.h:58
#define SIP_FACTORY
Definition: qgis_sip.h:76
const QgsCoordinateReferenceSystem & crs