23 QString QgsSetZValueAlgorithm::name()
const 25 return QStringLiteral(
"setzvalue" );
28 QString QgsSetZValueAlgorithm::displayName()
const 30 return QObject::tr(
"Set Z value" );
33 QStringList QgsSetZValueAlgorithm::tags()
const 35 return QObject::tr(
"set,add,z,25d,3d,values" ).split(
',' );
38 QString QgsSetZValueAlgorithm::group()
const 40 return QObject::tr(
"Vector geometry" );
43 QString QgsSetZValueAlgorithm::groupId()
const 45 return QStringLiteral(
"vectorgeometry" );
48 QString QgsSetZValueAlgorithm::shortHelpString()
const 50 return QObject::tr(
"This algorithm sets the Z value for geometries in a layer.\n\n" 51 "If Z values already exist in the layer, they will be overwritten " 52 "with the new value. If no Z values exist, the geometry will be " 53 "upgraded to include Z values and the specified value used as " 54 "the initial Z value for all geometries." );
57 QString QgsSetZValueAlgorithm::outputName()
const 59 return QObject::tr(
"Z Added" );
62 QgsSetZValueAlgorithm *QgsSetZValueAlgorithm::createInstance()
const 64 return new QgsSetZValueAlgorithm();
67 bool QgsSetZValueAlgorithm::supportInPlaceEdit(
const QgsMapLayer *l )
const 86 void QgsSetZValueAlgorithm::initParameters(
const QVariantMap & )
89 zValueParam->setIsDynamic(
true );
91 zValueParam->setDynamicLayerParameterName( QStringLiteral(
"INPUT" ) );
92 addParameter( zValueParam.release() );
97 mZValue = parameterAsDouble( parameters, QStringLiteral(
"Z_VALUE" ), context );
100 mZValueProperty = parameters.value( QStringLiteral(
"Z_VALUE" ) ).value<
QgsProperty >();
114 newGeometry->dropZValue();
117 if ( mDynamicZValue )
120 newGeometry->addZValue( z );
Base class for all map layer types.
Base class for providing feedback from a processing algorithm.
Invalid geometry checks should always be skipped. This flag can be useful for algorithms which always...
Q_INVOKABLE QgsWkbTypes::Type wkbType() const FINAL
Returns the WKBType or WKBUnknown in case of error.
QList< QgsFeature > QgsFeatureList
A geometry is the spatial representation of a feature.
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
bool hasGeometry() const
Returns true if the feature has an associated geometry.
virtual QgsAbstractGeometry * clone() const =0
Clones the geometry by performing a deep copy.
static bool hasZ(Type type)
Tests whether a WKB type contains the z-dimension.
Type
The WKB type describes the number of dimensions a geometry has.
static Type addZ(Type type)
Adds the z dimension to a WKB type and returns the new type.
A store for object properties.
Double value (including negative values)
QgsExpressionContext & expressionContext()
Returns the expression context.
Definition for a property.
Flag
Flags controlling how QgsProcessingFeatureSource fetches features.
const QgsAbstractGeometry * constGet() const
Returns a non-modifiable (const) reference to the underlying abstract geometry primitive.
void setGeometry(const QgsGeometry &geometry)
Set the feature's geometry.
bool supportInPlaceEdit(const QgsMapLayer *layer) const override
Checks whether this algorithm supports in-place editing on the given layer Default implementation for...
Represents a vector layer which manages a vector based data sets.
Contains information about the context in which a processing algorithm is executed.
static bool isDynamic(const QVariantMap ¶meters, const QString &name)
Returns true if the parameter with matching name is a dynamic parameter, and must be evaluated once f...