QGIS API Documentation  3.8.0-Zanzibar (11aff65)
qgsnativealgorithms.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  qgsnativealgorithms.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 
18 #include "qgsnativealgorithms.h"
23 #include "qgsalgorithmboundary.h"
25 #include "qgsalgorithmbuffer.h"
28 #include "qgsalgorithmcentroid.h"
29 #include "qgsalgorithmclip.h"
30 #include "qgsalgorithmconvexhull.h"
33 #include "qgsalgorithmdifference.h"
34 #include "qgsalgorithmdissolve.h"
35 #include "qgsalgorithmdrape.h"
38 #include "qgsalgorithmexplode.h"
51 #include "qgsalgorithmfilter.h"
54 #include "qgsalgorithmforcerhr.h"
64 #include "qgsalgorithmloadlayer.h"
66 #include "qgsalgorithmmergelines.h"
74 #include "qgsalgorithmpackage.h"
91 #include "qgsalgorithmrotate.h"
93 #include "qgsalgorithmsegmentize.h"
97 #include "qgsalgorithmsimplify.h"
98 #include "qgsalgorithmsmooth.h"
99 #include "qgsalgorithmsnaptogrid.h"
104 #include "qgsalgorithmsubdivide.h"
105 #include "qgsalgorithmswapxy.h"
108 #include "qgsalgorithmtransect.h"
109 #include "qgsalgorithmtransform.h"
110 #include "qgsalgorithmtranslate.h"
111 #include "qgsalgorithmunion.h"
113 #include "qgsalgorithmvectorize.h"
117 
119 
121  : QgsProcessingProvider( parent )
122 {}
123 
124 QIcon QgsNativeAlgorithms::icon() const
125 {
126  return QgsApplication::getThemeIcon( QStringLiteral( "/providerQgis.svg" ) );
127 }
128 
129 QString QgsNativeAlgorithms::svgIconPath() const
130 {
131  return QgsApplication::iconPath( QStringLiteral( "providerQgis.svg" ) );
132 }
133 
134 QString QgsNativeAlgorithms::id() const
135 {
136  return QStringLiteral( "native" );
137 }
138 
139 QString QgsNativeAlgorithms::helpId() const
140 {
141  return QStringLiteral( "qgis" );
142 }
143 
144 QString QgsNativeAlgorithms::name() const
145 {
146  return tr( "QGIS (native c++)" );
147 }
148 
150 {
151  return true;
152 }
153 
155 {
156  addAlgorithm( new QgsAddIncrementalFieldAlgorithm() );
157  addAlgorithm( new QgsAddXYFieldsAlgorithm() );
158  addAlgorithm( new QgsAddUniqueValueIndexAlgorithm() );
159  addAlgorithm( new QgsArrayTranslatedFeaturesAlgorithm() );
160  addAlgorithm( new QgsAssignProjectionAlgorithm() );
161  addAlgorithm( new QgsBoundaryAlgorithm() );
162  addAlgorithm( new QgsBoundingBoxAlgorithm() );
163  addAlgorithm( new QgsBufferAlgorithm() );
164  addAlgorithm( new QgsCalculateVectorOverlapsAlgorithm() );
165  addAlgorithm( new QgsCategorizeUsingStyleAlgorithm() );
166  addAlgorithm( new QgsCentroidAlgorithm() );
167  addAlgorithm( new QgsClipAlgorithm() );
168  addAlgorithm( new QgsCollectAlgorithm() );
169  addAlgorithm( new QgsConvexHullAlgorithm() );
170  addAlgorithm( new QgsDbscanClusteringAlgorithm() );
171  addAlgorithm( new QgsDifferenceAlgorithm() );
172  addAlgorithm( new QgsDissolveAlgorithm() );
173  addAlgorithm( new QgsDrapeToMAlgorithm() );
174  addAlgorithm( new QgsDrapeToZAlgorithm() );
175  addAlgorithm( new QgsDropGeometryAlgorithm() );
176  addAlgorithm( new QgsDropMZValuesAlgorithm() );
177  addAlgorithm( new QgsExplodeAlgorithm() );
178  addAlgorithm( new QgsExplodeHstoreAlgorithm() );
179  addAlgorithm( new QgsExtendLinesAlgorithm() );
180  addAlgorithm( new QgsExtentToLayerAlgorithm() );
181  addAlgorithm( new QgsExtractBinaryFieldAlgorithm() );
182  addAlgorithm( new QgsExtractByAttributeAlgorithm() );
183  addAlgorithm( new QgsExtractByExpressionAlgorithm() );
184  addAlgorithm( new QgsExtractByExtentAlgorithm() );
185  addAlgorithm( new QgsExtractByLocationAlgorithm() );
186  addAlgorithm( new QgsExtractMValuesAlgorithm() );
187  addAlgorithm( new QgsExtractVerticesAlgorithm() );
188  addAlgorithm( new QgsExtractZValuesAlgorithm() );
189  addAlgorithm( new QgsFileDownloaderAlgorithm() );
190  addAlgorithm( new QgsFilterAlgorithm() );
191  addAlgorithm( new QgsFilterVerticesByM() );
192  addAlgorithm( new QgsFilterVerticesByZ() );
193  addAlgorithm( new QgsFixGeometriesAlgorithm() );
194  addAlgorithm( new QgsForceRHRAlgorithm() );
195  addAlgorithm( new QgsImportPhotosAlgorithm() );
196  addAlgorithm( new QgsInterpolatePointAlgorithm() );
197  addAlgorithm( new QgsIntersectionAlgorithm() );
198  addAlgorithm( new QgsJoinByAttributeAlgorithm() );
199  addAlgorithm( new QgsJoinByNearestAlgorithm() );
200  addAlgorithm( new QgsJoinWithLinesAlgorithm() );
201  addAlgorithm( new QgsKMeansClusteringAlgorithm() );
202  addAlgorithm( new QgsLayoutMapExtentToLayerAlgorithm() );
203  addAlgorithm( new QgsLineIntersectionAlgorithm() );
204  addAlgorithm( new QgsLineSubstringAlgorithm() );
205  addAlgorithm( new QgsLoadLayerAlgorithm() );
206  addAlgorithm( new QgsMeanCoordinatesAlgorithm() );
207  addAlgorithm( new QgsMergeLinesAlgorithm() );
208  addAlgorithm( new QgsMergeVectorAlgorithm() );
209  addAlgorithm( new QgsMinimumEnclosingCircleAlgorithm() );
210  addAlgorithm( new QgsMultipartToSinglepartAlgorithm() );
211  addAlgorithm( new QgsMultiRingConstantBufferAlgorithm() );
212  addAlgorithm( new QgsOffsetLinesAlgorithm() );
213  addAlgorithm( new QgsOrderByExpressionAlgorithm() );
214  addAlgorithm( new QgsOrientedMinimumBoundingBoxAlgorithm() );
215  addAlgorithm( new QgsPackageAlgorithm() );
216  addAlgorithm( new QgsCreateArrayOffsetLinesAlgorithm() );
217  addAlgorithm( new QgsPointOnSurfaceAlgorithm() );
218  addAlgorithm( new QgsPointsAlongGeometryAlgorithm() );
219  addAlgorithm( new QgsProjectPointCartesianAlgorithm() );
220  addAlgorithm( new QgsPromoteToMultipartAlgorithm() );
221  addAlgorithm( new QgsRasterLayerUniqueValuesReportAlgorithm() );
222  addAlgorithm( new QgsRasterLayerZonalStatsAlgorithm() );
223  addAlgorithm( new QgsRasterLogicalAndAlgorithm() );
224  addAlgorithm( new QgsRasterLogicalOrAlgorithm() );
225  addAlgorithm( new QgsRasterPixelsToPointsAlgorithm() );
226  addAlgorithm( new QgsRasterPixelsToPolygonsAlgorithm() );
227  addAlgorithm( new QgsRasterSurfaceVolumeAlgorithm() );
228  addAlgorithm( new QgsAlgorithmRemoveDuplicateVertices() );
229  addAlgorithm( new QgsReclassifyByLayerAlgorithm() );
230  addAlgorithm( new QgsReclassifyByTableAlgorithm() );
231  addAlgorithm( new QgsRemoveDuplicatesByAttributeAlgorithm() );
232  addAlgorithm( new QgsRemoveHolesAlgorithm() );
233  addAlgorithm( new QgsRemoveNullGeometryAlgorithm() );
234  addAlgorithm( new QgsRenameLayerAlgorithm() );
235  addAlgorithm( new QgsReverseLineDirectionAlgorithm() );
236  addAlgorithm( new QgsRotateFeaturesAlgorithm() );
237  addAlgorithm( new QgsSaveSelectedFeatures() );
238  addAlgorithm( new QgsSegmentizeByMaximumAngleAlgorithm() );
239  addAlgorithm( new QgsSegmentizeByMaximumDistanceAlgorithm() );
240  addAlgorithm( new QgsSelectByLocationAlgorithm() );
241  addAlgorithm( new QgsShortestPathLayerToPointAlgorithm() );
242  addAlgorithm( new QgsShortestPathPointToLayerAlgorithm() );
243  addAlgorithm( new QgsShortestPathPointToPointAlgorithm() );
244  addAlgorithm( new QgsSimplifyAlgorithm() );
245  addAlgorithm( new QgsSmoothAlgorithm() );
246  addAlgorithm( new QgsSnapToGridAlgorithm() );
247  addAlgorithm( new QgsSplitGeometryAtAntimeridianAlgorithm() );
248  addAlgorithm( new QgsSplitLinesByLengthAlgorithm() );
249  addAlgorithm( new QgsSplitWithLinesAlgorithm() );
250  addAlgorithm( new QgsStringConcatenationAlgorithm() );
251  addAlgorithm( new QgsSubdivideAlgorithm() );
252  addAlgorithm( new QgsSwapXYAlgorithm() );
253  addAlgorithm( new QgsSymmetricalDifferenceAlgorithm() );
254  addAlgorithm( new QgsTaperedBufferAlgorithm() );
255  addAlgorithm( new QgsTransectAlgorithm() );
256  addAlgorithm( new QgsTransformAlgorithm() );
257  addAlgorithm( new QgsTranslateAlgorithm() );
258  addAlgorithm( new QgsUnionAlgorithm() );
259  addAlgorithm( new QgsVariableWidthBufferByMAlgorithm() );
260  addAlgorithm( new QgsWedgeBuffersAlgorithm() );
261  addAlgorithm( new QgsZonalHistogramAlgorithm() );
262  addAlgorithm( new QgsPolygonsToLinesAlgorithm() );
263  addAlgorithm( new QgsDensifyGeometriesByIntervalAlgorithm() );
264 }
265 
266 
268 
269 
270 
QIcon icon() const override
Returns an icon for the provider.
QString id() const override
Returns the unique provider id, used for identifying the provider.
static QString iconPath(const QString &iconFile)
Returns path to the desired icon file.
static QIcon getThemeIcon(const QString &name)
Helper to get a theme icon.
Abstract base class for processing providers.
QString helpId() const override
Returns the provider help id string, used for creating QgsHelp urls for algorithms belong to this pro...
void loadAlgorithms() override
Loads all algorithms belonging to this provider.
bool supportsNonFileBasedOutput() const override
Returns true if the provider supports non-file based outputs (such as memory layers or direct databas...
QString name() const override
Returns the provider name, which is used to describe the provider within the GUI. ...
bool addAlgorithm(QgsProcessingAlgorithm *algorithm)
Adds an algorithm to the provider.
QString svgIconPath() const override
Returns a path to an SVG version of the provider's icon.
QgsNativeAlgorithms(QObject *parent=nullptr)
Constructor for QgsNativeAlgorithms.