QGIS API Documentation 3.38.0-Grenoble (exported)
Loading...
Searching...
No Matches
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"
19#include "qgsruntimeprofiler.h"
31#include "qgsalgorithmaspect.h"
38#include "qgsalgorithmbuffer.h"
44#include "qgsalgorithmclip.h"
64#include "qgsalgorithmdrape.h"
74#include "qgsalgorithmexplode.h"
94#include "qgsalgorithmfilter.h"
103#if QT_CONFIG(process)
105#endif
106#include "qgsalgorithmgrid.h"
140#include "qgsalgorithmpackage.h"
183#include "qgsalgorithmrotate.h"
188#include "qgsalgorithmsavelog.h"
202#include "qgsalgorithmsimplify.h"
204#include "qgsalgorithmslope.h"
205#include "qgsalgorithmsmooth.h"
218#include "qgsalgorithmswapxy.h"
222#include "qgsalgorithmtransect.h"
226#include "qgsalgorithmunion.h"
233#include "qgsalgorithmxyztiles.h"
240#include "qgsstylealgorithms.h"
241
243
245 : QgsProcessingProvider( parent )
246{}
247
248QIcon QgsNativeAlgorithms::icon() const
249{
250 return QgsApplication::getThemeIcon( QStringLiteral( "/providerQgis.svg" ) );
251}
252
254{
255 return QgsApplication::iconPath( QStringLiteral( "providerQgis.svg" ) );
256}
257
258QString QgsNativeAlgorithms::id() const
259{
260 return QStringLiteral( "native" );
261}
262
263QString QgsNativeAlgorithms::helpId() const
264{
265 return QStringLiteral( "qgis" );
266}
267
268QString QgsNativeAlgorithms::name() const
269{
270 return tr( "QGIS (native c++)" );
271}
272
274{
275 return true;
276}
277
279{
281}
282
284{
285 const QgsScopedRuntimeProfile profile( QObject::tr( "QGIS native provider" ) );
286 addAlgorithm( new QgsAddIncrementalFieldAlgorithm() );
287 addAlgorithm( new QgsAddTableFieldAlgorithm() );
288 addAlgorithm( new QgsAddXYFieldsAlgorithm() );
289 addAlgorithm( new QgsAddUniqueValueIndexAlgorithm() );
290 addAlgorithm( new QgsAffineTransformationAlgorithm() );
291 addAlgorithm( new QgsAggregateAlgorithm() );
292 addAlgorithm( new QgsAlignRastersAlgorithm() );
293 addAlgorithm( new QgsAlignSingleRasterAlgorithm() );
294 addAlgorithm( new QgsAngleToNearestAlgorithm() );
295 addAlgorithm( new QgsApplyLayerStyleAlgorithm() );
296 addAlgorithm( new QgsArrayTranslatedFeaturesAlgorithm() );
297 addAlgorithm( new QgsAspectAlgorithm() );
298 addAlgorithm( new QgsAssignProjectionAlgorithm() );
299 addAlgorithm( new QgsAttributeIndexAlgorithm() );
300 addAlgorithm( new QgsB3DMToGltfAlgorithm() );
301 addAlgorithm( new QgsBatchNominatimGeocodeAlgorithm() );
302 addAlgorithm( new QgsBookmarksToLayerAlgorithm() );
303 addAlgorithm( new QgsBoundaryAlgorithm() );
304 addAlgorithm( new QgsBoundingBoxAlgorithm() );
305 addAlgorithm( new QgsBufferAlgorithm() );
306 addAlgorithm( new QgsCalculateExpressionAlgorithm() );
307 addAlgorithm( new QgsCalculateVectorOverlapsAlgorithm() );
308 addAlgorithm( new QgsCategorizeUsingStyleAlgorithm() );
309 addAlgorithm( new QgsCellStatisticsAlgorithm() );
310 addAlgorithm( new QgsCellStatisticsPercentileAlgorithm() );
311 addAlgorithm( new QgsCellStatisticsPercentRankFromRasterAlgorithm() );
312 addAlgorithm( new QgsCellStatisticsPercentRankFromValueAlgorithm() );
313 addAlgorithm( new QgsCentroidAlgorithm() );
314 addAlgorithm( new QgsClipAlgorithm() );
315 addAlgorithm( new QgsCollectAlgorithm() );
316 addAlgorithm( new QgsCombineStylesAlgorithm() );
317 addAlgorithm( new QgsConcaveHullAlgorithm() );
318 addAlgorithm( new QgsConditionalBranchAlgorithm() );
319 addAlgorithm( new QgsConstantRasterAlgorithm() );
320 addAlgorithm( new QgsConvertToCurvesAlgorithm() );
321 addAlgorithm( new QgsConvexHullAlgorithm() );
322 addAlgorithm( new QgsCoverageSimplifyAlgorithm() );
323 addAlgorithm( new QgsCoverageUnionAlgorithm() );
324 addAlgorithm( new QgsCoverageValidateAlgorithm() );
325 addAlgorithm( new QgsCreateDirectoryAlgorithm() );
326 addAlgorithm( new QgsDbscanClusteringAlgorithm() );
327 addAlgorithm( new QgsDelaunayTriangulationAlgorithm() );
328 addAlgorithm( new QgsDeleteDuplicateGeometriesAlgorithm() );
329 addAlgorithm( new QgsDetectVectorChangesAlgorithm() );
330 addAlgorithm( new QgsDifferenceAlgorithm() );
331 addAlgorithm( new QgsDissolveAlgorithm() );
332 addAlgorithm( new QgsDownloadVectorTilesAlgorithm() );
333 addAlgorithm( new QgsDrapeToMAlgorithm() );
334 addAlgorithm( new QgsDrapeToZAlgorithm() );
335 addAlgorithm( new QgsDropTableFieldsAlgorithm() );
336 addAlgorithm( new QgsDropGeometryAlgorithm() );
337 addAlgorithm( new QgsDropMZValuesAlgorithm() );
338 addAlgorithm( new QgsDxfExportAlgorithm() );
339 addAlgorithm( new QgsExecutePostgisQueryAlgorithm() );
340 addAlgorithm( new QgsExecuteRegisteredSpatialiteQueryAlgorithm() );
341 addAlgorithm( new QgsExecuteSpatialiteQueryAlgorithm() );
342 addAlgorithm( new QgsExplodeAlgorithm() );
343 addAlgorithm( new QgsExplodeHstoreAlgorithm() );
344 addAlgorithm( new QgsExportLayersInformationAlgorithm() );
345 addAlgorithm( new QgsExportMeshVerticesAlgorithm );
346 addAlgorithm( new QgsExportMeshFacesAlgorithm );
347 addAlgorithm( new QgsExportMeshEdgesAlgorithm );
348 addAlgorithm( new QgsExportMeshOnGridAlgorithm );
349 addAlgorithm( new QgsExportToPostgresqlAlgorithm );
350 addAlgorithm( new QgsExportToSpreadsheetAlgorithm() );
351 addAlgorithm( new QgsExtendLinesAlgorithm() );
352 addAlgorithm( new QgsExtentFromLayerAlgorithm() );
353 addAlgorithm( new QgsExtentToLayerAlgorithm() );
354 addAlgorithm( new QgsExtractBinaryFieldAlgorithm() );
355 addAlgorithm( new QgsExtractByAttributeAlgorithm() );
356 addAlgorithm( new QgsExtractByExpressionAlgorithm() );
357 addAlgorithm( new QgsExtractByExtentAlgorithm() );
358 addAlgorithm( new QgsExtractByLocationAlgorithm() );
359 addAlgorithm( new QgsExtractLabelsAlgorithm() );
360 addAlgorithm( new QgsExtractMValuesAlgorithm() );
361 addAlgorithm( new QgsExtractVerticesAlgorithm() );
362 addAlgorithm( new QgsExtractSpecificVerticesAlgorithm() );
363 addAlgorithm( new QgsExtractWithinDistanceAlgorithm() );
364 addAlgorithm( new QgsExtractZValuesAlgorithm() );
365 addAlgorithm( new QgsFieldCalculatorAlgorithm() );
366 addAlgorithm( new QgsFileDownloaderAlgorithm() );
367 addAlgorithm( new QgsFillNoDataAlgorithm() );
368 addAlgorithm( new QgsFilterAlgorithm() );
369 addAlgorithm( new QgsFilterByGeometryAlgorithm() );
370 addAlgorithm( new QgsFilterByLayerTypeAlgorithm() );
371 addAlgorithm( new QgsFilterVerticesByM() );
372 addAlgorithm( new QgsFilterVerticesByZ() );
373 addAlgorithm( new QgsFixGeometriesAlgorithm() );
374 addAlgorithm( new QgsFlattenRelationshipsAlgorithm() );
375 addAlgorithm( new QgsForceRHRAlgorithm() );
376 addAlgorithm( new QgsFuzzifyRasterLinearMembershipAlgorithm() );
377 addAlgorithm( new QgsFuzzifyRasterPowerMembershipAlgorithm() );
378 addAlgorithm( new QgsFuzzifyRasterLargeMembershipAlgorithm() );
379 addAlgorithm( new QgsFuzzifyRasterSmallMembershipAlgorithm() );
380 addAlgorithm( new QgsFuzzifyRasterGaussianMembershipAlgorithm() );
381 addAlgorithm( new QgsFuzzifyRasterNearMembershipAlgorithm() );
382 addAlgorithm( new QgsGeometryByExpressionAlgorithm() );
383 addAlgorithm( new QgsGltfToVectorFeaturesAlgorithm() );
384#if QT_CONFIG(process)
385 addAlgorithm( new QgsConvertGpxFeatureTypeAlgorithm() );
386 addAlgorithm( new QgsConvertGpsDataAlgorithm() );
387 addAlgorithm( new QgsDownloadGpsDataAlgorithm() );
388 addAlgorithm( new QgsUploadGpsDataAlgorithm() );
389#endif
390 addAlgorithm( new QgsGridAlgorithm() );
391 addAlgorithm( new QgsHillshadeAlgorithm() );
392 addAlgorithm( new QgsImportPhotosAlgorithm() );
393 addAlgorithm( new QgsInterpolatePointAlgorithm() );
394 addAlgorithm( new QgsIntersectionAlgorithm() );
395 addAlgorithm( new QgsJoinByAttributeAlgorithm() );
396 addAlgorithm( new QgsJoinByLocationAlgorithm() );
397 addAlgorithm( new QgsJoinByLocationSummaryAlgorithm() );
398 addAlgorithm( new QgsJoinByNearestAlgorithm() );
399 addAlgorithm( new QgsJoinWithLinesAlgorithm() );
400 addAlgorithm( new QgsKeepNBiggestPartsAlgorithm() );
401 addAlgorithm( new QgsKMeansClusteringAlgorithm() );
402 addAlgorithm( new QgsLayerToBookmarksAlgorithm() );
403 addAlgorithm( new QgsLayoutMapExtentToLayerAlgorithm() );
404 addAlgorithm( new QgsLayoutAtlasToImageAlgorithm() );
405 addAlgorithm( new QgsLayoutAtlasToPdfAlgorithm() );
406 addAlgorithm( new QgsLayoutAtlasToMultiplePdfAlgorithm() );
407 addAlgorithm( new QgsLayoutToImageAlgorithm() );
408 addAlgorithm( new QgsLayoutToPdfAlgorithm() );
409 addAlgorithm( new QgsLineDensityAlgorithm() );
410 addAlgorithm( new QgsLineIntersectionAlgorithm() );
411 addAlgorithm( new QgsLineSubstringAlgorithm() );
412 addAlgorithm( new QgsLoadLayerAlgorithm() );
413 addAlgorithm( new QgsMeanCoordinatesAlgorithm() );
414 addAlgorithm( new QgsMergeLinesAlgorithm() );
415 addAlgorithm( new QgsMergeVectorAlgorithm() );
416 addAlgorithm( new QgsMeshRasterizeAlgorithm );
417 addAlgorithm( new QgsMeshContoursAlgorithm );
418 addAlgorithm( new QgsMeshExportCrossSection );
419 addAlgorithm( new QgsMeshExportTimeSeries );
420 addAlgorithm( new QgsMinimumEnclosingCircleAlgorithm() );
421 addAlgorithm( new QgsMultiDifferenceAlgorithm() );
422 addAlgorithm( new QgsMultiIntersectionAlgorithm() );
423 addAlgorithm( new QgsMultipartToSinglepartAlgorithm() );
424 addAlgorithm( new QgsMultiRingConstantBufferAlgorithm() );
425 addAlgorithm( new QgsMultiUnionAlgorithm() );
426 addAlgorithm( new QgsNearestNeighbourAnalysisAlgorithm() );
427 addAlgorithm( new QgsOffsetLinesAlgorithm() );
428 addAlgorithm( new QgsOrderByExpressionAlgorithm() );
429 addAlgorithm( new QgsOrientedMinimumBoundingBoxAlgorithm() );
430 addAlgorithm( new QgsOrthogonalizeAlgorithm() );
431 addAlgorithm( new QgsPackageAlgorithm() );
432 addAlgorithm( new QgsPixelCentroidsFromPolygonsAlgorithm() );
433 addAlgorithm( new QgsCreateArrayOffsetLinesAlgorithm() );
434 addAlgorithm( new QgsPointsInPolygonAlgorithm() );
435 addAlgorithm( new QgsPointOnSurfaceAlgorithm() );
436 addAlgorithm( new QgsPointToLayerAlgorithm() );
437 addAlgorithm( new QgsPointsAlongGeometryAlgorithm() );
438 addAlgorithm( new QgsPointsLayerFromTableAlgorithm() );
439 addAlgorithm( new QgsPointsToPathsAlgorithm() );
440 addAlgorithm( new QgsPoleOfInaccessibilityAlgorithm() );
441 addAlgorithm( new QgsPolygonizeAlgorithm() );
442 addAlgorithm( new QgsProjectPointCartesianAlgorithm() );
443 addAlgorithm( new QgsPromoteToMultipartAlgorithm() );
444 addAlgorithm( new QgsRaiseExceptionAlgorithm() );
445 addAlgorithm( new QgsRaiseWarningAlgorithm() );
446 addAlgorithm( new QgsRaiseMessageAlgorithm() );
447 addAlgorithm( new QgsRandomBinomialRasterAlgorithm() );
448 addAlgorithm( new QgsRandomExponentialRasterAlgorithm() );
449 addAlgorithm( new QgsRandomExtractAlgorithm() );
450 addAlgorithm( new QgsRandomGammaRasterAlgorithm() );
451 addAlgorithm( new QgsRandomGeometricRasterAlgorithm() );
452 addAlgorithm( new QgsRandomNegativeBinomialRasterAlgorithm() );
453 addAlgorithm( new QgsRandomNormalRasterAlgorithm() );
454 addAlgorithm( new QgsRandomPointsExtentAlgorithm() );
455 addAlgorithm( new QgsRandomPointsInPolygonsAlgorithm() );
456 addAlgorithm( new QgsRandomPointsOnLinesAlgorithm() );
457 addAlgorithm( new QgsRandomPoissonRasterAlgorithm() );
458 addAlgorithm( new QgsRandomUniformRasterAlgorithm() );
459 addAlgorithm( new QgsRasterCalculatorAlgorithm() );
460 addAlgorithm( new QgsRasterCalculatorModelerAlgorithm() );
461 addAlgorithm( new QgsRasterDtmSlopeBasedFilterAlgorithm() );
462 addAlgorithm( new QgsRasterFrequencyByEqualOperatorAlgorithm() );
463 addAlgorithm( new QgsRasterFrequencyByGreaterThanOperatorAlgorithm() );
464 addAlgorithm( new QgsRasterFrequencyByLessThanOperatorAlgorithm() );
465 addAlgorithm( new QgsRasterLayerPropertiesAlgorithm() );
466 addAlgorithm( new QgsRasterLayerUniqueValuesReportAlgorithm() );
467 addAlgorithm( new QgsRasterLayerZonalStatsAlgorithm() );
468 addAlgorithm( new QgsRasterLogicalAndAlgorithm() );
469 addAlgorithm( new QgsRasterLogicalOrAlgorithm() );
470 addAlgorithm( new QgsRasterizeAlgorithm() );
471 addAlgorithm( new QgsRasterPixelsToPointsAlgorithm() );
472 addAlgorithm( new QgsRasterPixelsToPolygonsAlgorithm() );
473 addAlgorithm( new QgsRasterSamplingAlgorithm() );
474 addAlgorithm( new QgsRasterStackHighestPositionAlgorithm() );
475 addAlgorithm( new QgsRasterStackLowestPositionAlgorithm() );
476 addAlgorithm( new QgsRasterStatisticsAlgorithm() );
477 addAlgorithm( new QgsRasterSurfaceVolumeAlgorithm() );
478 addAlgorithm( new QgsAlgorithmRemoveDuplicateVertices() );
479 addAlgorithm( new QgsReclassifyByLayerAlgorithm() );
480 addAlgorithm( new QgsReclassifyByTableAlgorithm() );
481 addAlgorithm( new QgsRectanglesOvalsDiamondsAlgorithm() );
482 addAlgorithm( new QgsRefactorFieldsAlgorithm() );
483 addAlgorithm( new QgsRemoveDuplicatesByAttributeAlgorithm() );
484 addAlgorithm( new QgsRemoveHolesAlgorithm() );
485 addAlgorithm( new QgsRemoveNullGeometryAlgorithm() );
486 addAlgorithm( new QgsRenameLayerAlgorithm() );
487 addAlgorithm( new QgsRenameTableFieldAlgorithm() );
488 addAlgorithm( new QgsRepairShapefileAlgorithm() );
489 addAlgorithm( new QgsRescaleRasterAlgorithm() );
490 addAlgorithm( new QgsRetainTableFieldsAlgorithm() );
491 addAlgorithm( new QgsReverseLineDirectionAlgorithm() );
492 addAlgorithm( new QgsRotateFeaturesAlgorithm() );
493 addAlgorithm( new QgsRoundnessAlgorithm() );
494 addAlgorithm( new QgsRoundRasterValuesAlgorithm() );
495 addAlgorithm( new QgsRuggednessAlgorithm() );
496 addAlgorithm( new QgsSaveFeaturesAlgorithm() );
497 addAlgorithm( new QgsSaveLogToFileAlgorithm() );
498 addAlgorithm( new QgsSaveSelectedFeatures() );
499 addAlgorithm( new QgsSegmentizeByMaximumAngleAlgorithm() );
500 addAlgorithm( new QgsSegmentizeByMaximumDistanceAlgorithm() );
501 addAlgorithm( new QgsSelectByLocationAlgorithm() );
502 addAlgorithm( new QgsSelectWithinDistanceAlgorithm() );
503 addAlgorithm( new QgsServiceAreaFromLayerAlgorithm() );
504 addAlgorithm( new QgsServiceAreaFromPointAlgorithm() );
505 addAlgorithm( new QgsSetLayerEncodingAlgorithm() );
506 addAlgorithm( new QgsSetMValueAlgorithm() );
507 addAlgorithm( new QgsSetProjectVariableAlgorithm() );
508 addAlgorithm( new QgsSetZValueAlgorithm() );
509 addAlgorithm( new QgsShapefileEncodingInfoAlgorithm() );
510 addAlgorithm( new QgsShortestLineAlgorithm() );
511 addAlgorithm( new QgsShortestPathLayerToPointAlgorithm() );
512 addAlgorithm( new QgsShortestPathPointToLayerAlgorithm() );
513 addAlgorithm( new QgsShortestPathPointToPointAlgorithm() );
514 addAlgorithm( new QgsSimplifyAlgorithm() );
515 addAlgorithm( new QgsSingleSidedBufferAlgorithm() );
516 addAlgorithm( new QgsSlopeAlgorithm() );
517 addAlgorithm( new QgsSmoothAlgorithm() );
518 addAlgorithm( new QgsSnapGeometriesAlgorithm() );
519 addAlgorithm( new QgsSnapToGridAlgorithm() );
520 addAlgorithm( new QgsSpatialIndexAlgorithm() );
521 addAlgorithm( new QgsSplitFeaturesByAttributeCharacterAlgorithm() );
522 addAlgorithm( new QgsSplitGeometryAtAntimeridianAlgorithm() );
523 addAlgorithm( new QgsSplitLinesByLengthAlgorithm() );
524 addAlgorithm( new QgsSplitVectorLayerAlgorithm() );
525 addAlgorithm( new QgsSplitWithLinesAlgorithm() );
526 addAlgorithm( new QgsStDbscanClusteringAlgorithm() );
527 addAlgorithm( new QgsStringConcatenationAlgorithm() );
528 addAlgorithm( new QgsStyleFromProjectAlgorithm() );
529 addAlgorithm( new QgsSubdivideAlgorithm() );
530 addAlgorithm( new QgsSumLineLengthAlgorithm() );
531 addAlgorithm( new QgsSwapXYAlgorithm() );
532 addAlgorithm( new QgsSymmetricalDifferenceAlgorithm() );
533 addAlgorithm( new QgsTaperedBufferAlgorithm() );
534 addAlgorithm( new QgsTinMeshCreationAlgorithm() );
535 addAlgorithm( new QgsTransectAlgorithm() );
536 addAlgorithm( new QgsTransferAnnotationsFromMainAlgorithm() );
537 addAlgorithm( new QgsTransformAlgorithm() );
538 addAlgorithm( new QgsTranslateAlgorithm() );
539 addAlgorithm( new QgsTruncateTableAlgorithm() );
540 addAlgorithm( new QgsUnionAlgorithm() );
541 addAlgorithm( new QgsVariableWidthBufferByMAlgorithm() );
542 addAlgorithm( new QgsVirtualRasterCalculatorAlgorithm() );
543 addAlgorithm( new QgsVirtualRasterCalculatorModelerAlgorithm() );
544 addAlgorithm( new QgsVoronoiPolygonsAlgorithm() );
545 addAlgorithm( new QgsWedgeBuffersAlgorithm() );
546 addAlgorithm( new QgsWriteVectorTilesXyzAlgorithm() );
547 addAlgorithm( new QgsWriteVectorTilesMbtilesAlgorithm() );
548 addAlgorithm( new QgsXyzTilesDirectoryAlgorithm() );
549 addAlgorithm( new QgsXyzTilesMbtilesAlgorithm() );
550 addAlgorithm( new QgsZonalHistogramAlgorithm() );
551 addAlgorithm( new QgsZonalStatisticsAlgorithm() );
552 addAlgorithm( new QgsZonalStatisticsFeatureBasedAlgorithm() );
553 addAlgorithm( new QgsPolygonsToLinesAlgorithm() );
554 addAlgorithm( new QgsDensifyGeometriesByIntervalAlgorithm() );
555 addAlgorithm( new QgsDensifyGeometriesByCountAlgorithm() );
556}
557
@ CompatibleWithVirtualRaster
The processing provider's algorithms can work with QGIS virtualraster data provider....
QFlags< ProcessingProviderFlag > ProcessingProviderFlags
Flags indicating how and when an processing provider operates and should be exposed to users.
Definition qgis.h:3034
static QIcon getThemeIcon(const QString &name, const QColor &fillColor=QColor(), const QColor &strokeColor=QColor())
Helper to get a theme icon.
static QString iconPath(const QString &iconFile)
Returns path to the desired icon file.
void loadAlgorithms() override
Loads all algorithms belonging to this provider.
QString helpId() const override
Returns the provider help id string, used for creating QgsHelp urls for algorithms belong to this pro...
QString id() const override
Returns the unique provider id, used for identifying the provider.
bool supportsNonFileBasedOutput() const override
Returns true if the provider supports non-file based outputs (such as memory layers or direct databas...
QString svgIconPath() const override
Returns a path to an SVG version of the provider's icon.
QString name() const override
Returns the provider name, which is used to describe the provider within the GUI.
QIcon icon() const override
Returns an icon for the provider.
QgsNativeAlgorithms(QObject *parent=nullptr)
Constructor for QgsNativeAlgorithms.
Qgis::ProcessingProviderFlags flags() const override
Returns the flags indicating how and when the provider operates and should be exposed to users.
Abstract base class for processing providers.
bool addAlgorithm(QgsProcessingAlgorithm *algorithm)
Adds an algorithm to the provider.
Scoped object for logging of the runtime for a single operation or group of operations.