22using namespace Qt::StringLiterals;
26QString QgsPointToLayerAlgorithm::name()
const
28 return u
"pointtolayer"_s;
31void QgsPointToLayerAlgorithm::initAlgorithm(
const QVariantMap & )
37QString QgsPointToLayerAlgorithm::shortHelpString()
const
39 return QObject::tr(
"This algorithm creates a new vector layer that contains a single feature with geometry matching a point parameter.\n\n"
40 "It can be used in models to convert a point into a layer which can be used for other algorithms which require "
41 "a layer based input." );
44QString QgsPointToLayerAlgorithm::shortDescription()
const
46 return QObject::tr(
"Creates a vector layer that contains a single feature with geometry matching a point parameter." );
49QgsPointToLayerAlgorithm *QgsPointToLayerAlgorithm::createInstance()
const
51 return new QgsPointToLayerAlgorithm();
63 std::unique_ptr<QgsFeatureSink> sink( parameterAsSink( parameters, u
"OUTPUT"_s, context, dest, fields,
Qgis::WkbType::Point, crs ) );
78 outputs.insert( u
"OUTPUT"_s, dest );
@ VectorPoint
Vector point layers.
Represents a coordinate reference system (CRS).
@ FastInsert
Use faster inserts, at the cost of updating the passed features to reflect changes made at the provid...
The feature class encapsulates a single feature including its unique ID, geometry and a list of field...
void setAttributes(const QgsAttributes &attrs)
Sets the feature's attributes.
void setGeometry(const QgsGeometry &geometry)
Set the feature's geometry.
void setProgress(double progress)
Sets the current progress for the feedback object.
Encapsulate a field in an attribute table or data source.
Container of fields for a vector layer.
bool append(const QgsField &field, Qgis::FieldOrigin origin=Qgis::FieldOrigin::Provider, int originIndex=-1)
Appends a field.
A geometry is the spatial representation of a feature.
static QgsGeometry fromPointXY(const QgsPointXY &point)
Creates a new geometry from a QgsPointXY object.
Contains information about the context in which a processing algorithm is executed.
Custom exception class for processing related exceptions.
Base class for providing feedback from a processing algorithm.
A feature sink output for processing algorithms.
A point parameter for processing algorithms.