QGIS API Documentation  3.12.1-București (121cc00ff0)
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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"
25 #include "qgsalgorithmaspect.h"
28 #include "qgsalgorithmboundary.h"
30 #include "qgsalgorithmbuffer.h"
33 #include "qgsalgorithmcentroid.h"
34 #include "qgsalgorithmclip.h"
36 #include "qgsalgorithmconvexhull.h"
42 #include "qgsalgorithmdifference.h"
43 #include "qgsalgorithmdissolve.h"
44 #include "qgsalgorithmdrape.h"
47 #include "qgsalgorithmexplode.h"
62 #include "qgsalgorithmfilter.h"
65 #include "qgsalgorithmforcerhr.h"
68 #include "qgsalgorithmgrid.h"
69 #include "qgsalgorithmhillshade.h"
81 #include "qgsalgorithmloadlayer.h"
83 #include "qgsalgorithmmergelines.h"
93 #include "qgsalgorithmpackage.h"
108 #include "qgsalgorithmrasterize.h"
116 #include "qgsalgorithmremoveholes.h"
118 #include "qgsalgorithmrenamelayer.h"
122 #include "qgsalgorithmrotate.h"
123 #include "qgsalgorithmruggedness.h"
125 #include "qgsalgorithmsegmentize.h"
129 #include "qgsalgorithmsetmvalue.h"
130 #include "qgsalgorithmsetzvalue.h"
135 #include "qgsalgorithmsimplify.h"
137 #include "qgsalgorithmslope.h"
138 #include "qgsalgorithmsmooth.h"
139 #include "qgsalgorithmsnaptogrid.h"
146 #include "qgsalgorithmsubdivide.h"
148 #include "qgsalgorithmswapxy.h"
151 #include "qgsalgorithmtransect.h"
152 #include "qgsalgorithmtransform.h"
153 #include "qgsalgorithmtranslate.h"
155 #include "qgsalgorithmunion.h"
157 #include "qgsalgorithmvectorize.h"
162 #include "qgsbookmarkalgorithms.h"
164 #include "qgsstylealgorithms.h"
165 
167 
169  : QgsProcessingProvider( parent )
170 {}
171 
172 QIcon QgsNativeAlgorithms::icon() const
173 {
174  return QgsApplication::getThemeIcon( QStringLiteral( "/providerQgis.svg" ) );
175 }
176 
177 QString QgsNativeAlgorithms::svgIconPath() const
178 {
179  return QgsApplication::iconPath( QStringLiteral( "providerQgis.svg" ) );
180 }
181 
182 QString QgsNativeAlgorithms::id() const
183 {
184  return QStringLiteral( "native" );
185 }
186 
187 QString QgsNativeAlgorithms::helpId() const
188 {
189  return QStringLiteral( "qgis" );
190 }
191 
192 QString QgsNativeAlgorithms::name() const
193 {
194  return tr( "QGIS (native c++)" );
195 }
196 
198 {
199  return true;
200 }
201 
203 {
204  addAlgorithm( new QgsAddIncrementalFieldAlgorithm() );
205  addAlgorithm( new QgsAddTableFieldAlgorithm() );
206  addAlgorithm( new QgsAddXYFieldsAlgorithm() );
207  addAlgorithm( new QgsAddUniqueValueIndexAlgorithm() );
208  addAlgorithm( new QgsAffineTransformationAlgorithm() );
209  addAlgorithm( new QgsApplyLayerStyleAlgorithm() );
210  addAlgorithm( new QgsArrayTranslatedFeaturesAlgorithm() );
211  addAlgorithm( new QgsAspectAlgorithm() );
212  addAlgorithm( new QgsAssignProjectionAlgorithm() );
213  addAlgorithm( new QgsAttributeIndexAlgorithm() );
214  addAlgorithm( new QgsBookmarksToLayerAlgorithm() );
215  addAlgorithm( new QgsBoundaryAlgorithm() );
216  addAlgorithm( new QgsBoundingBoxAlgorithm() );
217  addAlgorithm( new QgsBufferAlgorithm() );
218  addAlgorithm( new QgsCalculateVectorOverlapsAlgorithm() );
219  addAlgorithm( new QgsCategorizeUsingStyleAlgorithm() );
220  addAlgorithm( new QgsCentroidAlgorithm() );
221  addAlgorithm( new QgsClipAlgorithm() );
222  addAlgorithm( new QgsCollectAlgorithm() );
223  addAlgorithm( new QgsCombineStylesAlgorithm() );
224  addAlgorithm( new QgsConstantRasterAlgorithm() );
225  addAlgorithm( new QgsConvexHullAlgorithm() );
226  addAlgorithm( new QgsDbscanClusteringAlgorithm() );
227  addAlgorithm( new QgsDeleteDuplicateGeometriesAlgorithm() );
228  addAlgorithm( new QgsDetectVectorChangesAlgorithm() );
229  addAlgorithm( new QgsDifferenceAlgorithm() );
230  addAlgorithm( new QgsDissolveAlgorithm() );
231  addAlgorithm( new QgsDrapeToMAlgorithm() );
232  addAlgorithm( new QgsDrapeToZAlgorithm() );
233  addAlgorithm( new QgsDropGeometryAlgorithm() );
234  addAlgorithm( new QgsDropMZValuesAlgorithm() );
235  addAlgorithm( new QgsExplodeAlgorithm() );
236  addAlgorithm( new QgsExplodeHstoreAlgorithm() );
237  addAlgorithm( new QgsExtendLinesAlgorithm() );
238  addAlgorithm( new QgsExtentFromLayerAlgorithm() );
239  addAlgorithm( new QgsExtentToLayerAlgorithm() );
240  addAlgorithm( new QgsExtractBinaryFieldAlgorithm() );
241  addAlgorithm( new QgsExtractByAttributeAlgorithm() );
242  addAlgorithm( new QgsExtractByExpressionAlgorithm() );
243  addAlgorithm( new QgsExtractByExtentAlgorithm() );
244  addAlgorithm( new QgsExtractByLocationAlgorithm() );
245  addAlgorithm( new QgsExtractMValuesAlgorithm() );
246  addAlgorithm( new QgsExtractVerticesAlgorithm() );
247  addAlgorithm( new QgsExtractSpecificVerticesAlgorithm() );
248  addAlgorithm( new QgsExtractZValuesAlgorithm() );
249  addAlgorithm( new QgsFileDownloaderAlgorithm() );
250  addAlgorithm( new QgsFilterAlgorithm() );
251  addAlgorithm( new QgsFilterVerticesByM() );
252  addAlgorithm( new QgsFilterVerticesByZ() );
253  addAlgorithm( new QgsFixGeometriesAlgorithm() );
254  addAlgorithm( new QgsForceRHRAlgorithm() );
255  addAlgorithm( new QgsFuzzifyRasterLinearMembershipAlgorithm() );
256  addAlgorithm( new QgsFuzzifyRasterPowerMembershipAlgorithm() );
257  addAlgorithm( new QgsFuzzifyRasterLargeMembershipAlgorithm() );
258  addAlgorithm( new QgsFuzzifyRasterSmallMembershipAlgorithm() );
259  addAlgorithm( new QgsFuzzifyRasterGaussianMembershipAlgorithm() );
260  addAlgorithm( new QgsFuzzifyRasterNearMembershipAlgorithm() );
261  addAlgorithm( new QgsGeometryByExpressionAlgorithm() );
262  addAlgorithm( new QgsGridAlgorithm() );
263  addAlgorithm( new QgsHillshadeAlgorithm() );
264  addAlgorithm( new QgsImportPhotosAlgorithm() );
265  addAlgorithm( new QgsInterpolatePointAlgorithm() );
266  addAlgorithm( new QgsIntersectionAlgorithm() );
267  addAlgorithm( new QgsJoinByAttributeAlgorithm() );
268  addAlgorithm( new QgsJoinByLocationAlgorithm() );
269  addAlgorithm( new QgsJoinByNearestAlgorithm() );
270  addAlgorithm( new QgsJoinWithLinesAlgorithm() );
271  addAlgorithm( new QgsKMeansClusteringAlgorithm() );
272  addAlgorithm( new QgsLayerToBookmarksAlgorithm() );
273  addAlgorithm( new QgsLayoutMapExtentToLayerAlgorithm() );
274  addAlgorithm( new QgsLineDensityAlgorithm() );
275  addAlgorithm( new QgsLineIntersectionAlgorithm() );
276  addAlgorithm( new QgsLineSubstringAlgorithm() );
277  addAlgorithm( new QgsLoadLayerAlgorithm() );
278  addAlgorithm( new QgsMeanCoordinatesAlgorithm() );
279  addAlgorithm( new QgsMergeLinesAlgorithm() );
280  addAlgorithm( new QgsMergeVectorAlgorithm() );
281  addAlgorithm( new QgsMinimumEnclosingCircleAlgorithm() );
282  addAlgorithm( new QgsMultipartToSinglepartAlgorithm() );
283  addAlgorithm( new QgsMultiRingConstantBufferAlgorithm() );
284  addAlgorithm( new QgsNearestNeighbourAnalysisAlgorithm() );
285  addAlgorithm( new QgsOffsetLinesAlgorithm() );
286  addAlgorithm( new QgsOrderByExpressionAlgorithm() );
287  addAlgorithm( new QgsOrientedMinimumBoundingBoxAlgorithm() );
288  addAlgorithm( new QgsOrthogonalizeAlgorithm() );
289  addAlgorithm( new QgsPackageAlgorithm() );
290  addAlgorithm( new QgsPixelCentroidsFromPolygonsAlgorithm() );
291  addAlgorithm( new QgsCreateArrayOffsetLinesAlgorithm() );
292  addAlgorithm( new QgsPointsInPolygonAlgorithm() );
293  addAlgorithm( new QgsPointOnSurfaceAlgorithm() );
294  addAlgorithm( new QgsPointToLayerAlgorithm() );
295  addAlgorithm( new QgsPointsAlongGeometryAlgorithm() );
296  addAlgorithm( new QgsPointsLayerFromTableAlgorithm() );
297  addAlgorithm( new QgsPoleOfInaccessibilityAlgorithm() );
298  addAlgorithm( new QgsProjectPointCartesianAlgorithm() );
299  addAlgorithm( new QgsPromoteToMultipartAlgorithm() );
300  addAlgorithm( new QgsRandomExtractAlgorithm() );
301  addAlgorithm( new QgsRandomPointsExtentAlgorithm() );
302  addAlgorithm( new QgsRasterLayerUniqueValuesReportAlgorithm() );
303  addAlgorithm( new QgsRasterLayerZonalStatsAlgorithm() );
304  addAlgorithm( new QgsRasterLogicalAndAlgorithm() );
305  addAlgorithm( new QgsRasterLogicalOrAlgorithm() );
306  addAlgorithm( new QgsRasterizeAlgorithm() );
307  addAlgorithm( new QgsRasterPixelsToPointsAlgorithm() );
308  addAlgorithm( new QgsRasterPixelsToPolygonsAlgorithm() );
309  addAlgorithm( new QgsRasterStatisticsAlgorithm() );
310  addAlgorithm( new QgsRasterSurfaceVolumeAlgorithm() );
311  addAlgorithm( new QgsAlgorithmRemoveDuplicateVertices() );
312  addAlgorithm( new QgsReclassifyByLayerAlgorithm() );
313  addAlgorithm( new QgsReclassifyByTableAlgorithm() );
314  addAlgorithm( new QgsRectanglesOvalsDiamondsAlgorithm() );
315  addAlgorithm( new QgsRemoveDuplicatesByAttributeAlgorithm() );
316  addAlgorithm( new QgsRemoveHolesAlgorithm() );
317  addAlgorithm( new QgsRemoveNullGeometryAlgorithm() );
318  addAlgorithm( new QgsRenameLayerAlgorithm() );
319  addAlgorithm( new QgsRenameTableFieldAlgorithm() );
320  addAlgorithm( new QgsRepairShapefileAlgorithm() );
321  addAlgorithm( new QgsReverseLineDirectionAlgorithm() );
322  addAlgorithm( new QgsRotateFeaturesAlgorithm() );
323  addAlgorithm( new QgsRuggednessAlgorithm() );
324  addAlgorithm( new QgsSaveSelectedFeatures() );
325  addAlgorithm( new QgsSegmentizeByMaximumAngleAlgorithm() );
326  addAlgorithm( new QgsSegmentizeByMaximumDistanceAlgorithm() );
327  addAlgorithm( new QgsSelectByLocationAlgorithm() );
328  addAlgorithm( new QgsServiceAreaFromLayerAlgorithm() );
329  addAlgorithm( new QgsServiceAreaFromPointAlgorithm() );
330  addAlgorithm( new QgsSetLayerEncodingAlgorithm() );
331  addAlgorithm( new QgsSetMValueAlgorithm() );
332  addAlgorithm( new QgsSetZValueAlgorithm() );
333  addAlgorithm( new QgsShapefileEncodingInfoAlgorithm() );
334  addAlgorithm( new QgsShortestPathLayerToPointAlgorithm() );
335  addAlgorithm( new QgsShortestPathPointToLayerAlgorithm() );
336  addAlgorithm( new QgsShortestPathPointToPointAlgorithm() );
337  addAlgorithm( new QgsSimplifyAlgorithm() );
338  addAlgorithm( new QgsSingleSidedBufferAlgorithm() );
339  addAlgorithm( new QgsSlopeAlgorithm() );
340  addAlgorithm( new QgsSmoothAlgorithm() );
341  addAlgorithm( new QgsSnapToGridAlgorithm() );
342  addAlgorithm( new QgsSpatialIndexAlgorithm() );
343  addAlgorithm( new QgsSplitFeaturesByAttributeCharacterAlgorithm() );
344  addAlgorithm( new QgsSplitGeometryAtAntimeridianAlgorithm() );
345  addAlgorithm( new QgsSplitLinesByLengthAlgorithm() );
346  addAlgorithm( new QgsSplitWithLinesAlgorithm() );
347  addAlgorithm( new QgsStringConcatenationAlgorithm() );
348  addAlgorithm( new QgsStyleFromProjectAlgorithm() );
349  addAlgorithm( new QgsSubdivideAlgorithm() );
350  addAlgorithm( new QgsSumLineLengthAlgorithm() );
351  addAlgorithm( new QgsSwapXYAlgorithm() );
352  addAlgorithm( new QgsSymmetricalDifferenceAlgorithm() );
353  addAlgorithm( new QgsTaperedBufferAlgorithm() );
354  addAlgorithm( new QgsTransectAlgorithm() );
355  addAlgorithm( new QgsTransformAlgorithm() );
356  addAlgorithm( new QgsTranslateAlgorithm() );
357  addAlgorithm( new QgsTruncateTableAlgorithm() );
358  addAlgorithm( new QgsUnionAlgorithm() );
359  addAlgorithm( new QgsVariableWidthBufferByMAlgorithm() );
360  addAlgorithm( new QgsWedgeBuffersAlgorithm() );
361  addAlgorithm( new QgsZonalHistogramAlgorithm() );
362  addAlgorithm( new QgsZonalStatisticsAlgorithm() );
363  addAlgorithm( new QgsPolygonsToLinesAlgorithm() );
364  addAlgorithm( new QgsDensifyGeometriesByIntervalAlgorithm() );
365  addAlgorithm( new QgsDensifyGeometriesByCountAlgorithm() );
366 }
367 
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.