16 #ifndef QGSJSONUTILS_H 17 #define QGSJSONUTILS_H 19 #include "qgis_core.h" 98 void setIncludeRelated(
bool includeRelated ) { mIncludeRelatedAttributes = includeRelated; }
183 QString exportFeature(
const QgsFeature &feature,
184 const QVariantMap &extraProperties = QVariantMap(),
185 const QVariant &
id = QVariant() )
const;
211 bool mIncludeGeometry =
true;
214 bool mIncludeAttributes =
true;
217 bool mIncludeRelatedAttributes =
false;
220 QPointer< QgsVectorLayer > mLayer;
248 static QgsFeatureList stringToFeatureList(
const QString &
string,
const QgsFields &fields, QTextCodec *encoding );
258 static QgsFields stringToFields(
const QString &
string, QTextCodec *encoding );
266 static QString encodeValue(
const QVariant &value );
277 const QVector<QVariant> &attributeWidgetCaches = QVector<QVariant>() );
285 static QVariantList parseArray(
const QString &json, QVariant::Type type );
288 #endif // QGSJSONUTILS_H
void setIncludeAttributes(bool includeAttributes)
Sets whether to include attributes in the JSON exports.
QList< QgsFeature > QgsFeatureList
void setIncludeGeometry(bool includeGeometry)
Sets whether to include geometry in the JSON exports.
Helper utilities for working with JSON and GeoJSON conversions.
Container of fields for a vector layer.
QgsAttributeList attributes() const
Returns the list of attributes which will be included in the JSON exports, or an empty list if all at...
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
const QgsCoordinateReferenceSystem & crs
void setAttributes(const QgsAttributeList &attributes)
Sets the list of attributes to include in the JSON exports.
bool includeGeometry() const
Returns whether geometry will be included in the JSON exports.
void setExcludedAttributes(const QgsAttributeList &attributes)
Sets a list of attributes to specifically exclude from the JSON exports.
void setIncludeRelated(bool includeRelated)
Sets whether to include attributes of features linked via references in the JSON exports.
bool includeRelated() const
Returns whether attributes of related (child) features will be included in the JSON exports...
Handles exporting QgsFeature features to GeoJSON features.
QgsAttributeList excludedAttributes() const
Returns a list of attributes which will be specifically excluded from the JSON exports.
bool includeAttributes() const
Returns whether attributes will be included in the JSON exports.
This class represents a coordinate reference system (CRS).
QList< int > QgsAttributeList
void setPrecision(int precision)
Sets the maximum number of decimal places to use in geometry coordinates.
Represents a vector layer which manages a vector based data sets.
int precision() const
Returns the maximum number of decimal places to use in geometry coordinates.