QGIS API Documentation
3.26.3-Buenos Aires (65e4edfdad)
|
Go to the documentation of this file.
22 QString QgsPointToLayerAlgorithm::name()
const
24 return QStringLiteral(
"pointtolayer" );
27 void QgsPointToLayerAlgorithm::initAlgorithm(
const QVariantMap & )
33 QString QgsPointToLayerAlgorithm::shortHelpString()
const
35 return QObject::tr(
"This algorithm creates a new vector layer that contains a single feature with geometry matching a point parameter.\n\n"
36 "It can be used in models to convert a point into a layer which can be used for other algorithms which require "
37 "a layer based input." );
40 QgsPointToLayerAlgorithm *QgsPointToLayerAlgorithm::createInstance()
const
42 return new QgsPointToLayerAlgorithm();
51 fields.
append(
QgsField( QStringLiteral(
"id" ), QVariant::Int ) );
54 std::unique_ptr< QgsFeatureSink > sink( parameterAsSink( parameters, QStringLiteral(
"OUTPUT" ), context, dest, fields,
QgsWkbTypes::Point,
crs ) );
67 outputs.insert( QStringLiteral(
"OUTPUT" ), dest );
void setProgress(double progress)
Sets the current progress for the feedback object.
Base class for providing feedback from a processing algorithm.
const QgsCoordinateReferenceSystem & crs
Container of fields for a vector layer.
static QgsGeometry fromPointXY(const QgsPointXY &point) SIP_HOLDGIL
Creates a new geometry from a QgsPointXY object.
bool append(const QgsField &field, FieldOrigin origin=OriginProvider, int originIndex=-1)
Appends a field. The field must have unique name, otherwise it is rejected (returns false)
@ TypeVectorPoint
Vector point layers.
A feature sink output for processing algorithms.
void setGeometry(const QgsGeometry &geometry)
Set the feature's geometry.
Contains information about the context in which a processing algorithm is executed.
This class represents a coordinate reference system (CRS).
A point parameter for processing algorithms.
A geometry is the spatial representation of a feature.
A vector of attributes. Mostly equal to QVector<QVariant>.
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.
Custom exception class for processing related exceptions.
@ FastInsert
Use faster inserts, at the cost of updating the passed features to reflect changes made at the provid...
Encapsulate a field in an attribute table or data source.