QGIS API Documentation 3.99.0-Master (26c88405ac0)
Loading...
Searching...
No Matches
qgsalgorithmdropgeometry.cpp
Go to the documentation of this file.
1/***************************************************************************
2 qgsalgorithmdropgeometry.cpp
3 ---------------------
4 begin : April 2017
5 copyright : (C) 2017 by Nyall Dawson
6 email : nyall dot dawson at gmail dot com
7 ***************************************************************************/
8
9/***************************************************************************
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 ***************************************************************************/
17
19
20#include "qgsvectorlayer.h"
21
23
24QString QgsDropGeometryAlgorithm::name() const
25{
26 return QStringLiteral( "dropgeometries" );
27}
28
29QString QgsDropGeometryAlgorithm::displayName() const
30{
31 return QObject::tr( "Drop geometries" );
32}
33
34QStringList QgsDropGeometryAlgorithm::tags() const
35{
36 return QObject::tr( "remove,drop,delete,geometry,objects" ).split( ',' );
37}
38
39QString QgsDropGeometryAlgorithm::group() const
40{
41 return QObject::tr( "Vector general" );
42}
43
44QString QgsDropGeometryAlgorithm::groupId() const
45{
46 return QStringLiteral( "vectorgeneral" );
47}
48
49QString QgsDropGeometryAlgorithm::outputName() const
50{
51 return QObject::tr( "Dropped geometries" );
52}
53
54QString QgsDropGeometryAlgorithm::shortHelpString() const
55{
56 return QObject::tr( "This algorithm removes any geometries from an input layer and returns a layer containing only the feature attributes." );
57}
58
59QString QgsDropGeometryAlgorithm::shortDescription() const
60{
61 return QObject::tr( "Removes any geometries from an input layer and returns a layer containing only the feature attributes." );
62}
63
64QgsDropGeometryAlgorithm *QgsDropGeometryAlgorithm::createInstance() const
65{
66 return new QgsDropGeometryAlgorithm();
67}
68
69QgsCoordinateReferenceSystem QgsDropGeometryAlgorithm::outputCrs( const QgsCoordinateReferenceSystem & ) const
70{
72}
73
74bool QgsDropGeometryAlgorithm::supportInPlaceEdit( const QgsMapLayer *l ) const
75{
76 return qobject_cast<const QgsVectorLayer *>( l );
77}
78
79Qgis::WkbType QgsDropGeometryAlgorithm::outputWkbType( Qgis::WkbType ) const
80{
82}
83
84Qgis::ProcessingFeatureSourceFlags QgsDropGeometryAlgorithm::sourceFlags() const
85{
87}
88
89QgsFeatureRequest QgsDropGeometryAlgorithm::request() const
90{
92}
93
94QgsFeatureList QgsDropGeometryAlgorithm::processFeature( const QgsFeature &feature, QgsProcessingContext &, QgsProcessingFeedback * )
95{
96 QgsFeature f = feature;
97 f.clearGeometry();
98 return QgsFeatureList() << f;
99}
100
@ NoGeometry
Geometry is not required. It may still be returned if e.g. required for a filter condition.
Definition qgis.h:2196
@ SkipGeometryValidityChecks
Invalid geometry checks should always be skipped. This flag can be useful for algorithms which always...
Definition qgis.h:3711
WkbType
The WKB type describes the number of dimensions a geometry has.
Definition qgis.h:277
@ NoGeometry
No geometry.
Definition qgis.h:294
QFlags< ProcessingFeatureSourceFlag > ProcessingFeatureSourceFlags
Flags which control how QgsProcessingFeatureSource fetches features.
Definition qgis.h:3722
Represents a coordinate reference system (CRS).
Wraps a request for features to a vector layer (or directly its vector data provider).
QgsFeatureRequest & setFlags(Qgis::FeatureRequestFlags flags)
Sets flags that affect how features will be fetched.
The feature class encapsulates a single feature including its unique ID, geometry and a list of field...
Definition qgsfeature.h:58
void clearGeometry()
Removes any geometry associated with the feature.
Base class for all map layer types.
Definition qgsmaplayer.h:80
Contains information about the context in which a processing algorithm is executed.
Base class for providing feedback from a processing algorithm.
QList< QgsFeature > QgsFeatureList