QGIS API Documentation 3.34.0-Prizren (ffbdd678812)
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"
61#include "qgsalgorithmdrape.h"
71#include "qgsalgorithmexplode.h"
91#include "qgsalgorithmfilter.h"
100#if QT_CONFIG(process)
102#endif
103#include "qgsalgorithmgrid.h"
115#ifndef QT_NO_PRINTER
120#endif
139#include "qgsalgorithmpackage.h"
182#include "qgsalgorithmrotate.h"
187#include "qgsalgorithmsavelog.h"
201#include "qgsalgorithmsimplify.h"
203#include "qgsalgorithmslope.h"
204#include "qgsalgorithmsmooth.h"
217#include "qgsalgorithmswapxy.h"
221#include "qgsalgorithmtransect.h"
225#include "qgsalgorithmunion.h"
232#include "qgsalgorithmxyztiles.h"
239#include "qgsstylealgorithms.h"
240
242
244 : QgsProcessingProvider( parent )
245{}
246
247QIcon QgsNativeAlgorithms::icon() const
248{
249 return QgsApplication::getThemeIcon( QStringLiteral( "/providerQgis.svg" ) );
250}
251
253{
254 return QgsApplication::iconPath( QStringLiteral( "providerQgis.svg" ) );
255}
256
257QString QgsNativeAlgorithms::id() const
258{
259 return QStringLiteral( "native" );
260}
261
262QString QgsNativeAlgorithms::helpId() const
263{
264 return QStringLiteral( "qgis" );
265}
266
267QString QgsNativeAlgorithms::name() const
268{
269 return tr( "QGIS (native c++)" );
270}
271
273{
274 return true;
275}
276
278{
279 const QgsScopedRuntimeProfile profile( QObject::tr( "QGIS native provider" ) );
280 addAlgorithm( new QgsAddIncrementalFieldAlgorithm() );
281 addAlgorithm( new QgsAddTableFieldAlgorithm() );
282 addAlgorithm( new QgsAddXYFieldsAlgorithm() );
283 addAlgorithm( new QgsAddUniqueValueIndexAlgorithm() );
284 addAlgorithm( new QgsAffineTransformationAlgorithm() );
285 addAlgorithm( new QgsAggregateAlgorithm() );
286 addAlgorithm( new QgsAlignRastersAlgorithm() );
287 addAlgorithm( new QgsAlignSingleRasterAlgorithm() );
288 addAlgorithm( new QgsAngleToNearestAlgorithm() );
289 addAlgorithm( new QgsApplyLayerStyleAlgorithm() );
290 addAlgorithm( new QgsArrayTranslatedFeaturesAlgorithm() );
291 addAlgorithm( new QgsAspectAlgorithm() );
292 addAlgorithm( new QgsAssignProjectionAlgorithm() );
293 addAlgorithm( new QgsAttributeIndexAlgorithm() );
294 addAlgorithm( new QgsB3DMToGltfAlgorithm() );
295 addAlgorithm( new QgsBatchNominatimGeocodeAlgorithm() );
296 addAlgorithm( new QgsBookmarksToLayerAlgorithm() );
297 addAlgorithm( new QgsBoundaryAlgorithm() );
298 addAlgorithm( new QgsBoundingBoxAlgorithm() );
299 addAlgorithm( new QgsBufferAlgorithm() );
300 addAlgorithm( new QgsCalculateExpressionAlgorithm() );
301 addAlgorithm( new QgsCalculateVectorOverlapsAlgorithm() );
302 addAlgorithm( new QgsCategorizeUsingStyleAlgorithm() );
303 addAlgorithm( new QgsCellStatisticsAlgorithm() );
304 addAlgorithm( new QgsCellStatisticsPercentileAlgorithm() );
305 addAlgorithm( new QgsCellStatisticsPercentRankFromRasterAlgorithm() );
306 addAlgorithm( new QgsCellStatisticsPercentRankFromValueAlgorithm() );
307 addAlgorithm( new QgsCentroidAlgorithm() );
308 addAlgorithm( new QgsClipAlgorithm() );
309 addAlgorithm( new QgsCollectAlgorithm() );
310 addAlgorithm( new QgsCombineStylesAlgorithm() );
311 addAlgorithm( new QgsConcaveHullAlgorithm() );
312 addAlgorithm( new QgsConditionalBranchAlgorithm() );
313 addAlgorithm( new QgsConstantRasterAlgorithm() );
314 addAlgorithm( new QgsConvertToCurvesAlgorithm() );
315 addAlgorithm( new QgsConvexHullAlgorithm() );
316 addAlgorithm( new QgsCreateDirectoryAlgorithm() );
317 addAlgorithm( new QgsDbscanClusteringAlgorithm() );
318 addAlgorithm( new QgsDelaunayTriangulationAlgorithm() );
319 addAlgorithm( new QgsDeleteDuplicateGeometriesAlgorithm() );
320 addAlgorithm( new QgsDetectVectorChangesAlgorithm() );
321 addAlgorithm( new QgsDifferenceAlgorithm() );
322 addAlgorithm( new QgsDissolveAlgorithm() );
323 addAlgorithm( new QgsDownloadVectorTilesAlgorithm() );
324 addAlgorithm( new QgsDrapeToMAlgorithm() );
325 addAlgorithm( new QgsDrapeToZAlgorithm() );
326 addAlgorithm( new QgsDropTableFieldsAlgorithm() );
327 addAlgorithm( new QgsDropGeometryAlgorithm() );
328 addAlgorithm( new QgsDropMZValuesAlgorithm() );
329 addAlgorithm( new QgsDxfExportAlgorithm() );
330 addAlgorithm( new QgsExecutePostgisQueryAlgorithm() );
331 addAlgorithm( new QgsExecuteRegisteredSpatialiteQueryAlgorithm() );
332 addAlgorithm( new QgsExecuteSpatialiteQueryAlgorithm() );
333 addAlgorithm( new QgsExplodeAlgorithm() );
334 addAlgorithm( new QgsExplodeHstoreAlgorithm() );
335 addAlgorithm( new QgsExportLayersInformationAlgorithm() );
336 addAlgorithm( new QgsExportMeshVerticesAlgorithm );
337 addAlgorithm( new QgsExportMeshFacesAlgorithm );
338 addAlgorithm( new QgsExportMeshEdgesAlgorithm );
339 addAlgorithm( new QgsExportMeshOnGridAlgorithm );
340 addAlgorithm( new QgsExportToPostgresqlAlgorithm );
341 addAlgorithm( new QgsExportToSpreadsheetAlgorithm() );
342 addAlgorithm( new QgsExtendLinesAlgorithm() );
343 addAlgorithm( new QgsExtentFromLayerAlgorithm() );
344 addAlgorithm( new QgsExtentToLayerAlgorithm() );
345 addAlgorithm( new QgsExtractBinaryFieldAlgorithm() );
346 addAlgorithm( new QgsExtractByAttributeAlgorithm() );
347 addAlgorithm( new QgsExtractByExpressionAlgorithm() );
348 addAlgorithm( new QgsExtractByExtentAlgorithm() );
349 addAlgorithm( new QgsExtractByLocationAlgorithm() );
350 addAlgorithm( new QgsExtractLabelsAlgorithm() );
351 addAlgorithm( new QgsExtractMValuesAlgorithm() );
352 addAlgorithm( new QgsExtractVerticesAlgorithm() );
353 addAlgorithm( new QgsExtractSpecificVerticesAlgorithm() );
354 addAlgorithm( new QgsExtractWithinDistanceAlgorithm() );
355 addAlgorithm( new QgsExtractZValuesAlgorithm() );
356 addAlgorithm( new QgsFieldCalculatorAlgorithm() );
357 addAlgorithm( new QgsFileDownloaderAlgorithm() );
358 addAlgorithm( new QgsFillNoDataAlgorithm() );
359 addAlgorithm( new QgsFilterAlgorithm() );
360 addAlgorithm( new QgsFilterByGeometryAlgorithm() );
361 addAlgorithm( new QgsFilterByLayerTypeAlgorithm() );
362 addAlgorithm( new QgsFilterVerticesByM() );
363 addAlgorithm( new QgsFilterVerticesByZ() );
364 addAlgorithm( new QgsFixGeometriesAlgorithm() );
365 addAlgorithm( new QgsFlattenRelationshipsAlgorithm() );
366 addAlgorithm( new QgsForceRHRAlgorithm() );
367 addAlgorithm( new QgsFuzzifyRasterLinearMembershipAlgorithm() );
368 addAlgorithm( new QgsFuzzifyRasterPowerMembershipAlgorithm() );
369 addAlgorithm( new QgsFuzzifyRasterLargeMembershipAlgorithm() );
370 addAlgorithm( new QgsFuzzifyRasterSmallMembershipAlgorithm() );
371 addAlgorithm( new QgsFuzzifyRasterGaussianMembershipAlgorithm() );
372 addAlgorithm( new QgsFuzzifyRasterNearMembershipAlgorithm() );
373 addAlgorithm( new QgsGeometryByExpressionAlgorithm() );
374 addAlgorithm( new QgsGltfToVectorFeaturesAlgorithm() );
375#if QT_CONFIG(process)
376 addAlgorithm( new QgsConvertGpxFeatureTypeAlgorithm() );
377 addAlgorithm( new QgsConvertGpsDataAlgorithm() );
378 addAlgorithm( new QgsDownloadGpsDataAlgorithm() );
379 addAlgorithm( new QgsUploadGpsDataAlgorithm() );
380#endif
381 addAlgorithm( new QgsGridAlgorithm() );
382 addAlgorithm( new QgsHillshadeAlgorithm() );
383 addAlgorithm( new QgsImportPhotosAlgorithm() );
384 addAlgorithm( new QgsInterpolatePointAlgorithm() );
385 addAlgorithm( new QgsIntersectionAlgorithm() );
386 addAlgorithm( new QgsJoinByAttributeAlgorithm() );
387 addAlgorithm( new QgsJoinByLocationAlgorithm() );
388 addAlgorithm( new QgsJoinByLocationSummaryAlgorithm() );
389 addAlgorithm( new QgsJoinByNearestAlgorithm() );
390 addAlgorithm( new QgsJoinWithLinesAlgorithm() );
391 addAlgorithm( new QgsKeepNBiggestPartsAlgorithm() );
392 addAlgorithm( new QgsKMeansClusteringAlgorithm() );
393 addAlgorithm( new QgsLayerToBookmarksAlgorithm() );
394 addAlgorithm( new QgsLayoutMapExtentToLayerAlgorithm() );
395#ifndef QT_NO_PRINTER
396 addAlgorithm( new QgsLayoutAtlasToImageAlgorithm() );
397 addAlgorithm( new QgsLayoutAtlasToPdfAlgorithm() );
398 addAlgorithm( new QgsLayoutAtlasToMultiplePdfAlgorithm() );
399 addAlgorithm( new QgsLayoutToImageAlgorithm() );
400 addAlgorithm( new QgsLayoutToPdfAlgorithm() );
401#endif
402 addAlgorithm( new QgsLineDensityAlgorithm() );
403 addAlgorithm( new QgsLineIntersectionAlgorithm() );
404 addAlgorithm( new QgsLineSubstringAlgorithm() );
405 addAlgorithm( new QgsLoadLayerAlgorithm() );
406 addAlgorithm( new QgsMeanCoordinatesAlgorithm() );
407 addAlgorithm( new QgsMergeLinesAlgorithm() );
408 addAlgorithm( new QgsMergeVectorAlgorithm() );
409 addAlgorithm( new QgsMeshRasterizeAlgorithm );
410 addAlgorithm( new QgsMeshContoursAlgorithm );
411 addAlgorithm( new QgsMeshExportCrossSection );
412 addAlgorithm( new QgsMeshExportTimeSeries );
413 addAlgorithm( new QgsMinimumEnclosingCircleAlgorithm() );
414 addAlgorithm( new QgsMultiDifferenceAlgorithm() );
415 addAlgorithm( new QgsMultiIntersectionAlgorithm() );
416 addAlgorithm( new QgsMultipartToSinglepartAlgorithm() );
417 addAlgorithm( new QgsMultiRingConstantBufferAlgorithm() );
418 addAlgorithm( new QgsMultiUnionAlgorithm() );
419 addAlgorithm( new QgsNearestNeighbourAnalysisAlgorithm() );
420 addAlgorithm( new QgsOffsetLinesAlgorithm() );
421 addAlgorithm( new QgsOrderByExpressionAlgorithm() );
422 addAlgorithm( new QgsOrientedMinimumBoundingBoxAlgorithm() );
423 addAlgorithm( new QgsOrthogonalizeAlgorithm() );
424 addAlgorithm( new QgsPackageAlgorithm() );
425 addAlgorithm( new QgsPixelCentroidsFromPolygonsAlgorithm() );
426 addAlgorithm( new QgsCreateArrayOffsetLinesAlgorithm() );
427 addAlgorithm( new QgsPointsInPolygonAlgorithm() );
428 addAlgorithm( new QgsPointOnSurfaceAlgorithm() );
429 addAlgorithm( new QgsPointToLayerAlgorithm() );
430 addAlgorithm( new QgsPointsAlongGeometryAlgorithm() );
431 addAlgorithm( new QgsPointsLayerFromTableAlgorithm() );
432 addAlgorithm( new QgsPointsToPathsAlgorithm() );
433 addAlgorithm( new QgsPoleOfInaccessibilityAlgorithm() );
434 addAlgorithm( new QgsPolygonizeAlgorithm() );
435 addAlgorithm( new QgsProjectPointCartesianAlgorithm() );
436 addAlgorithm( new QgsPromoteToMultipartAlgorithm() );
437 addAlgorithm( new QgsRaiseExceptionAlgorithm() );
438 addAlgorithm( new QgsRaiseWarningAlgorithm() );
439 addAlgorithm( new QgsRaiseMessageAlgorithm() );
440 addAlgorithm( new QgsRandomBinomialRasterAlgorithm() );
441 addAlgorithm( new QgsRandomExponentialRasterAlgorithm() );
442 addAlgorithm( new QgsRandomExtractAlgorithm() );
443 addAlgorithm( new QgsRandomGammaRasterAlgorithm() );
444 addAlgorithm( new QgsRandomGeometricRasterAlgorithm() );
445 addAlgorithm( new QgsRandomNegativeBinomialRasterAlgorithm() );
446 addAlgorithm( new QgsRandomNormalRasterAlgorithm() );
447 addAlgorithm( new QgsRandomPointsExtentAlgorithm() );
448 addAlgorithm( new QgsRandomPointsInPolygonsAlgorithm() );
449 addAlgorithm( new QgsRandomPointsOnLinesAlgorithm() );
450 addAlgorithm( new QgsRandomPoissonRasterAlgorithm() );
451 addAlgorithm( new QgsRandomUniformRasterAlgorithm() );
452 addAlgorithm( new QgsRasterCalculatorAlgorithm() );
453 addAlgorithm( new QgsRasterCalculatorModelerAlgorithm() );
454 addAlgorithm( new QgsRasterDtmSlopeBasedFilterAlgorithm() );
455 addAlgorithm( new QgsRasterFrequencyByEqualOperatorAlgorithm() );
456 addAlgorithm( new QgsRasterFrequencyByGreaterThanOperatorAlgorithm() );
457 addAlgorithm( new QgsRasterFrequencyByLessThanOperatorAlgorithm() );
458 addAlgorithm( new QgsRasterLayerPropertiesAlgorithm() );
459 addAlgorithm( new QgsRasterLayerUniqueValuesReportAlgorithm() );
460 addAlgorithm( new QgsRasterLayerZonalStatsAlgorithm() );
461 addAlgorithm( new QgsRasterLogicalAndAlgorithm() );
462 addAlgorithm( new QgsRasterLogicalOrAlgorithm() );
463 addAlgorithm( new QgsRasterizeAlgorithm() );
464 addAlgorithm( new QgsRasterPixelsToPointsAlgorithm() );
465 addAlgorithm( new QgsRasterPixelsToPolygonsAlgorithm() );
466 addAlgorithm( new QgsRasterSamplingAlgorithm() );
467 addAlgorithm( new QgsRasterStackHighestPositionAlgorithm() );
468 addAlgorithm( new QgsRasterStackLowestPositionAlgorithm() );
469 addAlgorithm( new QgsRasterStatisticsAlgorithm() );
470 addAlgorithm( new QgsRasterSurfaceVolumeAlgorithm() );
471 addAlgorithm( new QgsAlgorithmRemoveDuplicateVertices() );
472 addAlgorithm( new QgsReclassifyByLayerAlgorithm() );
473 addAlgorithm( new QgsReclassifyByTableAlgorithm() );
474 addAlgorithm( new QgsRectanglesOvalsDiamondsAlgorithm() );
475 addAlgorithm( new QgsRefactorFieldsAlgorithm() );
476 addAlgorithm( new QgsRemoveDuplicatesByAttributeAlgorithm() );
477 addAlgorithm( new QgsRemoveHolesAlgorithm() );
478 addAlgorithm( new QgsRemoveNullGeometryAlgorithm() );
479 addAlgorithm( new QgsRenameLayerAlgorithm() );
480 addAlgorithm( new QgsRenameTableFieldAlgorithm() );
481 addAlgorithm( new QgsRepairShapefileAlgorithm() );
482 addAlgorithm( new QgsRescaleRasterAlgorithm() );
483 addAlgorithm( new QgsRetainTableFieldsAlgorithm() );
484 addAlgorithm( new QgsReverseLineDirectionAlgorithm() );
485 addAlgorithm( new QgsRotateFeaturesAlgorithm() );
486 addAlgorithm( new QgsRoundnessAlgorithm() );
487 addAlgorithm( new QgsRoundRasterValuesAlgorithm() );
488 addAlgorithm( new QgsRuggednessAlgorithm() );
489 addAlgorithm( new QgsSaveFeaturesAlgorithm() );
490 addAlgorithm( new QgsSaveLogToFileAlgorithm() );
491 addAlgorithm( new QgsSaveSelectedFeatures() );
492 addAlgorithm( new QgsSegmentizeByMaximumAngleAlgorithm() );
493 addAlgorithm( new QgsSegmentizeByMaximumDistanceAlgorithm() );
494 addAlgorithm( new QgsSelectByLocationAlgorithm() );
495 addAlgorithm( new QgsSelectWithinDistanceAlgorithm() );
496 addAlgorithm( new QgsServiceAreaFromLayerAlgorithm() );
497 addAlgorithm( new QgsServiceAreaFromPointAlgorithm() );
498 addAlgorithm( new QgsSetLayerEncodingAlgorithm() );
499 addAlgorithm( new QgsSetMValueAlgorithm() );
500 addAlgorithm( new QgsSetProjectVariableAlgorithm() );
501 addAlgorithm( new QgsSetZValueAlgorithm() );
502 addAlgorithm( new QgsShapefileEncodingInfoAlgorithm() );
503 addAlgorithm( new QgsShortestLineAlgorithm() );
504 addAlgorithm( new QgsShortestPathLayerToPointAlgorithm() );
505 addAlgorithm( new QgsShortestPathPointToLayerAlgorithm() );
506 addAlgorithm( new QgsShortestPathPointToPointAlgorithm() );
507 addAlgorithm( new QgsSimplifyAlgorithm() );
508 addAlgorithm( new QgsSingleSidedBufferAlgorithm() );
509 addAlgorithm( new QgsSlopeAlgorithm() );
510 addAlgorithm( new QgsSmoothAlgorithm() );
511 addAlgorithm( new QgsSnapGeometriesAlgorithm() );
512 addAlgorithm( new QgsSnapToGridAlgorithm() );
513 addAlgorithm( new QgsSpatialIndexAlgorithm() );
514 addAlgorithm( new QgsSplitFeaturesByAttributeCharacterAlgorithm() );
515 addAlgorithm( new QgsSplitGeometryAtAntimeridianAlgorithm() );
516 addAlgorithm( new QgsSplitLinesByLengthAlgorithm() );
517 addAlgorithm( new QgsSplitVectorLayerAlgorithm() );
518 addAlgorithm( new QgsSplitWithLinesAlgorithm() );
519 addAlgorithm( new QgsStDbscanClusteringAlgorithm() );
520 addAlgorithm( new QgsStringConcatenationAlgorithm() );
521 addAlgorithm( new QgsStyleFromProjectAlgorithm() );
522 addAlgorithm( new QgsSubdivideAlgorithm() );
523 addAlgorithm( new QgsSumLineLengthAlgorithm() );
524 addAlgorithm( new QgsSwapXYAlgorithm() );
525 addAlgorithm( new QgsSymmetricalDifferenceAlgorithm() );
526 addAlgorithm( new QgsTaperedBufferAlgorithm() );
527 addAlgorithm( new QgsTinMeshCreationAlgorithm() );
528 addAlgorithm( new QgsTransectAlgorithm() );
529 addAlgorithm( new QgsTransferAnnotationsFromMainAlgorithm() );
530 addAlgorithm( new QgsTransformAlgorithm() );
531 addAlgorithm( new QgsTranslateAlgorithm() );
532 addAlgorithm( new QgsTruncateTableAlgorithm() );
533 addAlgorithm( new QgsUnionAlgorithm() );
534 addAlgorithm( new QgsVariableWidthBufferByMAlgorithm() );
535 addAlgorithm( new QgsVirtualRasterCalculatorAlgorithm() );
536 addAlgorithm( new QgsVirtualRasterCalculatorModelerAlgorithm() );
537 addAlgorithm( new QgsVoronoiPolygonsAlgorithm() );
538 addAlgorithm( new QgsWedgeBuffersAlgorithm() );
539 addAlgorithm( new QgsWriteVectorTilesXyzAlgorithm() );
540 addAlgorithm( new QgsWriteVectorTilesMbtilesAlgorithm() );
541 addAlgorithm( new QgsXyzTilesDirectoryAlgorithm() );
542 addAlgorithm( new QgsXyzTilesMbtilesAlgorithm() );
543 addAlgorithm( new QgsZonalHistogramAlgorithm() );
544 addAlgorithm( new QgsZonalStatisticsAlgorithm() );
545 addAlgorithm( new QgsZonalStatisticsFeatureBasedAlgorithm() );
546 addAlgorithm( new QgsPolygonsToLinesAlgorithm() );
547 addAlgorithm( new QgsDensifyGeometriesByIntervalAlgorithm() );
548 addAlgorithm( new QgsDensifyGeometriesByCountAlgorithm() );
549}
550
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.
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.