25QString QgsWedgeBuffersAlgorithm::name()
const
27 return QStringLiteral(
"wedgebuffers" );
30QString QgsWedgeBuffersAlgorithm::displayName()
const
32 return QObject::tr(
"Create wedge buffers" );
35QStringList QgsWedgeBuffersAlgorithm::tags()
const
37 return QObject::tr(
"arc,segment,circular,circle,slice" ).split(
',' );
40QString QgsWedgeBuffersAlgorithm::group()
const
42 return QObject::tr(
"Vector geometry" );
45QString QgsWedgeBuffersAlgorithm::groupId()
const
47 return QStringLiteral(
"vectorgeometry" );
50QString QgsWedgeBuffersAlgorithm::outputName()
const
52 return QObject::tr(
"Buffers" );
67QString QgsWedgeBuffersAlgorithm::shortHelpString()
const
69 return QObject::tr(
"This algorithm creates wedge shaped buffers from input points.\n\n"
70 "The azimuth parameter gives the angle (in degrees) for the middle of the wedge to point. "
71 "The buffer width (in degrees) is specified by the width parameter. Note that the "
72 "wedge will extend to half of the angular width either side of the azimuth direction.\n\n"
73 "The outer radius of the buffer is specified via outer radius, and optionally an "
74 "inner radius can also be specified.\n\n"
75 "The native output from this algorithm are CurvePolygon geometries, but these may "
76 "be automatically segmentized to Polygons depending on the output format." );
79QString QgsWedgeBuffersAlgorithm::shortDescription()
const
81 return QObject::tr(
"Creates wedge shaped buffers from input points." );
84QList<int> QgsWedgeBuffersAlgorithm::inputLayerTypes()
const
94QgsWedgeBuffersAlgorithm *QgsWedgeBuffersAlgorithm::createInstance()
const
96 return new QgsWedgeBuffersAlgorithm();
99void QgsWedgeBuffersAlgorithm::initParameters(
const QVariantMap & )
102 azimuth->setIsDynamic(
true );
104 azimuth->setDynamicLayerParameterName( QStringLiteral(
"INPUT" ) );
105 addParameter( azimuth.release() );
108 width->setIsDynamic(
true );
110 width->setDynamicLayerParameterName( QStringLiteral(
"INPUT" ) );
111 addParameter( width.release() );
114 outerRadius->setIsDynamic(
true );
116 outerRadius->setDynamicLayerParameterName( QStringLiteral(
"INPUT" ) );
117 addParameter( outerRadius.release() );
120 innerRadius->setIsDynamic(
true );
122 innerRadius->setDynamicLayerParameterName( QStringLiteral(
"INPUT" ) );
123 addParameter( innerRadius.release() );
133 mAzimuth = parameterAsDouble( parameters, QStringLiteral(
"AZIMUTH" ), context );
135 if ( mDynamicAzimuth )
136 mAzimuthProperty = parameters.value( QStringLiteral(
"AZIMUTH" ) ).value<
QgsProperty>();
138 mWidth = parameterAsDouble( parameters, QStringLiteral(
"WIDTH" ), context );
141 mWidthProperty = parameters.value( QStringLiteral(
"WIDTH" ) ).value<
QgsProperty>();
143 mOuterRadius = parameterAsDouble( parameters, QStringLiteral(
"OUTER_RADIUS" ), context );
145 if ( mDynamicOuterRadius )
146 mOuterRadiusProperty = parameters.value( QStringLiteral(
"OUTER_RADIUS" ) ).value<
QgsProperty>();
148 mInnerRadius = parameterAsDouble( parameters, QStringLiteral(
"INNER_RADIUS" ), context );
150 if ( mDynamicInnerRadius )
151 mInnerRadiusProperty = parameters.value( QStringLiteral(
"INNER_RADIUS" ) ).value<
QgsProperty>();
161 double azimuth = mAzimuth;
162 if ( mDynamicAzimuth )
163 azimuth = mAzimuthProperty.valueAsDouble( context.
expressionContext(), azimuth );
165 double width = mWidth;
169 double outerRadius = mOuterRadius;
170 if ( mDynamicOuterRadius )
173 double innerRadius = mInnerRadius;
174 if ( mDynamicInnerRadius )
181 auto result = std::make_unique<QgsMultiSurface>();
ProcessingSourceType
Processing data source types.
@ VectorPoint
Vector point layers.
@ VectorPolygon
Vector polygon layers.
@ SkipGeometryValidityChecks
Invalid geometry checks should always be skipped. This flag can be useful for algorithms which always...
WkbType
The WKB type describes the number of dimensions a geometry has.
@ CurvePolygon
CurvePolygon.
QFlags< ProcessingFeatureSourceFlag > ProcessingFeatureSourceFlags
Flags which control how QgsProcessingFeatureSource fetches features.
@ Double
Double/float values.
The feature class encapsulates a single feature including its unique ID, geometry and a list of field...
bool hasGeometry() const
Returns true if the feature has an associated geometry.
void setGeometry(const QgsGeometry &geometry)
Set the feature's geometry.
int numGeometries() const
Returns the number of geometries within the collection.
A geometry is the spatial representation of a feature.
const QgsAbstractGeometry * constGet() const
Returns a non-modifiable (const) reference to the underlying abstract geometry primitive.
static QgsGeometry createWedgeBuffer(const QgsPoint ¢er, double azimuth, double angularWidth, double outerRadius, double innerRadius=0)
Creates a wedge shaped buffer from a center point.
Qgis::WkbType wkbType() const
Returns type of the geometry as a WKB type (point / linestring / polygon etc.).
Multi point geometry collection.
QgsPoint * pointN(int index)
Returns the point with the specified index.
Point geometry type, with support for z-dimension and m-values.
Contains information about the context in which a processing algorithm is executed.
QgsExpressionContext & expressionContext()
Returns the expression context.
Base class for providing feedback from a processing algorithm.
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...
Definition for a property.
@ Double
Double value (including negative values).
@ DoublePositive
Positive double value (including 0).
A store for object properties.
double valueAsDouble(const QgsExpressionContext &context, double defaultValue=0.0, bool *ok=nullptr) const
Calculates the current value of the property and interprets it as a double.
static Qgis::GeometryType geometryType(Qgis::WkbType type)
Returns the geometry type for a WKB type, e.g., both MultiPolygon and CurvePolygon would have a Polyg...
static Qgis::WkbType addM(Qgis::WkbType type)
Adds the m dimension to a WKB type and returns the new type.
static Qgis::WkbType addZ(Qgis::WkbType type)
Adds the z dimension to a WKB type and returns the new type.
static Q_INVOKABLE bool hasZ(Qgis::WkbType type)
Tests whether a WKB type contains the z-dimension.
static Q_INVOKABLE bool hasM(Qgis::WkbType type)
Tests whether a WKB type contains m values.
static Qgis::WkbType multiType(Qgis::WkbType type)
Returns the multi type for a WKB type.
static Q_INVOKABLE bool isMultiType(Qgis::WkbType type)
Returns true if the WKB type is a multi type.
QList< QgsFeature > QgsFeatureList