2014-04-17 01:41:25 +02:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
|
|
|
|
"""
|
|
|
|
***************************************************************************
|
2018-01-15 11:58:03 +02:00
|
|
|
QgisAlgorithmProvider.py
|
2014-04-17 01:41:25 +02:00
|
|
|
---------------------
|
|
|
|
Date : December 2012
|
|
|
|
Copyright : (C) 2012 by Victor Olaya
|
|
|
|
Email : volayaf at gmail dot com
|
|
|
|
***************************************************************************
|
|
|
|
* *
|
|
|
|
* This program is free software; you can redistribute it and/or modify *
|
|
|
|
* it under the terms of the GNU General Public License as published by *
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or *
|
|
|
|
* (at your option) any later version. *
|
|
|
|
* *
|
|
|
|
***************************************************************************
|
|
|
|
"""
|
2014-09-19 17:12:57 +03:00
|
|
|
|
2014-04-17 01:41:25 +02:00
|
|
|
__author__ = 'Victor Olaya'
|
|
|
|
__date__ = 'December 2012'
|
|
|
|
__copyright__ = '(C) 2012, Victor Olaya'
|
|
|
|
|
|
|
|
# This will get replaced with a git SHA1 when you do a git archive
|
|
|
|
|
|
|
|
__revision__ = '$Format:%H$'
|
|
|
|
|
2014-09-19 17:12:57 +03:00
|
|
|
import os
|
2018-06-20 07:28:29 +10:00
|
|
|
import warnings
|
2014-09-19 17:12:57 +03:00
|
|
|
|
2015-01-17 14:57:21 +02:00
|
|
|
try:
|
2018-06-20 07:28:29 +10:00
|
|
|
# importing plotly throws Python warnings from within the library - filter these out
|
|
|
|
with warnings.catch_warnings():
|
|
|
|
warnings.filterwarnings("ignore", category=ResourceWarning)
|
2018-06-22 14:26:55 +10:00
|
|
|
warnings.filterwarnings("ignore", category=ImportWarning)
|
2018-06-20 07:28:29 +10:00
|
|
|
import plotly # NOQA
|
|
|
|
hasPlotly = True
|
2015-01-17 14:57:21 +02:00
|
|
|
except:
|
2017-02-10 11:14:09 +02:00
|
|
|
hasPlotly = False
|
2015-01-17 14:57:21 +02:00
|
|
|
|
2017-04-04 12:58:25 +10:00
|
|
|
from qgis.core import (QgsApplication,
|
|
|
|
QgsProcessingProvider)
|
2016-02-17 09:36:59 +02:00
|
|
|
|
2018-03-01 08:07:07 -05:00
|
|
|
from PyQt5.QtCore import QCoreApplication
|
|
|
|
|
2018-01-29 16:46:48 +02:00
|
|
|
from processing.script import ScriptUtils
|
2014-09-19 17:12:57 +03:00
|
|
|
|
2017-05-22 15:46:50 +10:00
|
|
|
from .QgisAlgorithm import QgisAlgorithm
|
|
|
|
|
2017-06-22 18:17:56 +10:00
|
|
|
from .AddTableField import AddTableField
|
2017-05-04 13:38:14 +02:00
|
|
|
from .Aggregate import Aggregate
|
2017-06-22 18:17:56 +10:00
|
|
|
from .Aspect import Aspect
|
|
|
|
from .BasicStatistics import BasicStatisticsForField
|
|
|
|
from .CheckValidity import CheckValidity
|
2017-07-01 18:00:57 +10:00
|
|
|
from .ConcaveHull import ConcaveHull
|
2017-06-22 18:17:56 +10:00
|
|
|
from .CreateAttributeIndex import CreateAttributeIndex
|
2017-07-27 16:02:52 +10:00
|
|
|
from .CreateConstantRaster import CreateConstantRaster
|
2017-08-19 01:26:55 +10:00
|
|
|
from .Datasources2Vrt import Datasources2Vrt
|
2017-08-20 01:00:59 +10:00
|
|
|
from .DefineProjection import DefineProjection
|
2017-07-01 18:00:51 +10:00
|
|
|
from .Delaunay import Delaunay
|
2017-06-22 18:17:56 +10:00
|
|
|
from .DeleteColumn import DeleteColumn
|
2017-07-28 11:04:12 +10:00
|
|
|
from .DeleteDuplicateGeometries import DeleteDuplicateGeometries
|
2017-06-22 18:17:56 +10:00
|
|
|
from .DensifyGeometries import DensifyGeometries
|
2017-08-04 00:37:14 +10:00
|
|
|
from .EliminateSelection import EliminateSelection
|
2017-08-20 01:37:27 +10:00
|
|
|
from .ExecuteSQL import ExecuteSQL
|
2017-07-27 11:21:24 +10:00
|
|
|
from .ExportGeometryInfo import ExportGeometryInfo
|
2017-06-22 18:17:56 +10:00
|
|
|
from .ExtentFromLayer import ExtentFromLayer
|
2018-01-29 19:16:43 +07:00
|
|
|
from .ExtractSpecificVertices import ExtractSpecificVertices
|
2017-08-19 23:31:31 +10:00
|
|
|
from .FieldPyculator import FieldsPyculator
|
2017-08-19 23:19:38 +10:00
|
|
|
from .FieldsCalculator import FieldsCalculator
|
2017-08-05 13:36:59 +02:00
|
|
|
from .FieldsMapper import FieldsMapper
|
2017-08-20 00:48:26 +10:00
|
|
|
from .FindProjection import FindProjection
|
2017-08-20 02:21:45 +10:00
|
|
|
from .GeometryConvert import GeometryConvert
|
2017-07-20 15:25:55 +10:00
|
|
|
from .GeometryByExpression import GeometryByExpression
|
2018-01-23 13:54:53 +07:00
|
|
|
from .Grid import Grid
|
2017-07-12 10:22:45 +03:00
|
|
|
from .Heatmap import Heatmap
|
2017-07-14 17:57:15 +03:00
|
|
|
from .Hillshade import Hillshade
|
2017-08-03 18:55:30 +10:00
|
|
|
from .HubDistanceLines import HubDistanceLines
|
2017-08-03 01:34:28 +10:00
|
|
|
from .HubDistancePoints import HubDistancePoints
|
2017-08-18 15:35:27 +10:00
|
|
|
from .HypsometricCurves import HypsometricCurves
|
2017-08-19 04:03:50 +10:00
|
|
|
from .IdwInterpolation import IdwInterpolation
|
2017-06-22 18:20:14 +10:00
|
|
|
from .ImportIntoPostGIS import ImportIntoPostGIS
|
2017-06-26 10:22:51 +07:00
|
|
|
from .ImportIntoSpatialite import ImportIntoSpatialite
|
2018-02-04 14:46:01 +02:00
|
|
|
from .KeepNBiggestParts import KeepNBiggestParts
|
2018-08-15 20:52:32 +02:00
|
|
|
from .KNearestConcaveHull import KNearestConcaveHull
|
2017-07-14 14:44:38 +07:00
|
|
|
from .LinesToPolygons import LinesToPolygons
|
2017-09-03 14:46:16 +10:00
|
|
|
from .MinimumBoundingGeometry import MinimumBoundingGeometry
|
2017-07-15 16:13:44 +10:00
|
|
|
from .NearestNeighbourAnalysis import NearestNeighbourAnalysis
|
2017-07-16 20:39:43 +10:00
|
|
|
from .Orthogonalize import Orthogonalize
|
2017-07-15 20:28:59 +10:00
|
|
|
from .PointDistance import PointDistance
|
2017-07-28 12:05:05 +10:00
|
|
|
from .PointsAlongGeometry import PointsAlongGeometry
|
2017-08-08 23:23:49 +10:00
|
|
|
from .PointsDisplacement import PointsDisplacement
|
2017-08-09 00:24:49 +10:00
|
|
|
from .PointsFromLines import PointsFromLines
|
2017-08-09 00:17:27 +10:00
|
|
|
from .PointsFromPolygons import PointsFromPolygons
|
2017-07-15 14:23:07 +10:00
|
|
|
from .PointsInPolygon import PointsInPolygon
|
2017-06-28 16:24:47 +10:00
|
|
|
from .PointsLayerFromTable import PointsLayerFromTable
|
2017-08-03 23:26:39 +10:00
|
|
|
from .PointsToPaths import PointsToPaths
|
2017-07-16 20:39:43 +10:00
|
|
|
from .PoleOfInaccessibility import PoleOfInaccessibility
|
2017-07-27 14:56:39 +10:00
|
|
|
from .Polygonize import Polygonize
|
2017-06-22 18:20:36 +10:00
|
|
|
from .PostGISExecuteSQL import PostGISExecuteSQL
|
2018-05-28 19:05:01 +02:00
|
|
|
from .PostGISExecuteAndLoadSQL import PostGISExecuteAndLoadSQL
|
2017-06-22 18:23:38 +10:00
|
|
|
from .RandomExtract import RandomExtract
|
|
|
|
from .RandomExtractWithinSubsets import RandomExtractWithinSubsets
|
2017-07-21 15:22:37 +03:00
|
|
|
from .RandomPointsAlongLines import RandomPointsAlongLines
|
2017-07-21 10:29:01 +03:00
|
|
|
from .RandomPointsExtent import RandomPointsExtent
|
2017-07-21 11:15:31 +03:00
|
|
|
from .RandomPointsLayer import RandomPointsLayer
|
2017-07-21 14:29:42 +03:00
|
|
|
from .RandomPointsPolygons import RandomPointsPolygons
|
2017-08-02 23:09:47 +10:00
|
|
|
from .RandomSelection import RandomSelection
|
|
|
|
from .RandomSelectionWithinSubsets import RandomSelectionWithinSubsets
|
2017-08-07 21:26:44 +02:00
|
|
|
from .Rasterize import RasterizeAlgorithm
|
2017-08-20 02:07:32 +10:00
|
|
|
from .RasterCalculator import RasterCalculator
|
2017-07-28 16:02:32 +03:00
|
|
|
from .RasterLayerStatistics import RasterLayerStatistics
|
2018-07-10 15:19:56 +02:00
|
|
|
from .RasterSampling import RasterSampling
|
2017-08-19 02:37:39 +10:00
|
|
|
from .RectanglesOvalsDiamondsFixed import RectanglesOvalsDiamondsFixed
|
|
|
|
from .RectanglesOvalsDiamondsVariable import RectanglesOvalsDiamondsVariable
|
2017-06-22 18:20:56 +10:00
|
|
|
from .RegularPoints import RegularPoints
|
2017-08-19 00:01:58 +10:00
|
|
|
from .Relief import Relief
|
2017-07-14 17:50:40 +03:00
|
|
|
from .Ruggedness import Ruggedness
|
2017-06-27 11:42:58 +10:00
|
|
|
from .SelectByAttribute import SelectByAttribute
|
2017-06-27 13:02:20 +10:00
|
|
|
from .SelectByExpression import SelectByExpression
|
2017-07-16 11:51:51 +03:00
|
|
|
from .ServiceAreaFromLayer import ServiceAreaFromLayer
|
2017-07-16 11:44:11 +03:00
|
|
|
from .ServiceAreaFromPoint import ServiceAreaFromPoint
|
2017-07-17 11:31:34 +10:00
|
|
|
from .SetMValue import SetMValue
|
2017-08-19 00:30:32 +10:00
|
|
|
from .SetRasterStyle import SetRasterStyle
|
2017-08-19 00:23:25 +10:00
|
|
|
from .SetVectorStyle import SetVectorStyle
|
2017-07-17 11:31:34 +10:00
|
|
|
from .SetZValue import SetZValue
|
2017-07-20 14:53:02 +10:00
|
|
|
from .SingleSidedBuffer import SingleSidedBuffer
|
2017-07-14 17:46:12 +03:00
|
|
|
from .Slope import Slope
|
2017-07-01 15:44:34 +10:00
|
|
|
from .SnapGeometries import SnapGeometriesToLayer
|
2017-06-26 10:22:51 +07:00
|
|
|
from .SpatialiteExecuteSQL import SpatialiteExecuteSQL
|
2017-07-27 14:30:40 +10:00
|
|
|
from .SpatialIndex import SpatialIndex
|
2017-09-13 08:01:56 +10:00
|
|
|
from .SpatialJoin import SpatialJoin
|
2017-09-13 18:45:56 +10:00
|
|
|
from .SpatialJoinSummary import SpatialJoinSummary
|
2017-08-05 07:01:06 +10:00
|
|
|
from .StatisticsByCategories import StatisticsByCategories
|
2017-07-15 15:18:23 +10:00
|
|
|
from .SumLines import SumLines
|
2017-07-27 12:10:16 +10:00
|
|
|
from .TextToFloat import TextToFloat
|
2019-04-24 13:11:36 +02:00
|
|
|
from .TilesXYZ import TilesXYZ
|
2017-08-19 04:56:48 +10:00
|
|
|
from .TinInterpolation import TinInterpolation
|
2017-08-04 00:03:41 +10:00
|
|
|
from .TopoColors import TopoColor
|
2017-07-27 14:43:42 +10:00
|
|
|
from .TruncateTable import TruncateTable
|
2017-07-15 22:07:12 +10:00
|
|
|
from .UniqueValues import UniqueValues
|
2017-07-28 14:10:48 +10:00
|
|
|
from .VariableDistanceBuffer import VariableDistanceBuffer
|
2017-06-22 18:23:07 +10:00
|
|
|
from .VectorSplit import VectorSplit
|
2017-07-01 16:30:25 +10:00
|
|
|
from .VoronoiPolygons import VoronoiPolygons
|
2017-06-29 09:49:46 +07:00
|
|
|
from .ZonalStatistics import ZonalStatistics
|
2017-06-22 18:17:56 +10:00
|
|
|
|
2014-04-17 01:41:25 +02:00
|
|
|
|
2015-05-18 19:51:26 +03:00
|
|
|
pluginPath = os.path.normpath(os.path.join(
|
|
|
|
os.path.split(os.path.dirname(__file__))[0], os.pardir))
|
2015-02-03 11:22:34 +02:00
|
|
|
|
2014-04-17 01:41:25 +02:00
|
|
|
|
2018-01-15 11:58:03 +02:00
|
|
|
class QgisAlgorithmProvider(QgsProcessingProvider):
|
2018-03-01 08:07:07 -05:00
|
|
|
fieldMappingParameterName = QCoreApplication.translate('Processing', 'Fields Mapper')
|
2014-04-17 01:41:25 +02:00
|
|
|
|
|
|
|
def __init__(self):
|
2017-01-09 09:18:25 +10:00
|
|
|
super().__init__()
|
2017-04-04 11:04:36 +10:00
|
|
|
self.algs = []
|
2017-04-04 09:46:46 +10:00
|
|
|
self.externalAlgs = []
|
2016-01-20 17:00:11 +01:00
|
|
|
|
2017-04-04 09:46:46 +10:00
|
|
|
def getAlgs(self):
|
2017-06-06 12:36:10 +10:00
|
|
|
algs = [AddTableField(),
|
2017-05-04 13:38:14 +02:00
|
|
|
Aggregate(),
|
2017-06-06 13:41:42 +10:00
|
|
|
Aspect(),
|
2017-06-07 07:12:25 +10:00
|
|
|
BasicStatisticsForField(),
|
2017-06-07 07:47:07 +10:00
|
|
|
CheckValidity(),
|
2017-07-01 18:00:57 +10:00
|
|
|
ConcaveHull(),
|
2017-06-21 22:14:39 +10:00
|
|
|
CreateAttributeIndex(),
|
2017-07-27 16:02:52 +10:00
|
|
|
CreateConstantRaster(),
|
2017-08-19 01:26:55 +10:00
|
|
|
Datasources2Vrt(),
|
2017-08-20 01:00:59 +10:00
|
|
|
DefineProjection(),
|
2017-07-01 18:00:51 +10:00
|
|
|
Delaunay(),
|
2017-06-06 17:26:29 +10:00
|
|
|
DeleteColumn(),
|
2017-07-28 11:04:12 +10:00
|
|
|
DeleteDuplicateGeometries(),
|
2017-06-21 22:11:31 +10:00
|
|
|
DensifyGeometries(),
|
2017-08-04 00:37:14 +10:00
|
|
|
EliminateSelection(),
|
2017-08-20 01:37:27 +10:00
|
|
|
ExecuteSQL(),
|
2017-07-27 11:21:24 +10:00
|
|
|
ExportGeometryInfo(),
|
2017-06-09 15:05:25 +10:00
|
|
|
ExtentFromLayer(),
|
2018-01-29 19:16:43 +07:00
|
|
|
ExtractSpecificVertices(),
|
2017-08-19 23:19:38 +10:00
|
|
|
FieldsCalculator(),
|
2017-07-21 19:46:27 +02:00
|
|
|
FieldsMapper(),
|
2017-08-19 23:31:31 +10:00
|
|
|
FieldsPyculator(),
|
2017-08-20 00:48:26 +10:00
|
|
|
FindProjection(),
|
2017-07-20 15:25:55 +10:00
|
|
|
GeometryByExpression(),
|
2017-08-20 02:21:45 +10:00
|
|
|
GeometryConvert(),
|
2018-01-23 13:54:53 +07:00
|
|
|
Grid(),
|
2017-07-15 14:23:07 +10:00
|
|
|
Heatmap(),
|
2017-07-14 17:57:15 +03:00
|
|
|
Hillshade(),
|
2017-08-03 18:55:30 +10:00
|
|
|
HubDistanceLines(),
|
2017-08-03 01:34:28 +10:00
|
|
|
HubDistancePoints(),
|
2017-08-18 15:35:27 +10:00
|
|
|
HypsometricCurves(),
|
2017-08-19 04:03:50 +10:00
|
|
|
IdwInterpolation(),
|
2017-06-22 18:20:14 +10:00
|
|
|
ImportIntoPostGIS(),
|
2017-06-26 10:22:51 +07:00
|
|
|
ImportIntoSpatialite(),
|
2018-02-04 14:46:01 +02:00
|
|
|
KeepNBiggestParts(),
|
2018-08-15 20:52:32 +02:00
|
|
|
KNearestConcaveHull(),
|
2017-07-14 14:44:38 +07:00
|
|
|
LinesToPolygons(),
|
2017-09-03 14:46:16 +10:00
|
|
|
MinimumBoundingGeometry(),
|
2017-07-15 16:13:44 +10:00
|
|
|
NearestNeighbourAnalysis(),
|
2017-07-16 20:39:43 +10:00
|
|
|
Orthogonalize(),
|
2017-07-15 20:28:59 +10:00
|
|
|
PointDistance(),
|
2017-07-28 12:05:05 +10:00
|
|
|
PointsAlongGeometry(),
|
2017-08-08 23:23:49 +10:00
|
|
|
PointsDisplacement(),
|
2017-08-09 00:24:49 +10:00
|
|
|
PointsFromLines(),
|
2017-08-09 00:17:27 +10:00
|
|
|
PointsFromPolygons(),
|
2017-07-15 14:23:07 +10:00
|
|
|
PointsInPolygon(),
|
2017-06-28 16:24:47 +10:00
|
|
|
PointsLayerFromTable(),
|
2017-08-03 23:26:39 +10:00
|
|
|
PointsToPaths(),
|
2017-07-16 20:39:43 +10:00
|
|
|
PoleOfInaccessibility(),
|
2017-07-27 14:56:39 +10:00
|
|
|
Polygonize(),
|
2017-06-22 18:20:56 +10:00
|
|
|
PostGISExecuteSQL(),
|
2018-05-28 19:05:01 +02:00
|
|
|
PostGISExecuteAndLoadSQL(),
|
2017-06-22 18:23:38 +10:00
|
|
|
RandomExtract(),
|
|
|
|
RandomExtractWithinSubsets(),
|
2017-07-21 15:22:37 +03:00
|
|
|
RandomPointsAlongLines(),
|
2017-07-21 10:29:01 +03:00
|
|
|
RandomPointsExtent(),
|
2017-07-21 11:15:31 +03:00
|
|
|
RandomPointsLayer(),
|
2017-07-21 14:29:42 +03:00
|
|
|
RandomPointsPolygons(),
|
2017-08-02 23:09:47 +10:00
|
|
|
RandomSelection(),
|
|
|
|
RandomSelectionWithinSubsets(),
|
2017-08-20 02:07:32 +10:00
|
|
|
RasterCalculator(),
|
2017-08-07 21:26:44 +02:00
|
|
|
RasterizeAlgorithm(),
|
2017-07-28 16:02:32 +03:00
|
|
|
RasterLayerStatistics(),
|
2018-07-10 15:19:56 +02:00
|
|
|
RasterSampling(),
|
2017-08-19 02:37:39 +10:00
|
|
|
RectanglesOvalsDiamondsFixed(),
|
|
|
|
RectanglesOvalsDiamondsVariable(),
|
2017-06-22 18:21:16 +10:00
|
|
|
RegularPoints(),
|
2017-08-19 00:01:58 +10:00
|
|
|
Relief(),
|
2017-07-14 17:50:40 +03:00
|
|
|
Ruggedness(),
|
2017-06-27 11:42:58 +10:00
|
|
|
SelectByAttribute(),
|
2017-06-27 13:02:20 +10:00
|
|
|
SelectByExpression(),
|
2017-07-16 11:51:51 +03:00
|
|
|
ServiceAreaFromLayer(),
|
2017-07-16 11:44:11 +03:00
|
|
|
ServiceAreaFromPoint(),
|
2017-07-17 11:31:34 +10:00
|
|
|
SetMValue(),
|
2017-08-19 00:30:32 +10:00
|
|
|
SetRasterStyle(),
|
2017-08-19 00:23:25 +10:00
|
|
|
SetVectorStyle(),
|
2017-07-17 11:31:34 +10:00
|
|
|
SetZValue(),
|
2017-07-20 14:53:02 +10:00
|
|
|
SingleSidedBuffer(),
|
2017-07-14 17:46:12 +03:00
|
|
|
Slope(),
|
2017-07-01 15:44:34 +10:00
|
|
|
SnapGeometriesToLayer(),
|
2017-06-26 10:22:51 +07:00
|
|
|
SpatialiteExecuteSQL(),
|
2017-07-27 14:30:40 +10:00
|
|
|
SpatialIndex(),
|
2017-09-13 08:01:56 +10:00
|
|
|
SpatialJoin(),
|
2017-09-13 18:45:56 +10:00
|
|
|
SpatialJoinSummary(),
|
2017-08-05 07:01:06 +10:00
|
|
|
StatisticsByCategories(),
|
2017-07-15 15:18:23 +10:00
|
|
|
SumLines(),
|
2017-07-27 12:10:16 +10:00
|
|
|
TextToFloat(),
|
2019-04-24 13:11:36 +02:00
|
|
|
TilesXYZ(),
|
2017-08-19 04:56:48 +10:00
|
|
|
TinInterpolation(),
|
2017-08-04 00:03:41 +10:00
|
|
|
TopoColor(),
|
2017-07-27 14:43:42 +10:00
|
|
|
TruncateTable(),
|
2017-07-15 22:07:12 +10:00
|
|
|
UniqueValues(),
|
2017-07-28 14:10:48 +10:00
|
|
|
VariableDistanceBuffer(),
|
2017-06-27 18:09:44 +07:00
|
|
|
VectorSplit(),
|
2017-07-01 16:30:25 +10:00
|
|
|
VoronoiPolygons(),
|
2017-07-15 14:23:07 +10:00
|
|
|
ZonalStatistics()
|
2017-06-06 16:06:27 +10:00
|
|
|
]
|
2015-01-17 14:57:21 +02:00
|
|
|
|
2017-06-06 15:36:07 +10:00
|
|
|
if hasPlotly:
|
|
|
|
from .BarPlot import BarPlot
|
2017-08-30 07:28:25 +10:00
|
|
|
from .BoxPlot import BoxPlot
|
|
|
|
from .MeanAndStdDevPlot import MeanAndStdDevPlot
|
|
|
|
from .PolarPlot import PolarPlot
|
|
|
|
from .RasterLayerHistogram import RasterLayerHistogram
|
|
|
|
from .VectorLayerHistogram import VectorLayerHistogram
|
|
|
|
from .VectorLayerScatterplot import VectorLayerScatterplot
|
|
|
|
from .VectorLayerScatterplot3D import VectorLayerScatterplot3D
|
|
|
|
|
|
|
|
algs.extend([BarPlot(),
|
|
|
|
BoxPlot(),
|
|
|
|
MeanAndStdDevPlot(),
|
|
|
|
PolarPlot(),
|
|
|
|
RasterLayerHistogram(),
|
|
|
|
VectorLayerHistogram(),
|
|
|
|
VectorLayerScatterplot(),
|
|
|
|
VectorLayerScatterplot3D()])
|
2015-01-17 14:57:21 +02:00
|
|
|
|
2017-02-15 19:46:18 +02:00
|
|
|
# to store algs added by 3rd party plugins as scripts
|
2018-01-29 16:46:48 +02:00
|
|
|
#folder = os.path.join(os.path.dirname(__file__), 'scripts')
|
|
|
|
#scripts = ScriptUtils.loadFromFolder(folder)
|
|
|
|
#for script in scripts:
|
|
|
|
# script.allowEdit = False
|
|
|
|
#algs.extend(scripts)
|
2014-04-17 01:41:25 +02:00
|
|
|
|
2017-04-04 09:46:46 +10:00
|
|
|
return algs
|
2014-04-17 01:41:25 +02:00
|
|
|
|
2017-01-09 09:18:25 +10:00
|
|
|
def id(self):
|
2014-04-17 01:41:25 +02:00
|
|
|
return 'qgis'
|
|
|
|
|
2018-09-25 13:33:51 +10:00
|
|
|
def helpId(self):
|
|
|
|
return 'qgis'
|
|
|
|
|
2017-01-09 09:18:25 +10:00
|
|
|
def name(self):
|
2016-12-29 15:16:37 +02:00
|
|
|
return 'QGIS'
|
2014-04-17 01:41:25 +02:00
|
|
|
|
2017-01-09 09:18:25 +10:00
|
|
|
def icon(self):
|
2017-01-09 12:34:46 +10:00
|
|
|
return QgsApplication.getThemeIcon("/providerQgis.svg")
|
|
|
|
|
|
|
|
def svgIconPath(self):
|
|
|
|
return QgsApplication.iconPath("providerQgis.svg")
|
2014-04-17 01:41:25 +02:00
|
|
|
|
2017-04-04 09:46:46 +10:00
|
|
|
def loadAlgorithms(self):
|
2017-04-04 11:04:36 +10:00
|
|
|
self.algs = self.getAlgs()
|
|
|
|
for a in self.algs:
|
2017-04-04 09:46:46 +10:00
|
|
|
self.addAlgorithm(a)
|
|
|
|
for a in self.externalAlgs:
|
|
|
|
self.addAlgorithm(a)
|
2014-04-17 01:41:25 +02:00
|
|
|
|
2018-03-01 08:07:07 -05:00
|
|
|
def load(self):
|
|
|
|
success = super().load()
|
|
|
|
|
|
|
|
if success:
|
2018-03-03 11:16:35 -05:00
|
|
|
self.parameterTypeFieldsMapping = FieldsMapper.ParameterFieldsMappingType()
|
|
|
|
QgsApplication.instance().processingRegistry().addParameterType(self.parameterTypeFieldsMapping)
|
2018-03-01 08:07:07 -05:00
|
|
|
|
|
|
|
return success
|
|
|
|
|
|
|
|
def unload(self):
|
|
|
|
super().unload()
|
|
|
|
|
2018-03-03 11:16:35 -05:00
|
|
|
QgsApplication.instance().processingRegistry().removeParameterType(self.parameterTypeFieldsMapping)
|
2018-03-01 08:07:07 -05:00
|
|
|
|
2014-04-17 01:41:25 +02:00
|
|
|
def supportsNonFileBasedOutput(self):
|
|
|
|
return True
|