24 QString QgsInterpolatePointAlgorithm::name()
const
26 return QStringLiteral(
"interpolatepoint" );
29 QString QgsInterpolatePointAlgorithm::displayName()
const
31 return QObject::tr(
"Interpolate point on line" );
34 QStringList QgsInterpolatePointAlgorithm::tags()
const
36 return QObject::tr(
"linestring,reference,referencing,distance,interpolate" ).split(
',' );
39 QString QgsInterpolatePointAlgorithm::group()
const
41 return QObject::tr(
"Vector geometry" );
44 QString QgsInterpolatePointAlgorithm::groupId()
const
46 return QStringLiteral(
"vectorgeometry" );
49 QString QgsInterpolatePointAlgorithm::outputName()
const
51 return QObject::tr(
"Interpolated points" );
54 QString 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." );
63 QString QgsInterpolatePointAlgorithm::shortDescription()
const
65 return QObject::tr(
"Interpolates a point along lines at a set distance." );
68 QList<int> QgsInterpolatePointAlgorithm::inputLayerTypes()
const
88 QgsInterpolatePointAlgorithm *QgsInterpolatePointAlgorithm::createInstance()
const
90 return new QgsInterpolatePointAlgorithm();
93 void QgsInterpolatePointAlgorithm::initParameters(
const QVariantMap & )
95 std::unique_ptr< QgsProcessingParameterDistance> distance = qgis::make_unique< QgsProcessingParameterDistance >( QStringLiteral(
"DISTANCE" ),
96 QObject::tr(
"Distance" ), 0.0, QStringLiteral(
"INPUT" ),
false, 0 );
97 distance->setIsDynamic(
true );
99 distance->setDynamicLayerParameterName( QStringLiteral(
"INPUT" ) );
100 addParameter( distance.release() );
111 mDistance = parameterAsDouble( parameters, QStringLiteral(
"DISTANCE" ), context );
113 if ( mDynamicDistance )
114 mDistanceProperty = parameters.value( QStringLiteral(
"DISTANCE" ) ).value<
QgsProperty >();
125 double distance = mDistance;
126 if ( mDynamicDistance )
127 distance = mDistanceProperty.valueAsDouble( context.
expressionContext(), distance );