24QString QgsInterpolatePointAlgorithm::name()
const
26 return QStringLiteral(
"interpolatepoint" );
29QString QgsInterpolatePointAlgorithm::displayName()
const
31 return QObject::tr(
"Interpolate point on line" );
34QStringList QgsInterpolatePointAlgorithm::tags()
const
36 return QObject::tr(
"linestring,reference,referencing,distance,interpolate" ).split(
',' );
39QString QgsInterpolatePointAlgorithm::group()
const
41 return QObject::tr(
"Vector geometry" );
44QString QgsInterpolatePointAlgorithm::groupId()
const
46 return QStringLiteral(
"vectorgeometry" );
49QString QgsInterpolatePointAlgorithm::outputName()
const
51 return QObject::tr(
"Interpolated points" );
54QString QgsInterpolatePointAlgorithm::shortHelpString()
const
56 return QObject::tr(
"This algorithm creates a point geometry interpolated at a set distance along line or curve geometries.\n\n"
57 "Z and M values are linearly interpolated from existing values.\n\n"
58 "If a multipart geometry is encountered, only the first part is considered when "
59 "interpolating the point.\n\n"
60 "If the specified distance is greater than the curve's length, the resultant feature will have a null geometry." );
63QString QgsInterpolatePointAlgorithm::shortDescription()
const
65 return QObject::tr(
"Interpolates a point along lines at a set distance." );
68QList<int> QgsInterpolatePointAlgorithm::inputLayerTypes()
const
88QgsInterpolatePointAlgorithm *QgsInterpolatePointAlgorithm::createInstance()
const
90 return new QgsInterpolatePointAlgorithm();
93void QgsInterpolatePointAlgorithm::initParameters(
const QVariantMap & )
95 std::unique_ptr<QgsProcessingParameterDistance> distance = std::make_unique<QgsProcessingParameterDistance>( QStringLiteral(
"DISTANCE" ), QObject::tr(
"Distance" ), 0.0, QStringLiteral(
"INPUT" ),
false, 0 );
96 distance->setIsDynamic(
true );
98 distance->setDynamicLayerParameterName( QStringLiteral(
"INPUT" ) );
99 addParameter( distance.release() );
110 mDistance = parameterAsDouble( parameters, QStringLiteral(
"DISTANCE" ), context );
112 if ( mDynamicDistance )
113 mDistanceProperty = parameters.value( QStringLiteral(
"DISTANCE" ) ).value<
QgsProperty>();
124 double distance = mDistance;
125 if ( mDynamicDistance )
126 distance = mDistanceProperty.valueAsDouble( context.
expressionContext(), distance );
ProcessingSourceType
Processing data source types.
@ VectorPoint
Vector point layers.
@ VectorPolygon
Vector polygon layers.
@ VectorLine
Vector line 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.
QFlags< ProcessingFeatureSourceFlag > ProcessingFeatureSourceFlags
Flags which control how QgsProcessingFeatureSource fetches features.
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.
A geometry is the spatial representation of a feature.
QgsGeometry interpolate(double distance) const
Returns an interpolated point on the geometry at the specified distance.
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.
@ DoublePositive
Positive double value (including 0)
A store for object properties.
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 bool hasZ(Qgis::WkbType type)
Tests whether a WKB type contains the z-dimension.
static bool hasM(Qgis::WkbType type)
Tests whether a WKB type contains m values.
QList< QgsFeature > QgsFeatureList