QGIS API Documentation 3.41.0-Master (af5edcb665c)
|
Utility functions for working with ArcGIS REST services. More...
#include <qgsarcgisrestutils.h>
Public Types | |
enum class | FeatureToJsonFlag : int { IncludeGeometry = 1 << 0 , IncludeNonObjectIdAttributes = 1 << 1 } |
Flags which control the behavior of converting features to JSON. More... | |
typedef QFlags< FeatureToJsonFlag > | FeatureToJsonFlags |
Flags which control the behavior of converting features to JSON. | |
Public Member Functions | |
Q_ENUM (FeatureToJsonFlag) | |
Static Public Member Functions | |
static QColor | convertColor (const QVariant &data) |
Converts ESRI JSON color data to a QColor object. | |
static QDateTime | convertDateTime (const QVariant &value) |
Converts a date time value to a QDateTime. | |
static QMetaType::Type | convertFieldType (const QString &type) |
Converts an ESRI REST field type to a QVariant type. | |
static Qt::BrushStyle | convertFillStyle (const QString &style) |
Converts an ESRI fill style to a Qt brush style. | |
static QgsAbstractGeometry * | convertGeometry (const QVariantMap &geometry, const QString &esriGeometryType, bool hasM, bool hasZ, QgsCoordinateReferenceSystem *crs=nullptr) |
Converts an ESRI REST geometry JSON definition to a QgsAbstractGeometry. | |
static Qgis::WkbType | convertGeometryType (const QString &type) |
Converts an ESRI REST geometry type to a WKB type. | |
static QgsAbstractVectorLayerLabeling * | convertLabeling (const QVariantList &data) |
Converts labeling JSON data to an equivalent QGIS vector labeling. | |
static QString | convertLabelingExpression (const QString &string) |
Converts an ESRI labeling expression to a QGIS expression string. | |
static Qt::PenStyle | convertLineStyle (const QString &style) |
Converts an ESRI line style to a Qt pen style. | |
static QgsRectangle | convertRectangle (const QVariant &value) |
Converts a rectangle value to a QgsRectangle. | |
static QgsFeatureRenderer * | convertRenderer (const QVariantMap &rendererData) |
Converts renderer JSON data to an equivalent QgsFeatureRenderer. | |
static QgsCoordinateReferenceSystem | convertSpatialReference (const QVariantMap &spatialReferenceMap) |
Converts a spatial reference JSON definition to a QgsCoordinateReferenceSystem value. | |
static QgsSymbol * | convertSymbol (const QVariantMap &definition) |
Converts a symbol JSON definition to a QgsSymbol. | |
static QVariantMap | crsToJson (const QgsCoordinateReferenceSystem &crs) |
Converts a crs to an ArcGIS REST JSON representation. | |
static QVariantMap | featureToJson (const QgsFeature &feature, const QgsArcGisRestContext &context, const QgsCoordinateReferenceSystem &crs=QgsCoordinateReferenceSystem(), QgsArcGisRestUtils::FeatureToJsonFlags flags=QgsArcGisRestUtils::FeatureToJsonFlags(static_cast< int >(QgsArcGisRestUtils::FeatureToJsonFlag::IncludeGeometry)|static_cast< int >(QgsArcGisRestUtils::FeatureToJsonFlag::IncludeNonObjectIdAttributes))) |
Converts a feature to an ArcGIS REST JSON representation. | |
static QVariantMap | fieldDefinitionToJson (const QgsField &field) |
Converts a field's definition to an ArcGIS REST JSON representation. | |
static QVariantMap | geometryToJson (const QgsGeometry &geometry, const QgsArcGisRestContext &context, const QgsCoordinateReferenceSystem &crs=QgsCoordinateReferenceSystem()) |
Converts a geometry to an ArcGIS REST JSON representation. | |
static Qgis::ArcGisRestServiceType | serviceTypeFromString (const QString &type) |
Converts a string value to a REST service type. | |
static QVariant | variantToAttributeValue (const QVariant &variant, QMetaType::Type expectedType, const QgsArcGisRestContext &context) |
Converts a variant to a REST attribute value. | |
Friends | |
class | TestQgsArcGisRestUtils |
Utility functions for working with ArcGIS REST services.
Definition at line 114 of file qgsarcgisrestutils.h.
typedef QFlags< FeatureToJsonFlag > QgsArcGisRestUtils::FeatureToJsonFlags |
Flags which control the behavior of converting features to JSON.
Definition at line 240 of file qgsarcgisrestutils.h.
|
strong |
Flags which control the behavior of converting features to JSON.
Enumerator | |
---|---|
IncludeGeometry | Whether to include the geometry definition. |
IncludeNonObjectIdAttributes | Whether to include any non-objectId attributes. |
Definition at line 228 of file qgsarcgisrestutils.h.
|
static |
Converts ESRI JSON color data to a QColor object.
Definition at line 1223 of file qgsarcgisrestutils.cpp.
|
static |
Converts a date time value to a QDateTime.
Definition at line 1276 of file qgsarcgisrestutils.cpp.
|
static |
Converts an ESRI REST field type to a QVariant type.
Definition at line 59 of file qgsarcgisrestutils.cpp.
|
static |
Converts an ESRI fill style to a Qt brush style.
Definition at line 1254 of file qgsarcgisrestutils.cpp.
|
static |
Converts an ESRI REST geometry JSON definition to a QgsAbstractGeometry.
Caller takes ownership of the returned object.
geometry | JSON geometry definition |
esriGeometryType | ESRI geometry type string |
hasM | set to true to if geometry includes M values |
hasZ | set to true to if geometry includes Z values |
crs | if specified will be set to the parsed geometry CRS |
Definition at line 474 of file qgsarcgisrestutils.cpp.
|
static |
Converts an ESRI REST geometry type to a WKB type.
Definition at line 90 of file qgsarcgisrestutils.cpp.
|
static |
Converts labeling JSON data to an equivalent QGIS vector labeling.
Caller takes ownership of the returned object.
Definition at line 837 of file qgsarcgisrestutils.cpp.
|
static |
Converts an ESRI labeling expression to a QGIS expression string.
Definition at line 1199 of file qgsarcgisrestutils.cpp.
|
static |
Converts an ESRI line style to a Qt pen style.
Definition at line 1236 of file qgsarcgisrestutils.cpp.
|
static |
Converts a rectangle value to a QgsRectangle.
Returns a null rectangle if the value cannot be converted.
Definition at line 1291 of file qgsarcgisrestutils.cpp.
|
static |
Converts renderer JSON data to an equivalent QgsFeatureRenderer.
Caller takes ownership of the returned renderer.
Definition at line 972 of file qgsarcgisrestutils.cpp.
|
static |
Converts a spatial reference JSON definition to a QgsCoordinateReferenceSystem value.
Definition at line 513 of file qgsarcgisrestutils.cpp.
|
static |
Converts a symbol JSON definition to a QgsSymbol.
Caller takes ownership of the returned symbol.
Definition at line 547 of file qgsarcgisrestutils.cpp.
|
static |
Converts a crs to an ArcGIS REST JSON representation.
Returns an empty map if the crs is not valid.
Definition at line 1792 of file qgsarcgisrestutils.cpp.
|
static |
Converts a feature to an ArcGIS REST JSON representation.
Definition at line 1822 of file qgsarcgisrestutils.cpp.
|
static |
Converts a field's definition to an ArcGIS REST JSON representation.
Definition at line 1882 of file qgsarcgisrestutils.cpp.
|
static |
Converts a geometry to an ArcGIS REST JSON representation.
Returns an empty map if the geometry cannot be converted.
Definition at line 1318 of file qgsarcgisrestutils.cpp.
QgsArcGisRestUtils::Q_ENUM | ( | FeatureToJsonFlag | ) |
|
static |
Converts a string value to a REST service type.
Definition at line 1935 of file qgsarcgisrestutils.cpp.
|
static |
Converts a variant to a REST attribute value.
Definition at line 1844 of file qgsarcgisrestutils.cpp.
|
friend |
Definition at line 342 of file qgsarcgisrestutils.h.