15#ifndef QGSARCGISRESTUTILS_H
16#define QGSARCGISRESTUTILS_H
74 void setTimeZone(
const QTimeZone &zone ) { mTimeZone = zone; }
81 QTimeZone
timeZone()
const {
return mTimeZone; }
100 QString mObjectIdFieldName;
192 static std::unique_ptr< QgsAbstractVectorLayerLabeling >
convertLabeling(
const QVariantList &data );
253 IncludeGeometry = 1 << 0,
254 IncludeNonObjectIdAttributes = 1 << 1,
255 SkipUnsetAttributes = 1 << 2,
391 static std::unique_ptr< QgsPoint > convertPoint(
const QVariantList &list,
Qgis::WkbType type );
398 static std::unique_ptr< QgsCircularString > convertCircularString(
const QVariantMap &data,
Qgis::WkbType type,
const QgsPoint &startPoint );
403 static std::unique_ptr< QgsCurve > convertCompoundCurve(
const QVariantList &list,
Qgis::WkbType type );
408 static std::unique_ptr< QgsLineString > convertLineString(
const QVariantList &list,
Qgis::WkbType type );
413 static std::unique_ptr< QgsPoint > convertGeometryPoint(
const QVariantMap &data,
Qgis::WkbType pointType );
418 static std::unique_ptr< QgsMultiPoint > convertMultiPoint(
const QVariantMap &geometryData,
Qgis::WkbType pointType );
425 static std::unique_ptr< QgsMultiCurve > convertGeometryPolyline(
const QVariantMap &data,
Qgis::WkbType pointType,
bool allowCurves );
432 static std::unique_ptr< QgsMultiSurface > convertGeometryPolygon(
const QVariantMap &data,
Qgis::WkbType pointType,
bool allowCurves );
437 static std::unique_ptr< QgsPolygon > convertEnvelope(
const QVariantMap &data );
439 static QVariantMap pointToJson(
const QgsPoint *point );
440 static QVariantMap multiPointToJson(
const QgsMultiPoint *multiPoint );
441 static QVariantList lineStringToJsonPath(
const QgsLineString *line );
442 static QVariantList curveToJsonCurve(
const QgsCurve *curve,
bool includeStart );
443 static QVariantMap lineStringToJson(
const QgsLineString *line );
444 static QVariantMap curveToJson(
const QgsCurve *curve );
446 static QVariantMap multiCurveToJson(
const QgsMultiCurve *multiCurve );
447 static QVariantList polygonToJsonRings(
const QgsPolygon *polygon );
448 static QVariantList curvePolygonToJsonRings(
const QgsCurvePolygon *polygon );
449 static QVariantMap polygonToJson(
const QgsPolygon *polygon );
450 static QVariantMap curvePolygonToJson(
const QgsCurvePolygon *polygon );
451 static QVariantMap multiPolygonToJson(
const QgsMultiPolygon *polygon );
452 static QVariantMap multiSurfaceToJson(
const QgsMultiSurface *multiSurface );
ArcGisRestServiceType
Available ArcGIS REST service types.
DataType
Raster data types.
QFlags< ArcGisRestServiceCapability > ArcGisRestServiceCapabilities
Available ArcGIS REST service capabilities.
RasterColorInterpretation
Raster color interpretation.
WkbType
The WKB type describes the number of dimensions a geometry has.
Abstract base class for all geometries.
Abstract base class - its implementations define different approaches to the labeling of a vector lay...
Contains the context of a ArcGIS REST service operation.
void setTimeZone(const QTimeZone &zone)
Sets the time zone for datetime values.
QTimeZone timeZone() const
Returns the time zone for datetime values.
QString objectIdFieldName() const
Returns the name of the objectId field.
void setObjectIdFieldName(const QString &name)
Sets the name of the objectId field.
Utility functions for working with ArcGIS REST services.
static std::unique_ptr< QgsAbstractGeometry > convertGeometry(const QVariantMap &geometry, const QString &esriGeometryType, bool hasM, bool hasZ, bool allowCurves=true, QgsCoordinateReferenceSystem *crs=nullptr)
Converts an ESRI REST geometry JSON definition to a QgsAbstractGeometry.
static QVariantMap fieldDefinitionToJson(const QgsField &field)
Converts a field's definition to an ArcGIS REST JSON representation.
static QgsCoordinateReferenceSystem convertSpatialReference(const QVariantMap &spatialReferenceMap)
Converts a spatial reference JSON definition to a QgsCoordinateReferenceSystem value.
static QDateTime convertDateTime(const QVariant &value)
Converts a date time value to a QDateTime.
static Qgis::WkbType convertGeometryType(const QString &type)
Converts an ESRI REST geometry type to a WKB type.
static QString convertLabelingExpression(const QString &string)
Converts an ESRI labeling expression to a QGIS expression string.
static QVariantMap geometryToJson(const QgsGeometry &geometry, const QgsArcGisRestContext &context, const QgsCoordinateReferenceSystem &crs=QgsCoordinateReferenceSystem())
Converts a geometry to an ArcGIS REST JSON representation.
static double defaultNoDataForDataType(Qgis::DataType type, bool &ok)
Returns a sensible no-data value to use for the specified data type.
friend class TestQgsArcGisRestUtils
static PixelTypeLimitUsefulness pixelTypeLimitUsefulness(const QString &pixelType)
Returns whether the theoretical minimum and maximum values for a given ESRI pixelType are practically...
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.
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 Qt::PenStyle convertLineStyle(const QString &style)
Converts an ESRI line style to a Qt pen style.
Q_ENUM(FeatureToJsonFlag)
FeatureToJsonFlag
Flags which control the behavior of converting features to JSON.
@ IncludeGeometry
Whether to include the geometry definition.
@ IncludeNonObjectIdAttributes
Whether to include any non-objectId attributes.
static Qgis::ArcGisRestServiceCapabilities serviceCapabilitiesFromString(const QString &capabilities)
Parses a capabilities string to known values.
static std::optional< std::pair< double, double > > rangeForPixelType(const QString &pixelType)
Returns the valid data range given an ESRI pixelType string.
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 std::unique_ptr< QgsFeatureRenderer > convertRenderer(const QVariantMap &rendererData, QgsSymbolConverterContext &context)
Converts renderer JSON data to an equivalent QgsFeatureRenderer.
static Qgis::RasterColorInterpretation colorInterpretationFromBandName(const QString &bandName)
Attempts to match arbitrary band name strings to a QGIS raster color interpretation.
static QVariantMap crsToJson(const QgsCoordinateReferenceSystem &crs)
Converts a crs to an ArcGIS REST JSON representation.
static std::unique_ptr< QgsAbstractVectorLayerLabeling > convertLabeling(const QVariantList &data)
Converts labeling JSON data to an equivalent QGIS vector labeling.
QFlags< FeatureToJsonFlag > FeatureToJsonFlags
Flags which control the behavior of converting features to JSON.
static Qgis::DataType dataTypeFromString(const QString &pixelType)
Returns the raster data type corresponding to an ESRI pixelType string.
static std::unique_ptr< QgsSymbol > convertSymbol(const QVariantMap &definition, QgsSymbolConverterContext &context)
Converts a symbol JSON definition to a QgsSymbol.
static QColor convertColor(const QVariant &data)
Converts ESRI JSON color data to a QColor object.
static QgsRectangle convertRectangle(const QVariant &value)
Converts a rectangle value to a QgsRectangle.
Circular string geometry type.
Compound curve geometry type.
Represents a coordinate reference system (CRS).
Curve polygon geometry type.
Abstract base class for curved geometry type.
Abstract base class for all 2D vector feature renderers.
The feature class encapsulates a single feature including its unique ID, geometry and a list of field...
Base class for feedback objects to be used for cancellation of something running in a worker thread.
Encapsulate a field in an attribute table or data source.
A fill symbol type, for rendering Polygon and MultiPolygon geometries.
A geometry is the spatial representation of a feature.
Line string geometry type, with support for z-dimension and m-values.
A line symbol type, for rendering LineString and MultiLineString geometries.
A marker symbol type, for rendering Point and MultiPoint geometries.
Multi curve geometry collection.
Multi line string geometry collection.
Multi point geometry collection.
Multi polygon geometry collection.
Multi surface geometry collection.
QNetworkAccessManager with additional QGIS specific logic.
Point geometry type, with support for z-dimension and m-values.
A rectangle specified with double values.
Represents the context in which a QgsSymbolConverter conversion occurs.
Abstract base class for all rendered symbols.
#define SIP_ENUM_BASETYPE(type)
Struct representing whether the theoretical limits of a pixel type are useful for describing actual d...
bool maxIsUseful
true if the theoretical maximum value is a useful data boundary (e.g., 255 for U8)
bool minIsUseful
true if the theoretical minimum value is a useful data boundary (e.g., 0 for unsigned types)