mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-15 00:04:00 -04:00
Merge pull request #4311 from nyalldawson/proc_c4
Simple c++ base class for processing algorithms
This commit is contained in:
commit
51517fd77e
@ -273,6 +273,7 @@
|
||||
%Include layertree/qgslayertreeregistrybridge.sip
|
||||
%Include layertree/qgslayertreeutils.sip
|
||||
|
||||
%Include processing/qgsprocessingalgorithm.sip
|
||||
%Include processing/qgsprocessingfeedback.sip
|
||||
%Include processing/qgsprocessingprovider.sip
|
||||
%Include processing/qgsprocessingregistry.sip
|
||||
|
99
python/core/processing/qgsprocessingalgorithm.sip
Normal file
99
python/core/processing/qgsprocessingalgorithm.sip
Normal file
@ -0,0 +1,99 @@
|
||||
/************************************************************************
|
||||
* This file has been generated automatically from *
|
||||
* *
|
||||
* src/core/processing/qgsprocessingalgorithm.h *
|
||||
* *
|
||||
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
||||
************************************************************************/
|
||||
|
||||
|
||||
|
||||
|
||||
class QgsProcessingAlgorithm
|
||||
{
|
||||
%Docstring
|
||||
Abstract base class for processing algorithms.
|
||||
.. versionadded:: 3.0
|
||||
%End
|
||||
|
||||
%TypeHeaderCode
|
||||
#include "qgsprocessingalgorithm.h"
|
||||
%End
|
||||
public:
|
||||
|
||||
enum Flag
|
||||
{
|
||||
FlagHideFromToolbox,
|
||||
FlagHideFromModeler,
|
||||
FlagSupportsBatch,
|
||||
FlagDeprecated
|
||||
};
|
||||
typedef QFlags<QgsProcessingAlgorithm::Flag> Flags;
|
||||
|
||||
QgsProcessingAlgorithm();
|
||||
%Docstring
|
||||
Constructor for QgsProcessingAlgorithm.
|
||||
%End
|
||||
|
||||
virtual ~QgsProcessingAlgorithm();
|
||||
|
||||
virtual QString name() const = 0;
|
||||
%Docstring
|
||||
Returns the algorithm name, used for identifying the algorithm. This string
|
||||
should be fixed for the algorithm, and must not be localised. The name should
|
||||
be unique within each provider. Names should contain lowercase alphanumeric characters
|
||||
only and no spaces or other formatting characters.
|
||||
\see displayName()
|
||||
\see group()
|
||||
\see tags()
|
||||
%End
|
||||
|
||||
virtual QString displayName() const = 0;
|
||||
%Docstring
|
||||
Returns the translated algorithm name, which should be used for any user-visible display
|
||||
of the algorithm name.
|
||||
\see name()
|
||||
%End
|
||||
|
||||
virtual QStringList tags() const;
|
||||
%Docstring
|
||||
Returns a list of tags which relate to the algorithm, and are used to assist users in searching
|
||||
for suitable algorithms. These tags should be localised.
|
||||
%End
|
||||
|
||||
virtual QIcon icon() const;
|
||||
%Docstring
|
||||
Returns an icon for the algorithm.
|
||||
\see svgIconPath()
|
||||
%End
|
||||
|
||||
virtual QString svgIconPath() const;
|
||||
%Docstring
|
||||
Returns a path to an SVG version of the algorithm's icon.
|
||||
\see icon()
|
||||
%End
|
||||
|
||||
virtual QString group() const;
|
||||
%Docstring
|
||||
Returns the name of the group this algorithm belongs to. This string
|
||||
should be localised.
|
||||
\see tags()
|
||||
%End
|
||||
|
||||
virtual Flags flags() const;
|
||||
%Docstring
|
||||
Returns the flags indicating how and when the algorithm operates and should be exposed to users.
|
||||
%End
|
||||
|
||||
};
|
||||
QFlags<QgsProcessingAlgorithm::Flag> operator|(QgsProcessingAlgorithm::Flag f1, QFlags<QgsProcessingAlgorithm::Flag> f2);
|
||||
|
||||
|
||||
|
||||
/************************************************************************
|
||||
* This file has been generated automatically from *
|
||||
* *
|
||||
* src/core/processing/qgsprocessingalgorithm.h *
|
||||
* *
|
||||
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
||||
************************************************************************/
|
@ -66,6 +66,35 @@ class QgsProcessingProvider
|
||||
missing external dependencies).
|
||||
%End
|
||||
|
||||
virtual QStringList supportedOutputRasterLayerExtensions() const;
|
||||
%Docstring
|
||||
Returns a list of the raster format file extensions supported by this provider.
|
||||
\see supportedOutputVectorLayerExtensions()
|
||||
\see supportedOutputTableExtensions()
|
||||
%End
|
||||
|
||||
virtual QStringList supportedOutputVectorLayerExtensions() const;
|
||||
%Docstring
|
||||
Returns a list of the vector format file extensions supported by this provider.
|
||||
\see supportedOutputRasterLayerExtensions()
|
||||
\see supportedOutputTableExtensions()
|
||||
\see supportsNonFileBasedOutput()
|
||||
%End
|
||||
|
||||
virtual QStringList supportedOutputTableExtensions() const;
|
||||
%Docstring
|
||||
Returns a list of the table format file extensions supported by this provider.
|
||||
\see supportedOutputRasterLayerExtensions()
|
||||
\see supportedOutputVectorLayerExtensions()
|
||||
%End
|
||||
|
||||
virtual bool supportsNonFileBasedOutput() const;
|
||||
%Docstring
|
||||
Returns true if the provider supports non-file based outputs (such as memory layers
|
||||
or direct database outputs).
|
||||
\see supportedOutputVectorLayerExtensions()
|
||||
%End
|
||||
|
||||
private:
|
||||
QgsProcessingProvider( const QgsProcessingProvider &other );
|
||||
};
|
||||
|
@ -54,17 +54,22 @@ class ExampleAlgorithm(GeoAlgorithm):
|
||||
OUTPUT_LAYER = 'OUTPUT_LAYER'
|
||||
INPUT_LAYER = 'INPUT_LAYER'
|
||||
|
||||
def name(self):
|
||||
# Unique (non-user visible) name of algorithm
|
||||
return 'create_copy_of_layer'
|
||||
|
||||
def displayName(self):
|
||||
# The name that the user will see in the toolbox
|
||||
return self.tr('Create copy of layer')
|
||||
|
||||
def group(self):
|
||||
return self.tr('Algorithms for vector layers')
|
||||
|
||||
def defineCharacteristics(self):
|
||||
"""Here we define the inputs and output of the algorithm, along
|
||||
with some other properties.
|
||||
"""
|
||||
|
||||
# The name that the user will see in the toolbox
|
||||
self.name, self.i18n_name = self.trAlgorithm('Create copy of layer')
|
||||
|
||||
# The branch of the toolbox under which the algorithm will appear
|
||||
self.group, self.i18n_group = self.trAlgorithm('Algorithms for vector layers')
|
||||
|
||||
# We add the input vector layer. It can have any kind of geometry
|
||||
# It is a mandatory (not optional) one, hence the False argument
|
||||
self.addParameter(ParameterVector(self.INPUT_LAYER,
|
||||
|
@ -46,13 +46,19 @@ class AssignProjection(GdalAlgorithm):
|
||||
CRS = 'CRS'
|
||||
OUTPUT = 'OUTPUT'
|
||||
|
||||
def getIcon(self):
|
||||
def name(self):
|
||||
return 'assignprojection'
|
||||
|
||||
def displayName(self):
|
||||
return self.tr('Assign projection')
|
||||
|
||||
def icon(self):
|
||||
return QIcon(os.path.join(pluginPath, 'images', 'gdaltools', 'projection-add.png'))
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name, self.i18n_name = self.trAlgorithm('Assign projection')
|
||||
self.group, self.i18n_group = self.trAlgorithm('Raster projections')
|
||||
def group(self):
|
||||
return self.tr('Raster projections')
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.addParameter(ParameterRaster(self.INPUT, self.tr('Input layer'), False))
|
||||
self.addParameter(ParameterCrs(self.CRS,
|
||||
self.tr('Desired CRS'), ''))
|
||||
|
@ -53,13 +53,19 @@ class ClipByExtent(GdalAlgorithm):
|
||||
RTYPE = 'RTYPE'
|
||||
TYPE = ['Byte', 'Int16', 'UInt16', 'UInt32', 'Int32', 'Float32', 'Float64']
|
||||
|
||||
def getIcon(self):
|
||||
def name(self):
|
||||
return 'cliprasterbyextent'
|
||||
|
||||
def displayName(self):
|
||||
return self.tr('Clip raster by extent')
|
||||
|
||||
def icon(self):
|
||||
return QIcon(os.path.join(pluginPath, 'images', 'gdaltools', 'raster-clip.png'))
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name, self.i18n_name = self.trAlgorithm('Clip raster by extent')
|
||||
self.group, self.i18n_group = self.trAlgorithm('Raster extraction')
|
||||
def group(self):
|
||||
return self.tr('Raster extraction')
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.addParameter(ParameterRaster(self.INPUT, self.tr('Input layer')))
|
||||
self.addParameter(ParameterString(self.NO_DATA,
|
||||
self.tr("Nodata value, leave blank to take the nodata value from input"),
|
||||
|
@ -62,13 +62,19 @@ class ClipByMask(GdalAlgorithm):
|
||||
RTYPE = 'RTYPE'
|
||||
TYPE = ['Byte', 'Int16', 'UInt16', 'UInt32', 'Int32', 'Float32', 'Float64']
|
||||
|
||||
def getIcon(self):
|
||||
def name(self):
|
||||
return 'cliprasterbymasklayer'
|
||||
|
||||
def displayName(self):
|
||||
return self.tr('Clip raster by mask layer')
|
||||
|
||||
def icon(self):
|
||||
return QIcon(os.path.join(pluginPath, 'images', 'gdaltools', 'raster-clip.png'))
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name, self.i18n_name = self.trAlgorithm('Clip raster by mask layer')
|
||||
self.group, self.i18n_group = self.trAlgorithm('Raster extraction')
|
||||
def group(self):
|
||||
return self.tr('Raster extraction')
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.addParameter(ParameterRaster(self.INPUT, self.tr('Input layer'), False))
|
||||
self.addParameter(ParameterVector(self.MASK, self.tr('Mask layer'),
|
||||
[dataobjects.TYPE_VECTOR_POLYGON]))
|
||||
|
@ -47,13 +47,16 @@ class ColorRelief(GdalAlgorithm):
|
||||
|
||||
MATCHING_MODES = ['"0,0,0,0" RGBA', 'Exact color', 'Nearest color']
|
||||
|
||||
#def getIcon(self):
|
||||
# filepath = os.path.dirname(__file__) + '/icons/dem.png'
|
||||
# return QIcon(filepath)
|
||||
def name(self):
|
||||
return 'colorrelief'
|
||||
|
||||
def displayName(self):
|
||||
return self.tr('Color relief')
|
||||
|
||||
def group(self):
|
||||
return self.tr('Raster analysis')
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name, self.i18n_name = self.trAlgorithm('Color relief')
|
||||
self.group, self.i18n_group = self.trAlgorithm('Raster analysis')
|
||||
self.addParameter(ParameterRaster(self.INPUT, self.tr('Input layer')))
|
||||
self.addParameter(ParameterNumber(
|
||||
self.BAND, self.tr('Band number'), 1, 99, 1))
|
||||
|
@ -46,12 +46,12 @@ class GdalAlgorithm(GeoAlgorithm):
|
||||
|
||||
def __init__(self):
|
||||
GeoAlgorithm.__init__(self)
|
||||
self._icon = None
|
||||
|
||||
def getIcon(self):
|
||||
if self._icon is None:
|
||||
self._icon = QgsApplication.getThemeIcon("/providerGdal.svg")
|
||||
return self._icon
|
||||
def icon(self):
|
||||
return QgsApplication.getThemeIcon("/providerGdal.svg")
|
||||
|
||||
def svgIconPath(self):
|
||||
return QgsApplication.iconPath("providerGdal.svg")
|
||||
|
||||
def getCustomParametersDialog(self):
|
||||
return GdalAlgorithmDialog(self)
|
||||
|
@ -147,5 +147,5 @@ class GdalAlgorithmProvider(AlgorithmProvider):
|
||||
OffsetCurve(), Ogr2OgrTableToPostGisList(), OgrSql(),
|
||||
]
|
||||
|
||||
def getSupportedOutputRasterLayerExtensions(self):
|
||||
def supportedOutputRasterLayerExtensions(self):
|
||||
return GdalUtils.getSupportedRasterExtensions()
|
||||
|
@ -56,15 +56,22 @@ class GridAverage(GdalAlgorithm):
|
||||
|
||||
TYPE = ['Byte', 'Int16', 'UInt16', 'UInt32', 'Int32', 'Float32', 'Float64']
|
||||
|
||||
def getIcon(self):
|
||||
def name(self):
|
||||
return 'gridmovingaverage'
|
||||
|
||||
def displayName(self):
|
||||
return self.tr('Grid (Moving average)')
|
||||
|
||||
def icon(self):
|
||||
return QIcon(os.path.join(pluginPath, 'images', 'gdaltools', 'grid.png'))
|
||||
|
||||
def commandLineName(self):
|
||||
return "gdal:gridaverage"
|
||||
|
||||
def group(self):
|
||||
return self.tr('Raster analysis')
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name, self.i18n_name = self.trAlgorithm('Grid (Moving average)')
|
||||
self.group, self.i18n_group = self.trAlgorithm('Raster analysis')
|
||||
self.addParameter(ParameterVector(self.INPUT,
|
||||
self.tr('Input layer'), [dataobjects.TYPE_VECTOR_POINT]))
|
||||
self.addParameter(ParameterTableField(self.Z_FIELD,
|
||||
|
@ -61,15 +61,22 @@ class GridDataMetrics(GdalAlgorithm):
|
||||
DATA_METRICS = ['Minimum', 'Maximum', 'Range', 'Count', 'Average distance',
|
||||
'Average distance between points']
|
||||
|
||||
def getIcon(self):
|
||||
def name(self):
|
||||
return 'griddatametrics'
|
||||
|
||||
def displayName(self):
|
||||
return self.tr('Grid (Data metrics)')
|
||||
|
||||
def icon(self):
|
||||
return QIcon(os.path.join(pluginPath, 'images', 'gdaltools', 'grid.png'))
|
||||
|
||||
def commandLineName(self):
|
||||
return "gdal:griddatametrics"
|
||||
|
||||
def group(self):
|
||||
return self.tr('Raster analysis')
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name, self.i18n_name = self.trAlgorithm('Grid (Data metrics)')
|
||||
self.group, self.i18n_group = self.trAlgorithm('Raster analysis')
|
||||
self.addParameter(ParameterVector(self.INPUT,
|
||||
self.tr('Input layer'), [dataobjects.TYPE_VECTOR_POINT]))
|
||||
self.addParameter(ParameterTableField(self.Z_FIELD,
|
||||
|
@ -60,15 +60,19 @@ class GridInvDist(GdalAlgorithm):
|
||||
|
||||
TYPE = ['Byte', 'Int16', 'UInt16', 'UInt32', 'Int32', 'Float32', 'Float64']
|
||||
|
||||
def getIcon(self):
|
||||
def icon(self):
|
||||
return QIcon(os.path.join(pluginPath, 'images', 'gdaltools', 'grid.png'))
|
||||
|
||||
def commandLineName(self):
|
||||
return "gdal:gridinvdist"
|
||||
def name(self):
|
||||
return 'gridinvdist'
|
||||
|
||||
def displayName(self):
|
||||
return self.tr('Grid (Inverse distance to a power)')
|
||||
|
||||
def group(self):
|
||||
return self.tr('Raster analysis')
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name, self.i18n_name = self.trAlgorithm('Grid (Inverse distance to a power)')
|
||||
self.group, self.i18n_group = self.trAlgorithm('Raster analysis')
|
||||
self.addParameter(ParameterVector(self.INPUT,
|
||||
self.tr('Input layer'), [dataobjects.TYPE_VECTOR_POINT]))
|
||||
self.addParameter(ParameterTableField(self.Z_FIELD,
|
||||
|
@ -56,15 +56,19 @@ class GridNearest(GdalAlgorithm):
|
||||
|
||||
TYPE = ['Byte', 'Int16', 'UInt16', 'UInt32', 'Int32', 'Float32', 'Float64']
|
||||
|
||||
def getIcon(self):
|
||||
def icon(self):
|
||||
return QIcon(os.path.join(pluginPath, 'images', 'gdaltools', 'grid.png'))
|
||||
|
||||
def commandLineName(self):
|
||||
return "gdal:gridnearestneighbor"
|
||||
def name(self):
|
||||
return 'gridnearestneighbor'
|
||||
|
||||
def displayName(self):
|
||||
return self.tr('Grid (Nearest neighbor)')
|
||||
|
||||
def group(self):
|
||||
return self.tr('Raster analysis')
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name, self.i18n_name = self.trAlgorithm('Grid (Nearest neighbor)')
|
||||
self.group, self.i18n_group = self.trAlgorithm('Raster analysis')
|
||||
self.addParameter(ParameterVector(self.INPUT,
|
||||
self.tr('Input layer'), [dataobjects.TYPE_VECTOR_POINT]))
|
||||
self.addParameter(ParameterTableField(self.Z_FIELD,
|
||||
|
@ -48,9 +48,16 @@ class aspect(GdalAlgorithm):
|
||||
ZERO_FLAT = 'ZERO_FLAT'
|
||||
OUTPUT = 'OUTPUT'
|
||||
|
||||
def name(self):
|
||||
return 'aspect'
|
||||
|
||||
def displayName(self):
|
||||
return self.tr('Aspect')
|
||||
|
||||
def group(self):
|
||||
return self.tr('Raster analysis')
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name, self.i18n_name = self.trAlgorithm('Aspect')
|
||||
self.group, self.i18n_group = self.trAlgorithm('Raster analysis')
|
||||
self.addParameter(ParameterRaster(self.INPUT, self.tr('Input layer')))
|
||||
self.addParameter(ParameterNumber(
|
||||
self.BAND, self.tr('Band number'), 1, 99, 1))
|
||||
|
@ -51,12 +51,19 @@ class buildvrt(GdalAlgorithm):
|
||||
|
||||
RESOLUTION_OPTIONS = ['average', 'highest', 'lowest']
|
||||
|
||||
def getIcon(self):
|
||||
def name(self):
|
||||
return 'buildvirtualraster'
|
||||
|
||||
def displayName(self):
|
||||
return self.tr('Build Virtual Raster')
|
||||
|
||||
def icon(self):
|
||||
return QIcon(os.path.join(pluginPath, 'images', 'gdaltools', 'vrt.png'))
|
||||
|
||||
def group(self):
|
||||
return self.tr('Raster miscellaneous')
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name, self.i18n_name = self.trAlgorithm('Build Virtual Raster')
|
||||
self.group, self.i18n_group = self.trAlgorithm('Raster miscellaneous')
|
||||
self.addParameter(ParameterMultipleInput(self.INPUT,
|
||||
self.tr('Input layers'), dataobjects.TYPE_RASTER))
|
||||
self.addParameter(ParameterSelection(self.RESOLUTION,
|
||||
|
@ -51,12 +51,19 @@ class contour(GdalAlgorithm):
|
||||
FIELD_NAME = 'FIELD_NAME'
|
||||
EXTRA = 'EXTRA'
|
||||
|
||||
def getIcon(self):
|
||||
def name(self):
|
||||
return 'contour'
|
||||
|
||||
def displayName(self):
|
||||
return self.tr('Contour')
|
||||
|
||||
def icon(self):
|
||||
return QIcon(os.path.join(pluginPath, 'images', 'gdaltools', 'contour.png'))
|
||||
|
||||
def group(self):
|
||||
return self.tr('Raster extraction')
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name, self.i18n_name = self.trAlgorithm('Contour')
|
||||
self.group, self.i18n_group = self.trAlgorithm('Raster extraction')
|
||||
self.addParameter(ParameterRaster(self.INPUT_RASTER,
|
||||
self.tr('Input layer'), False))
|
||||
self.addParameter(ParameterNumber(self.INTERVAL,
|
||||
|
@ -44,12 +44,19 @@ class ExtractProjection(GdalAlgorithm):
|
||||
INPUT = 'INPUT'
|
||||
PRJ_FILE = 'PRJ_FILE'
|
||||
|
||||
def getIcon(self):
|
||||
def name(self):
|
||||
return 'extractprojection'
|
||||
|
||||
def displayName(self):
|
||||
return self.tr('Extract projection')
|
||||
|
||||
def icon(self):
|
||||
return QIcon(os.path.join(pluginPath, 'images', 'gdaltools', 'projection-export.png'))
|
||||
|
||||
def group(self):
|
||||
return self.tr('Raster projections')
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name, self.i18n_name = self.trAlgorithm('Extract projection')
|
||||
self.group, self.i18n_group = self.trAlgorithm('Raster projections')
|
||||
self.addParameter(ParameterRaster(self.INPUT, self.tr('Input file')))
|
||||
self.addParameter(ParameterBoolean(self.PRJ_FILE,
|
||||
self.tr('Create also .prj file'), False))
|
||||
|
@ -52,9 +52,16 @@ class fillnodata(GdalAlgorithm):
|
||||
NO_DEFAULT_MASK = 'NO_DEFAULT_MASK'
|
||||
OUTPUT = 'OUTPUT'
|
||||
|
||||
def name(self):
|
||||
return 'fillnodata'
|
||||
|
||||
def displayName(self):
|
||||
return self.tr('Fill nodata')
|
||||
|
||||
def group(self):
|
||||
return self.tr('Raster analysis')
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name, self.i18n_name = self.trAlgorithm('Fill nodata')
|
||||
self.group, self.i18n_group = self.trAlgorithm('Raster analysis')
|
||||
self.addParameter(ParameterRaster(
|
||||
self.INPUT, self.tr('Input layer'), False))
|
||||
self.addParameter(ParameterNumber(self.DISTANCE,
|
||||
|
@ -60,13 +60,16 @@ class gdal2tiles(GdalAlgorithm):
|
||||
RESAMPLINGS = ['average', 'near', 'bilinear', 'cubic', 'cubicspline', 'lanczos', 'antialias']
|
||||
WEBVIEWERS = ['all', 'google', 'openlayers', 'leaflet', 'none']
|
||||
|
||||
def commandLineName(self):
|
||||
return "gdal:gdal2tiles"
|
||||
def name(self):
|
||||
return 'gdal2tiles'
|
||||
|
||||
def displayName(self):
|
||||
return self.tr('gdal2tiles')
|
||||
|
||||
def group(self):
|
||||
return self.tr('Raster miscellaneous')
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name, self.i18n_name = self.trAlgorithm('gdal2tiles')
|
||||
self.group, self.i18n_group = self.trAlgorithm('Raster miscellaneous')
|
||||
|
||||
# Required parameters
|
||||
self.addParameter(ParameterRaster(self.INPUT, self.tr('Input layer')))
|
||||
|
||||
|
@ -43,9 +43,16 @@ class gdal2xyz(GdalAlgorithm):
|
||||
BAND = 'BAND'
|
||||
OUTPUT = 'OUTPUT'
|
||||
|
||||
def name(self):
|
||||
return 'gdal2xyz'
|
||||
|
||||
def displayName(self):
|
||||
return self.tr('gdal2xyz')
|
||||
|
||||
def group(self):
|
||||
return self.tr('Raster conversion')
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name, self.i18n_name = self.trAlgorithm('gdal2xyz')
|
||||
self.group, self.i18n_group = self.trAlgorithm('Raster conversion')
|
||||
self.addParameter(ParameterRaster(
|
||||
self.INPUT, self.tr('Input layer'), False))
|
||||
self.addParameter(ParameterNumber(self.BAND,
|
||||
|
@ -63,15 +63,19 @@ class gdaladdo(GdalAlgorithm):
|
||||
FORMATS = ['Internal (if possible)', 'External (GTiff .ovr)',
|
||||
'External (ERDAS Imagine .aux)']
|
||||
|
||||
def getIcon(self):
|
||||
def icon(self):
|
||||
return QIcon(os.path.join(pluginPath, 'images', 'gdaltools', 'raster-overview.png'))
|
||||
|
||||
def commandLineName(self):
|
||||
return "gdal:overviews"
|
||||
def name(self):
|
||||
return 'overviews'
|
||||
|
||||
def displayName(self):
|
||||
return self.tr('Build overviews (pyramids)')
|
||||
|
||||
def group(self):
|
||||
return self.tr('Raster miscellaneous')
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name, self.i18n_name = self.trAlgorithm('Build overviews (pyramids)')
|
||||
self.group, self.i18n_group = self.trAlgorithm('Raster miscellaneous')
|
||||
self.addParameter(ParameterRaster(
|
||||
self.INPUT, self.tr('Input layer'), False))
|
||||
self.addParameter(ParameterString(self.LEVELS,
|
||||
|
@ -59,9 +59,16 @@ class gdalcalc(GdalAlgorithm):
|
||||
TYPE = ['Byte', 'Int16', 'UInt16', 'UInt32', 'Int32', 'Float32', 'Float64']
|
||||
#DEBUG = 'DEBUG'
|
||||
|
||||
def name(self):
|
||||
return 'rastercalculator'
|
||||
|
||||
def displayName(self):
|
||||
return self.tr('Raster calculator')
|
||||
|
||||
def group(self):
|
||||
return self.tr('Raster miscellaneous')
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name, self.i18n_name = self.trAlgorithm('Raster calculator')
|
||||
self.group, self.i18n_group = self.trAlgorithm('Raster miscellaneous')
|
||||
self.addParameter(ParameterRaster(
|
||||
self.INPUT_A, self.tr('Input layer A'), False))
|
||||
self.addParameter(ParameterString(self.BAND_A,
|
||||
|
@ -48,12 +48,19 @@ class gdaltindex(GdalAlgorithm):
|
||||
FIELD_NAME = 'FIELD_NAME'
|
||||
PROJ_DIFFERENCE = 'PROJ_DIFFERENCE'
|
||||
|
||||
def getIcon(self):
|
||||
def name(self):
|
||||
return 'tileindex'
|
||||
|
||||
def displayName(self):
|
||||
return self.tr('Tile Index')
|
||||
|
||||
def icon(self):
|
||||
return QIcon(os.path.join(pluginPath, 'images', 'gdaltools', 'tiles.png'))
|
||||
|
||||
def group(self):
|
||||
return self.tr('Raster miscellaneous')
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name, self.i18n_name = self.trAlgorithm('Tile Index')
|
||||
self.group, self.i18n_group = self.trAlgorithm('Raster miscellaneous')
|
||||
self.addParameter(ParameterMultipleInput(self.INPUT,
|
||||
self.tr('Input layers'), dataobjects.TYPE_RASTER))
|
||||
self.addParameter(ParameterString(self.FIELD_NAME,
|
||||
|
@ -51,9 +51,16 @@ class hillshade(GdalAlgorithm):
|
||||
ALTITUDE = 'ALTITUDE'
|
||||
OUTPUT = 'OUTPUT'
|
||||
|
||||
def name(self):
|
||||
return 'hillshade'
|
||||
|
||||
def displayName(self):
|
||||
return self.tr('Hillshade')
|
||||
|
||||
def group(self):
|
||||
return self.tr('Raster analysis')
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name, self.i18n_name = self.trAlgorithm('Hillshade')
|
||||
self.group, self.i18n_group = self.trAlgorithm('Raster analysis')
|
||||
self.addParameter(ParameterRaster(self.INPUT, self.tr('Input layer')))
|
||||
self.addParameter(ParameterNumber(self.BAND,
|
||||
self.tr('Band number'), 1, 99, 1))
|
||||
|
@ -46,15 +46,19 @@ class information(GdalAlgorithm):
|
||||
NOGCP = 'NOGCP'
|
||||
NOMETADATA = 'NOMETADATA'
|
||||
|
||||
def getIcon(self):
|
||||
def icon(self):
|
||||
return QIcon(os.path.join(pluginPath, 'images', 'gdaltools', 'raster-info.png'))
|
||||
|
||||
def commandLineName(self):
|
||||
return "gdal:gdalinfo"
|
||||
def name(self):
|
||||
return 'gdalinfo'
|
||||
|
||||
def displayName(self):
|
||||
return self.tr('Information')
|
||||
|
||||
def group(self):
|
||||
return self.tr('Raster miscellaneous')
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name, self.i18n_name = self.trAlgorithm('Information')
|
||||
self.group, self.i18n_group = self.trAlgorithm('Raster miscellaneous')
|
||||
self.addParameter(ParameterRaster(information.INPUT,
|
||||
self.tr('Input layer'), False))
|
||||
self.addParameter(ParameterBoolean(information.NOGCP,
|
||||
|
@ -54,12 +54,19 @@ class merge(GdalAlgorithm):
|
||||
|
||||
TYPE = ['Byte', 'Int16', 'UInt16', 'UInt32', 'Int32', 'Float32', 'Float64']
|
||||
|
||||
def getIcon(self):
|
||||
def icon(self):
|
||||
return QIcon(os.path.join(pluginPath, 'images', 'gdaltools', 'merge.png'))
|
||||
|
||||
def name(self):
|
||||
return 'merge'
|
||||
|
||||
def displayName(self):
|
||||
return self.tr('Merge')
|
||||
|
||||
def group(self):
|
||||
return self.tr('Raster miscellaneous')
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name, self.i18n_name = self.trAlgorithm('Merge')
|
||||
self.group, self.i18n_group = self.trAlgorithm('Raster miscellaneous')
|
||||
self.addParameter(ParameterMultipleInput(self.INPUT,
|
||||
self.tr('Input layers'),
|
||||
dataobjects.TYPE_RASTER))
|
||||
|
@ -47,12 +47,19 @@ class nearblack(GdalAlgorithm):
|
||||
NEAR = 'NEAR'
|
||||
WHITE = 'WHITE'
|
||||
|
||||
def getIcon(self):
|
||||
def icon(self):
|
||||
return QIcon(os.path.join(pluginPath, 'images', 'gdaltools', 'nearblack.png'))
|
||||
|
||||
def name(self):
|
||||
return 'nearblack'
|
||||
|
||||
def displayName(self):
|
||||
return self.tr('Near black')
|
||||
|
||||
def group(self):
|
||||
return self.tr('Raster analysis')
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name, self.i18n_name = self.trAlgorithm('Near black')
|
||||
self.group, self.i18n_group = self.trAlgorithm('Raster analysis')
|
||||
self.addParameter(ParameterRaster(self.INPUT,
|
||||
self.tr('Input layer'), False))
|
||||
self.addParameter(ParameterNumber(self.NEAR,
|
||||
|
@ -46,10 +46,16 @@ class OffsetCurve(GdalAlgorithm):
|
||||
RADIUS = 'RADIUS'
|
||||
OPTIONS = 'OPTIONS'
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name, self.i18n_name = self.trAlgorithm('Offset lines for lines')
|
||||
self.group, self.i18n_group = self.trAlgorithm('Vector geoprocessing')
|
||||
def name(self):
|
||||
return 'offsetlinesforlines'
|
||||
|
||||
def displayName(self):
|
||||
return self.tr('Offset lines for lines')
|
||||
|
||||
def group(self):
|
||||
return self.tr('Vector geoprocessing')
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.addParameter(ParameterVector(self.INPUT_LAYER,
|
||||
self.tr('Input layer'), [dataobjects.TYPE_VECTOR_LINE], False))
|
||||
self.addParameter(ParameterString(self.GEOMETRY,
|
||||
|
@ -100,10 +100,16 @@ class Ogr2Ogr(GdalAlgorithm):
|
||||
FORMAT = 'FORMAT'
|
||||
OPTIONS = 'OPTIONS'
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name, self.i18n_name = self.trAlgorithm('Convert format')
|
||||
self.group, self.i18n_group = self.trAlgorithm('Vector conversion')
|
||||
def name(self):
|
||||
return 'convertformat'
|
||||
|
||||
def displayName(self):
|
||||
return self.tr('Convert format')
|
||||
|
||||
def group(self):
|
||||
return self.tr('Vector conversion')
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.addParameter(ParameterVector(self.INPUT_LAYER,
|
||||
self.tr('Input layer')))
|
||||
self.addParameter(ParameterSelection(self.FORMAT,
|
||||
|
@ -51,10 +51,16 @@ class Ogr2OgrBuffer(GdalAlgorithm):
|
||||
MULTI = 'MULTI'
|
||||
OPTIONS = 'OPTIONS'
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name, self.i18n_name = self.trAlgorithm('Buffer vectors')
|
||||
self.group, self.i18n_group = self.trAlgorithm('Vector geoprocessing')
|
||||
def name(self):
|
||||
return 'buffervectors'
|
||||
|
||||
def displayName(self):
|
||||
return self.tr('Buffer vectors')
|
||||
|
||||
def group(self):
|
||||
return self.tr('Vector geoprocessing')
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.addParameter(ParameterVector(self.INPUT_LAYER,
|
||||
self.tr('Input layer')))
|
||||
self.addParameter(ParameterString(self.GEOMETRY,
|
||||
|
@ -45,10 +45,16 @@ class Ogr2OgrClip(GdalAlgorithm):
|
||||
CLIP_LAYER = 'CLIP_LAYER'
|
||||
OPTIONS = 'OPTIONS'
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name, self.i18n_name = self.trAlgorithm('Clip vectors by polygon')
|
||||
self.group, self.i18n_group = self.trAlgorithm('Vector geoprocessing')
|
||||
def name(self):
|
||||
return 'clipvectorsbypolygon'
|
||||
|
||||
def displayName(self):
|
||||
return self.tr('Clip vectors by polygon')
|
||||
|
||||
def group(self):
|
||||
return self.tr('Vector geoprocessing')
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.addParameter(ParameterVector(self.INPUT_LAYER,
|
||||
self.tr('Input layer')))
|
||||
self.addParameter(ParameterVector(self.CLIP_LAYER,
|
||||
|
@ -45,10 +45,16 @@ class Ogr2OgrClipExtent(GdalAlgorithm):
|
||||
CLIP_EXTENT = 'CLIP_EXTENT'
|
||||
OPTIONS = 'OPTIONS'
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name, self.i18n_name = self.trAlgorithm('Clip vectors by extent')
|
||||
self.group, self.i18n_group = self.trAlgorithm('Vector geoprocessing')
|
||||
def name(self):
|
||||
return 'clipvectorsbyextent'
|
||||
|
||||
def displayName(self):
|
||||
return self.tr('Clip vectors by extent')
|
||||
|
||||
def group(self):
|
||||
return self.tr('Vector geoprocessing')
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.addParameter(ParameterVector(self.INPUT_LAYER,
|
||||
self.tr('Input layer')))
|
||||
self.addParameter(ParameterExtent(self.CLIP_EXTENT,
|
||||
|
@ -53,10 +53,16 @@ class Ogr2OgrDissolve(GdalAlgorithm):
|
||||
FIELDS = 'FIELDS'
|
||||
OPTIONS = 'OPTIONS'
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name, self.i18n_name = self.trAlgorithm('Dissolve polygons')
|
||||
self.group, self.i18n_group = self.trAlgorithm('Vector geoprocessing')
|
||||
def name(self):
|
||||
return 'dissolvepolygons'
|
||||
|
||||
def displayName(self):
|
||||
return self.tr('Dissolve polygons')
|
||||
|
||||
def group(self):
|
||||
return self.tr('Vector geoprocessing')
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.addParameter(ParameterVector(self.INPUT_LAYER,
|
||||
self.tr('Input layer'), [dataobjects.TYPE_VECTOR_POLYGON]))
|
||||
self.addParameter(ParameterString(self.GEOMETRY,
|
||||
|
@ -47,10 +47,16 @@ class Ogr2OgrPointsOnLines(GdalAlgorithm):
|
||||
GEOMETRY = 'GEOMETRY'
|
||||
OPTIONS = 'OPTIONS'
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name, self.i18n_name = self.trAlgorithm('Create points along lines')
|
||||
self.group, self.i18n_group = self.trAlgorithm('Vector geoprocessing')
|
||||
def name(self):
|
||||
return 'createpointsalonglines'
|
||||
|
||||
def displayName(self):
|
||||
return self.tr('Create points along lines')
|
||||
|
||||
def group(self):
|
||||
return self.tr('Vector geoprocessing')
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.addParameter(ParameterVector(self.INPUT_LAYER,
|
||||
self.tr('Input layer'), [dataobjects.TYPE_VECTOR_LINE], False))
|
||||
self.addParameter(ParameterString(self.GEOMETRY,
|
||||
|
@ -75,9 +75,16 @@ class Ogr2OgrTableToPostGisList(GdalAlgorithm):
|
||||
settings.beginGroup('/PostgreSQL/connections/')
|
||||
return settings.childGroups()
|
||||
|
||||
def name(self):
|
||||
return 'importlayertableasgeometrylesstableintopostgresqldatabase'
|
||||
|
||||
def displayName(self):
|
||||
return self.tr('Import layer/table as geometryless table into PostgreSQL database')
|
||||
|
||||
def group(self):
|
||||
return self.tr('Vector miscellaneous')
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name, self.i18n_name = self.trAlgorithm('Import layer/table as geometryless table into PostgreSQL database')
|
||||
self.group, self.i18n_group = self.trAlgorithm('Vector miscellaneous')
|
||||
self.DB_CONNECTIONS = self.dbConnectionNames()
|
||||
self.addParameter(ParameterSelection(self.DATABASE,
|
||||
self.tr('Database (connection name)'), self.DB_CONNECTIONS))
|
||||
|
@ -78,9 +78,16 @@ class Ogr2OgrToPostGis(GdalAlgorithm):
|
||||
PROMOTETOMULTI = 'PROMOTETOMULTI'
|
||||
OPTIONS = 'OPTIONS'
|
||||
|
||||
def name(self):
|
||||
return 'importvectorintopostgisdatabasenewconnection'
|
||||
|
||||
def displayName(self):
|
||||
return self.tr('Import Vector into PostGIS database (new connection)')
|
||||
|
||||
def group(self):
|
||||
return self.tr('Vector miscellaneous')
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name, self.i18n_name = self.trAlgorithm('Import Vector into PostGIS database (new connection)')
|
||||
self.group, self.i18n_group = self.trAlgorithm('Vector miscellaneous')
|
||||
self.addParameter(ParameterVector(self.INPUT_LAYER,
|
||||
self.tr('Input layer')))
|
||||
self.addParameter(ParameterString(self.SHAPE_ENCODING,
|
||||
|
@ -84,9 +84,16 @@ class Ogr2OgrToPostGisList(GdalAlgorithm):
|
||||
GdalAlgorithm.__init__(self)
|
||||
self.processing = False
|
||||
|
||||
def name(self):
|
||||
return 'importvectorintopostgisdatabaseavailableconnections'
|
||||
|
||||
def displayName(self):
|
||||
return self.tr('Import Vector into PostGIS database (available connections)')
|
||||
|
||||
def group(self):
|
||||
return self.tr('Vector miscellaneous')
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name, self.i18n_name = self.trAlgorithm('Import Vector into PostGIS database (available connections)')
|
||||
self.group, self.i18n_group = self.trAlgorithm('Vector miscellaneous')
|
||||
self.addParameter(ParameterString(
|
||||
self.DATABASE,
|
||||
self.tr('Database (connection name)'),
|
||||
|
@ -43,13 +43,16 @@ class OgrInfo(GdalAlgorithm):
|
||||
SUMMARY_ONLY = 'SUMMARY_ONLY'
|
||||
OUTPUT = 'OUTPUT'
|
||||
|
||||
def commandLineName(self):
|
||||
return "gdal:ogrinfo"
|
||||
def name(self):
|
||||
return 'ogrinfo'
|
||||
|
||||
def displayName(self):
|
||||
return self.tr('Information')
|
||||
|
||||
def group(self):
|
||||
return self.tr('Vector miscellaneous')
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name, self.i18n_name = self.trAlgorithm('Information')
|
||||
self.group, self.i18n_group = self.trAlgorithm('Vector miscellaneous')
|
||||
|
||||
self.addParameter(ParameterVector(self.INPUT, self.tr('Input layer')))
|
||||
self.addParameter(ParameterBoolean(self.SUMMARY_ONLY,
|
||||
self.tr('Summary output only'),
|
||||
|
@ -47,10 +47,16 @@ class OgrSql(GdalAlgorithm):
|
||||
SQL = 'SQL'
|
||||
DIALECT = 'DIALECT'
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name, self.i18n_name = self.trAlgorithm('Execute SQL')
|
||||
self.group, self.i18n_group = self.trAlgorithm('Vector miscellaneous')
|
||||
def name(self):
|
||||
return 'executesql'
|
||||
|
||||
def displayName(self):
|
||||
return self.tr('Execute SQL')
|
||||
|
||||
def group(self):
|
||||
return self.tr('Vector miscellaneous')
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.addParameter(ParameterTable(self.INPUT, self.tr('Input layer or table')))
|
||||
self.addParameter(ParameterString(self.SQL, self.tr('SQL'), ''))
|
||||
|
||||
|
@ -54,10 +54,16 @@ class OneSideBuffer(GdalAlgorithm):
|
||||
MULTI = 'MULTI'
|
||||
OPTIONS = 'OPTIONS'
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name, self.i18n_name = self.trAlgorithm('Single sided buffer for lines')
|
||||
self.group, self.i18n_group = self.trAlgorithm('Vector geoprocessing')
|
||||
def name(self):
|
||||
return 'singlesidedbufferforlines'
|
||||
|
||||
def displayName(self):
|
||||
return self.tr('Single sided buffer for lines')
|
||||
|
||||
def group(self):
|
||||
return self.tr('Vector geoprocessing')
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.addParameter(ParameterVector(self.INPUT_LAYER,
|
||||
self.tr('Input layer'), [dataobjects.TYPE_VECTOR_LINE], False))
|
||||
self.addParameter(ParameterString(self.GEOMETRY,
|
||||
|
@ -47,12 +47,19 @@ class pct2rgb(GdalAlgorithm):
|
||||
OUTPUT = 'OUTPUT'
|
||||
NBAND = 'NBAND'
|
||||
|
||||
def getIcon(self):
|
||||
def icon(self):
|
||||
return QIcon(os.path.join(pluginPath, 'images', 'gdaltools', '8-to-24-bits.png'))
|
||||
|
||||
def name(self):
|
||||
return 'pcttorgb'
|
||||
|
||||
def displayName(self):
|
||||
return self.tr('PCT to RGB')
|
||||
|
||||
def group(self):
|
||||
return self.tr('Raster conversion')
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name, self.i18n_name = self.trAlgorithm('PCT to RGB')
|
||||
self.group, self.i18n_group = self.trAlgorithm('Raster conversion')
|
||||
self.addParameter(ParameterRaster(pct2rgb.INPUT,
|
||||
self.tr('Input layer'), False))
|
||||
options = []
|
||||
|
@ -46,15 +46,19 @@ class polygonize(GdalAlgorithm):
|
||||
OUTPUT = 'OUTPUT'
|
||||
FIELD = 'FIELD'
|
||||
|
||||
def getIcon(self):
|
||||
def icon(self):
|
||||
return QIcon(os.path.join(pluginPath, 'images', 'gdaltools', 'polygonize.png'))
|
||||
|
||||
def commandLineName(self):
|
||||
return "gdal:polygonize"
|
||||
def name(self):
|
||||
return 'polygonize'
|
||||
|
||||
def displayName(self):
|
||||
return self.tr('Polygonize (raster to vector)')
|
||||
|
||||
def group(self):
|
||||
return self.tr('Raster conversion')
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name, self.i18n_name = self.trAlgorithm('Polygonize (raster to vector)')
|
||||
self.group, self.i18n_group = self.trAlgorithm('Raster conversion')
|
||||
self.addParameter(ParameterRaster(polygonize.INPUT,
|
||||
self.tr('Input layer'), False))
|
||||
self.addParameter(ParameterString(polygonize.FIELD,
|
||||
|
@ -57,15 +57,19 @@ class proximity(GdalAlgorithm):
|
||||
|
||||
DISTUNITS = ['GEO', 'PIXEL']
|
||||
|
||||
def getIcon(self):
|
||||
def icon(self):
|
||||
return QIcon(os.path.join(pluginPath, 'images', 'gdaltools', 'proximity.png'))
|
||||
|
||||
def commandLineName(self):
|
||||
return "gdal:proximity"
|
||||
def name(self):
|
||||
return 'proximity'
|
||||
|
||||
def displayName(self):
|
||||
return self.tr('Proximity (raster distance)')
|
||||
|
||||
def group(self):
|
||||
return self.tr('Raster analysis')
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name, self.i18n_name = self.trAlgorithm('Proximity (raster distance)')
|
||||
self.group, self.i18n_group = self.trAlgorithm('Raster analysis')
|
||||
self.addParameter(ParameterRaster(self.INPUT,
|
||||
self.tr('Input layer'), False))
|
||||
self.addParameter(ParameterString(self.VALUES,
|
||||
|
@ -62,16 +62,19 @@ class rasterize(GdalAlgorithm):
|
||||
|
||||
RAST_EXT = 'RAST_EXT'
|
||||
|
||||
def getIcon(self):
|
||||
def icon(self):
|
||||
return QIcon(os.path.join(pluginPath, 'images', 'gdaltools', 'rasterize.png'))
|
||||
|
||||
def commandLineName(self):
|
||||
return "gdal:rasterize"
|
||||
def name(self):
|
||||
return 'rasterize'
|
||||
|
||||
def displayName(self):
|
||||
return self.tr('Rasterize (vector to raster)')
|
||||
|
||||
def group(self):
|
||||
return self.tr('Vector conversion')
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name, self.i18n_name = self.trAlgorithm('Rasterize (vector to raster)')
|
||||
self.group, self.i18n_group = self.trAlgorithm('Vector conversion')
|
||||
|
||||
self.addParameter(ParameterVector(self.INPUT, self.tr('Input layer')))
|
||||
self.addParameter(ParameterTableField(self.FIELD,
|
||||
self.tr('Attribute field'), self.INPUT))
|
||||
|
@ -49,15 +49,19 @@ class rasterize_over(GdalAlgorithm):
|
||||
INPUT_RASTER = 'INPUT_RASTER'
|
||||
FIELD = 'FIELD'
|
||||
|
||||
def getIcon(self):
|
||||
def icon(self):
|
||||
return QIcon(os.path.join(pluginPath, 'images', 'gdaltools', 'rasterize.png'))
|
||||
|
||||
def commandLineName(self):
|
||||
return "gdal:rasterize_over"
|
||||
def name(self):
|
||||
return 'rasterize_over'
|
||||
|
||||
def displayName(self):
|
||||
return self.tr('Rasterize (write over existing raster)')
|
||||
|
||||
def group(self):
|
||||
return self.tr('Vector conversion')
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name, self.i18n_name = self.trAlgorithm('Rasterize (write over existing raster)')
|
||||
self.group, self.i18n_group = self.trAlgorithm('Vector conversion')
|
||||
self.addParameter(ParameterVector(self.INPUT, self.tr('Input layer')))
|
||||
self.addParameter(ParameterTableField(self.FIELD,
|
||||
self.tr('Attribute field'), self.INPUT))
|
||||
|
@ -60,16 +60,19 @@ class retile(GdalAlgorithm):
|
||||
TYPE = ['Byte', 'Int16', 'UInt16', 'UInt32', 'Int32', 'Float32', 'Float64']
|
||||
ALGO = ['near', 'bilinear', 'cubic', 'cubicspline', 'lanczos']
|
||||
|
||||
def commandLineName(self):
|
||||
return "gdal:retile"
|
||||
|
||||
def commandName(self):
|
||||
return "gdal_retile"
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name, self.i18n_name = self.trAlgorithm('Retile')
|
||||
self.group, self.i18n_group = self.trAlgorithm('Raster miscellaneous')
|
||||
def name(self):
|
||||
return 'retile'
|
||||
|
||||
def displayName(self):
|
||||
return self.tr('Retile')
|
||||
|
||||
def group(self):
|
||||
return self.tr('Raster miscellaneous')
|
||||
|
||||
def defineCharacteristics(self):
|
||||
# Required parameters
|
||||
self.addParameter(ParameterMultipleInput(self.INPUT,
|
||||
self.tr('Input layers'),
|
||||
|
@ -47,12 +47,19 @@ class rgb2pct(GdalAlgorithm):
|
||||
OUTPUT = 'OUTPUT'
|
||||
NCOLORS = 'NCOLORS'
|
||||
|
||||
def getIcon(self):
|
||||
def icon(self):
|
||||
return QIcon(os.path.join(pluginPath, 'images', 'gdaltools', '24-to-8-bits.png'))
|
||||
|
||||
def group(self):
|
||||
return self.tr('Raster conversion')
|
||||
|
||||
def name(self):
|
||||
return 'rgbtopct'
|
||||
|
||||
def displayName(self):
|
||||
return self.tr('RGB to PCT')
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name, self.i18n_name = self.trAlgorithm('RGB to PCT')
|
||||
self.group, self.i18n_group = self.trAlgorithm('Raster conversion')
|
||||
self.addParameter(ParameterRaster(rgb2pct.INPUT,
|
||||
self.tr('Input layer'), False))
|
||||
self.addParameter(ParameterNumber(rgb2pct.NCOLORS,
|
||||
|
@ -45,9 +45,16 @@ class roughness(GdalAlgorithm):
|
||||
COMPUTE_EDGES = 'COMPUTE_EDGES'
|
||||
OUTPUT = 'OUTPUT'
|
||||
|
||||
def group(self):
|
||||
return self.tr('Raster analysis')
|
||||
|
||||
def name(self):
|
||||
return 'roughness'
|
||||
|
||||
def displayName(self):
|
||||
return self.tr('Roughness')
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name, self.i18n_name = self.trAlgorithm('Roughness')
|
||||
self.group, self.i18n_group = self.trAlgorithm('Raster analysis')
|
||||
self.addParameter(ParameterRaster(self.INPUT, self.tr('Input layer')))
|
||||
self.addParameter(ParameterNumber(self.BAND,
|
||||
self.tr('Band number'), 1, 99, 1))
|
||||
|
@ -53,12 +53,19 @@ class sieve(GdalAlgorithm):
|
||||
|
||||
PIXEL_CONNECTIONS = ['4', '8']
|
||||
|
||||
def getIcon(self):
|
||||
def icon(self):
|
||||
return QIcon(os.path.join(pluginPath, 'images', 'gdaltools', 'sieve.png'))
|
||||
|
||||
def name(self):
|
||||
return 'sieve'
|
||||
|
||||
def displayName(self):
|
||||
return self.tr('Sieve')
|
||||
|
||||
def group(self):
|
||||
return self.tr('Raster analysis')
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name, self.i18n_name = self.trAlgorithm('Sieve')
|
||||
self.group, self.i18n_group = self.trAlgorithm('Raster analysis')
|
||||
self.addParameter(ParameterRaster(self.INPUT, self.tr('Input layer'), False))
|
||||
self.addParameter(ParameterNumber(self.THRESHOLD,
|
||||
self.tr('Threshold'), 0, 9999, 2))
|
||||
|
@ -49,9 +49,16 @@ class slope(GdalAlgorithm):
|
||||
SCALE = 'SCALE'
|
||||
OUTPUT = 'OUTPUT'
|
||||
|
||||
def group(self):
|
||||
return self.tr('Raster analysis')
|
||||
|
||||
def name(self):
|
||||
return 'slope'
|
||||
|
||||
def displayName(self):
|
||||
return self.tr('Slope')
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name, self.i18n_name = self.trAlgorithm('Slope')
|
||||
self.group, self.i18n_group = self.trAlgorithm('Raster analysis')
|
||||
self.addParameter(ParameterRaster(self.INPUT, self.tr('Input layer')))
|
||||
self.addParameter(ParameterNumber(self.BAND,
|
||||
self.tr('Band number'), 1, 99, 1))
|
||||
|
@ -46,9 +46,16 @@ class tpi(GdalAlgorithm):
|
||||
COMPUTE_EDGES = 'COMPUTE_EDGES'
|
||||
OUTPUT = 'OUTPUT'
|
||||
|
||||
def group(self):
|
||||
return self.tr('Raster analysis')
|
||||
|
||||
def name(self):
|
||||
return 'tpitopographicpositionindex'
|
||||
|
||||
def displayName(self):
|
||||
return self.tr('TPI (Topographic Position Index)')
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name, self.i18n_name = self.trAlgorithm('TPI (Topographic Position Index)')
|
||||
self.group, self.i18n_group = self.trAlgorithm('Raster analysis')
|
||||
self.addParameter(ParameterRaster(self.INPUT, self.tr('Input layer')))
|
||||
self.addParameter(ParameterNumber(self.BAND,
|
||||
self.tr('Band number'), 1, 99, 1))
|
||||
|
@ -60,16 +60,19 @@ class translate(GdalAlgorithm):
|
||||
OPTIONS = 'OPTIONS'
|
||||
TYPE = ['Byte', 'Int16', 'UInt16', 'UInt32', 'Int32', 'Float32', 'Float64']
|
||||
|
||||
def getIcon(self):
|
||||
def icon(self):
|
||||
return QIcon(os.path.join(pluginPath, 'images', 'gdaltools', 'translate.png'))
|
||||
|
||||
def commandLineName(self):
|
||||
return "gdal:translate"
|
||||
def name(self):
|
||||
return 'translate'
|
||||
|
||||
def displayName(self):
|
||||
return self.tr('Translate (convert format)')
|
||||
|
||||
def group(self):
|
||||
return self.tr('Raster conversion')
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name, self.i18n_name = self.trAlgorithm('Translate (convert format)')
|
||||
self.group, self.i18n_group = self.trAlgorithm('Raster conversion')
|
||||
|
||||
self.addParameter(ParameterRaster(self.INPUT, self.tr('Input layer')))
|
||||
self.addParameter(ParameterNumber(self.OUTSIZE,
|
||||
self.tr('Set the size of the output file (In pixels or %)'),
|
||||
|
@ -46,9 +46,16 @@ class tri(GdalAlgorithm):
|
||||
COMPUTE_EDGES = 'COMPUTE_EDGES'
|
||||
OUTPUT = 'OUTPUT'
|
||||
|
||||
def name(self):
|
||||
return 'triterrainruggednessindex'
|
||||
|
||||
def displayName(self):
|
||||
return self.tr('TRI (Terrain Ruggedness Index)')
|
||||
|
||||
def group(self):
|
||||
return self.tr('Raster analysis')
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name, self.i18n_name = self.trAlgorithm('TRI (Terrain Ruggedness Index)')
|
||||
self.group, self.i18n_group = self.trAlgorithm('Raster analysis')
|
||||
self.addParameter(ParameterRaster(self.INPUT, self.tr('Input layer')))
|
||||
self.addParameter(ParameterNumber(self.BAND,
|
||||
self.tr('Band number'), 1, 99, 1))
|
||||
|
@ -60,14 +60,22 @@ class warp(GdalAlgorithm):
|
||||
METHOD_OPTIONS = ['near', 'bilinear', 'cubic', 'cubicspline', 'lanczos']
|
||||
TYPE = ['Byte', 'Int16', 'UInt16', 'UInt32', 'Int32', 'Float32', 'Float64']
|
||||
|
||||
def getIcon(self):
|
||||
def icon(self):
|
||||
return QIcon(os.path.join(pluginPath, 'images', 'gdaltools', 'warp.png'))
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name, self.i18n_name = self.trAlgorithm('Warp (reproject)')
|
||||
self.group, self.i18n_group = self.trAlgorithm('Raster projections')
|
||||
def tags(self):
|
||||
return self.tr('transform,reproject,crs,srs').split(',')
|
||||
|
||||
self.tags = self.tr('transform,reproject,crs,srs')
|
||||
def name(self):
|
||||
return 'warpreproject'
|
||||
|
||||
def displayName(self):
|
||||
return self.tr('Warp (reproject)')
|
||||
|
||||
def group(self):
|
||||
return self.tr('Raster projections')
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.addParameter(ParameterRaster(self.INPUT, self.tr('Input layer'), False))
|
||||
self.addParameter(ParameterCrs(self.SOURCE_SRS,
|
||||
self.tr('Source SRS'),
|
||||
|
@ -80,11 +80,13 @@ class Grass7Algorithm(GeoAlgorithm):
|
||||
|
||||
def __init__(self, descriptionfile):
|
||||
GeoAlgorithm.__init__(self)
|
||||
self._name = ''
|
||||
self._display_name = ''
|
||||
self._group = ''
|
||||
self.hardcodedStrings = []
|
||||
self.descriptionFile = descriptionfile
|
||||
self.defineCharacteristicsFromFile()
|
||||
self.numExportedLayers = 0
|
||||
self._icon = None
|
||||
self.uniqueSuffix = str(uuid.uuid4()).replace('-', '')
|
||||
|
||||
# Use the ext mechanism
|
||||
@ -99,10 +101,20 @@ class Grass7Algorithm(GeoAlgorithm):
|
||||
newone.provider = self.provider
|
||||
return newone
|
||||
|
||||
def getIcon(self):
|
||||
if self._icon is None:
|
||||
self._icon = QgsApplication.getThemeIcon("/providerGrass.svg")
|
||||
return self._icon
|
||||
def name(self):
|
||||
return self._name
|
||||
|
||||
def displayName(self):
|
||||
return self._display_name
|
||||
|
||||
def group(self):
|
||||
return self._group
|
||||
|
||||
def icon(self):
|
||||
return QgsApplication.getThemeIcon("/providerGrass.svg")
|
||||
|
||||
def svgIconPath(self):
|
||||
return QgsApplication.iconPath("providerGrass.svg")
|
||||
|
||||
def help(self):
|
||||
helpPath = Grass7Utils.grassHelpPath()
|
||||
@ -138,14 +150,16 @@ class Grass7Algorithm(GeoAlgorithm):
|
||||
line = lines.readline().strip('\n').strip()
|
||||
self.grass7Name = line
|
||||
line = lines.readline().strip('\n').strip()
|
||||
self.name = line
|
||||
self.i18n_name = QCoreApplication.translate("GrassAlgorithm", line)
|
||||
if " - " not in self.name:
|
||||
self.name = self.grass7Name + " - " + self.name
|
||||
self.i18n_name = self.grass7Name + " - " + self.i18n_name
|
||||
self._name = line
|
||||
self._display_name = QCoreApplication.translate("GrassAlgorithm", line)
|
||||
if " - " not in self._name:
|
||||
self._name = self.grass7Name + " - " + self._name
|
||||
self._display_name = self.grass7Name + " - " + self._display_name
|
||||
|
||||
self._name = self._name[:self._name.find(' ')].lower()
|
||||
|
||||
line = lines.readline().strip('\n').strip()
|
||||
self.group = line
|
||||
self.i18n_group = QCoreApplication.translate("GrassAlgorithm", line)
|
||||
self._group = QCoreApplication.translate("GrassAlgorithm", line)
|
||||
hasRasterOutput = False
|
||||
hasVectorInput = False
|
||||
vectorOutputs = 0
|
||||
@ -562,7 +576,7 @@ class Grass7Algorithm(GeoAlgorithm):
|
||||
return system.getTempFilename()
|
||||
|
||||
def commandLineName(self):
|
||||
return 'grass7:' + self.name[:self.name.find(' ')]
|
||||
return 'grass7:' + self.name()
|
||||
|
||||
def checkBeforeOpeningParametersDialog(self):
|
||||
return Grass7Utils.checkGrass7IsInstalled()
|
||||
|
@ -82,7 +82,7 @@ class Grass7AlgorithmProvider(AlgorithmProvider):
|
||||
if descriptionFile.endswith('txt'):
|
||||
try:
|
||||
alg = Grass7Algorithm(os.path.join(folder, descriptionFile))
|
||||
if alg.name.strip() != '':
|
||||
if alg.name().strip() != '':
|
||||
self.preloadedAlgs.append(alg)
|
||||
else:
|
||||
ProcessingLog.addToLog(
|
||||
@ -110,11 +110,8 @@ class Grass7AlgorithmProvider(AlgorithmProvider):
|
||||
def svgIconPath(self):
|
||||
return QgsApplication.iconPath("providerGrass.svg")
|
||||
|
||||
def getSupportedOutputVectorLayerExtensions(self):
|
||||
def supportedOutputVectorLayerExtensions(self):
|
||||
return ['shp']
|
||||
|
||||
def getSupportedOutputRasterLayerExtensions(self):
|
||||
return ['tif']
|
||||
|
||||
def canBeActivated(self):
|
||||
return not bool(Grass7Utils.checkGrass7IsInstalled())
|
||||
|
@ -53,7 +53,7 @@ def processOutputs(alg):
|
||||
else:
|
||||
angles = ['']
|
||||
|
||||
ext = alg.provider.getSupportedOutputRasterLayerExtensions()[0]
|
||||
ext = alg.provider.supportedOutputRasterLayerExtensions()[0]
|
||||
for method in methodList:
|
||||
out = alg.getOutputValue(u'output')
|
||||
for angle in angles:
|
||||
|
@ -32,7 +32,8 @@ import os
|
||||
import time
|
||||
|
||||
from qgis.PyQt.QtGui import QIcon
|
||||
from qgis.core import QgsRasterLayer
|
||||
from qgis.core import (QgsProcessingAlgorithm,
|
||||
QgsRasterLayer)
|
||||
|
||||
from processing.core.GeoAlgorithm import GeoAlgorithm
|
||||
from processing.core.parameters import ParameterMultipleInput
|
||||
@ -55,16 +56,22 @@ class nviz7(GeoAlgorithm):
|
||||
GRASS_REGION_EXTENT_PARAMETER = 'GRASS_REGION_PARAMETER'
|
||||
GRASS_REGION_CELLSIZE_PARAMETER = 'GRASS_REGION_CELLSIZE_PARAMETER'
|
||||
|
||||
def __init__(self):
|
||||
GeoAlgorithm.__init__(self)
|
||||
self.showInModeler = False
|
||||
|
||||
def getIcon(self):
|
||||
def icon(self):
|
||||
return QIcon(os.path.join(pluginPath, 'images', 'grass.png'))
|
||||
|
||||
def flags(self):
|
||||
return QgsProcessingAlgorithm.FlagHideFromModeler
|
||||
|
||||
def name(self):
|
||||
return 'nviz7'
|
||||
|
||||
def displayName(self):
|
||||
return self.tr('nviz7')
|
||||
|
||||
def group(self):
|
||||
return self.tr('Visualization(NVIZ)')
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name, self.i18n_name = self.trAlgorithm('nviz7')
|
||||
self.group, self.i18n_group = self.trAlgorithm('Visualization(NVIZ)')
|
||||
self.addParameter(ParameterMultipleInput(
|
||||
nviz7.ELEVATION,
|
||||
self.tr('Raster file(s) for elevation'),
|
||||
|
@ -26,7 +26,9 @@ __copyright__ = '(C) 2012, Victor Olaya'
|
||||
__revision__ = '$Format:%H$'
|
||||
|
||||
from qgis.PyQt.QtCore import QVariant
|
||||
from qgis.core import QgsField, QgsFeature
|
||||
from qgis.core import (QgsField,
|
||||
QgsFeature,
|
||||
QgsApplication)
|
||||
from processing.core.GeoAlgorithm import GeoAlgorithm
|
||||
from processing.core.parameters import ParameterVector
|
||||
from processing.core.parameters import ParameterString
|
||||
@ -47,9 +49,22 @@ class AddTableField(GeoAlgorithm):
|
||||
|
||||
TYPES = [QVariant.Int, QVariant.Double, QVariant.String]
|
||||
|
||||
def icon(self):
|
||||
return QgsApplication.getThemeIcon("/providerQgis.svg")
|
||||
|
||||
def svgIconPath(self):
|
||||
return QgsApplication.iconPath("providerQgis.svg")
|
||||
|
||||
def group(self):
|
||||
return self.tr('Vector table tools')
|
||||
|
||||
def name(self):
|
||||
return 'addfieldtoattributestable'
|
||||
|
||||
def displayName(self):
|
||||
return self.tr('Add field to attributes table')
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name, self.i18n_name = self.trAlgorithm('Add field to attributes table')
|
||||
self.group, self.i18n_group = self.trAlgorithm('Vector table tools')
|
||||
|
||||
self.type_names = [self.tr('Integer'),
|
||||
self.tr('Float'),
|
||||
|
@ -46,13 +46,19 @@ class Aspect(GeoAlgorithm):
|
||||
Z_FACTOR = 'Z_FACTOR'
|
||||
OUTPUT_LAYER = 'OUTPUT_LAYER'
|
||||
|
||||
def getIcon(self):
|
||||
def icon(self):
|
||||
return QIcon(os.path.join(pluginPath, 'images', 'dem.png'))
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name, self.i18n_name = self.trAlgorithm('Aspect')
|
||||
self.group, self.i18n_group = self.trAlgorithm('Raster terrain analysis')
|
||||
def group(self):
|
||||
return self.tr('Raster terrain analysis')
|
||||
|
||||
def name(self):
|
||||
return 'aspect'
|
||||
|
||||
def displayName(self):
|
||||
return self.tr('Aspect')
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.addParameter(ParameterRaster(self.INPUT_LAYER,
|
||||
self.tr('Elevation layer')))
|
||||
self.addParameter(ParameterNumber(self.Z_FACTOR,
|
||||
|
@ -26,7 +26,9 @@ __copyright__ = '(C) 2012, Victor Olaya'
|
||||
__revision__ = '$Format:%H$'
|
||||
|
||||
from qgis.PyQt.QtCore import QVariant
|
||||
from qgis.core import QgsField, QgsFeature
|
||||
from qgis.core import (QgsField,
|
||||
QgsFeature,
|
||||
QgsApplication)
|
||||
from processing.core.GeoAlgorithm import GeoAlgorithm
|
||||
from processing.core.parameters import ParameterVector
|
||||
from processing.core.outputs import OutputVector
|
||||
@ -38,9 +40,22 @@ class AutoincrementalField(GeoAlgorithm):
|
||||
INPUT = 'INPUT'
|
||||
OUTPUT = 'OUTPUT'
|
||||
|
||||
def icon(self):
|
||||
return QgsApplication.getThemeIcon("/providerQgis.svg")
|
||||
|
||||
def svgIconPath(self):
|
||||
return QgsApplication.iconPath("providerQgis.svg")
|
||||
|
||||
def group(self):
|
||||
return self.tr('Vector table tools')
|
||||
|
||||
def name(self):
|
||||
return 'addautoincrementalfield'
|
||||
|
||||
def displayName(self):
|
||||
return self.tr('Add autoincremental field')
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name, self.i18n_name = self.trAlgorithm('Add autoincremental field')
|
||||
self.group, self.i18n_group = self.trAlgorithm('Vector table tools')
|
||||
self.addParameter(ParameterVector(self.INPUT,
|
||||
self.tr('Input layer')))
|
||||
self.addOutput(OutputVector(self.OUTPUT, self.tr('Incremented')))
|
||||
|
@ -29,6 +29,7 @@ import plotly as plt
|
||||
import plotly.graph_objs as go
|
||||
import numpy as np
|
||||
|
||||
from qgis.core import (QgsApplication)
|
||||
from processing.core.parameters import ParameterTable
|
||||
from processing.core.parameters import ParameterTableField
|
||||
from processing.core.GeoAlgorithm import GeoAlgorithm
|
||||
@ -44,10 +45,22 @@ class BarPlot(GeoAlgorithm):
|
||||
NAME_FIELD = 'NAME_FIELD'
|
||||
VALUE_FIELD = 'VALUE_FIELD'
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name, self.i18n_name = self.trAlgorithm('Bar plot')
|
||||
self.group, self.i18n_group = self.trAlgorithm('Graphics')
|
||||
def icon(self):
|
||||
return QgsApplication.getThemeIcon("/providerQgis.svg")
|
||||
|
||||
def svgIconPath(self):
|
||||
return QgsApplication.iconPath("providerQgis.svg")
|
||||
|
||||
def group(self):
|
||||
return self.tr('Graphics')
|
||||
|
||||
def name(self):
|
||||
return 'barplot'
|
||||
|
||||
def displayName(self):
|
||||
return self.tr('Bar plot')
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.addParameter(ParameterTable(self.INPUT, self.tr('Input table')))
|
||||
self.addParameter(ParameterTableField(self.NAME_FIELD,
|
||||
self.tr('Category name field'),
|
||||
|
@ -43,7 +43,6 @@ from processing.core.outputs import OutputHTML
|
||||
from processing.core.outputs import OutputNumber
|
||||
from processing.tools import dataobjects, vector
|
||||
|
||||
|
||||
pluginPath = os.path.split(os.path.split(os.path.dirname(__file__))[0])[0]
|
||||
|
||||
|
||||
@ -74,15 +73,23 @@ class BasicStatisticsForField(GeoAlgorithm):
|
||||
THIRDQUARTILE = 'THIRDQUARTILE'
|
||||
IQR = 'IQR'
|
||||
|
||||
def getIcon(self):
|
||||
def icon(self):
|
||||
return QIcon(os.path.join(pluginPath, 'images', 'ftools', 'basic_statistics.png'))
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name, self.i18n_name = self.trAlgorithm('Basic statistics for fields')
|
||||
self.group, self.i18n_group = self.trAlgorithm('Vector table tools')
|
||||
self.tags = self.tr('stats,statistics,date,time,datetime,string,number,text,table,layer,maximum,minimum,mean,average,standard,deviation,'
|
||||
'count,distinct,unique,variance,median,quartile,range,majority,minority')
|
||||
def tags(self):
|
||||
return self.tr('stats,statistics,date,time,datetime,string,number,text,table,layer,maximum,minimum,mean,average,standard,deviation,'
|
||||
'count,distinct,unique,variance,median,quartile,range,majority,minority').split(',')
|
||||
|
||||
def group(self):
|
||||
return self.tr('Vector table tools')
|
||||
|
||||
def name(self):
|
||||
return 'basicstatisticsforfields'
|
||||
|
||||
def displayName(self):
|
||||
return self.tr('Basic statistics for fields')
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.addParameter(ParameterTable(self.INPUT_LAYER,
|
||||
self.tr('Input table')))
|
||||
self.addParameter(ParameterTableField(self.FIELD_NAME,
|
||||
|
@ -32,7 +32,8 @@ import codecs
|
||||
from qgis.PyQt.QtGui import QIcon
|
||||
|
||||
from qgis.core import (QgsStatisticalSummary,
|
||||
QgsFeatureRequest)
|
||||
QgsFeatureRequest,
|
||||
QgsProcessingAlgorithm)
|
||||
|
||||
from processing.core.GeoAlgorithm import GeoAlgorithm
|
||||
from processing.core.parameters import ParameterTable
|
||||
@ -41,7 +42,6 @@ from processing.core.outputs import OutputHTML
|
||||
from processing.core.outputs import OutputNumber
|
||||
from processing.tools import dataobjects, vector
|
||||
|
||||
|
||||
pluginPath = os.path.split(os.path.split(os.path.dirname(__file__))[0])[0]
|
||||
|
||||
|
||||
@ -68,19 +68,26 @@ class BasicStatisticsNumbers(GeoAlgorithm):
|
||||
NULLVALUES = 'NULLVALUES'
|
||||
IQR = 'IQR'
|
||||
|
||||
def __init__(self):
|
||||
GeoAlgorithm.__init__(self)
|
||||
def flags(self):
|
||||
# this algorithm is deprecated - use BasicStatistics instead
|
||||
self.showInToolbox = False
|
||||
return QgsProcessingAlgorithm.FlagDeprecated
|
||||
|
||||
def getIcon(self):
|
||||
def icon(self):
|
||||
return QIcon(os.path.join(pluginPath, 'images', 'ftools', 'basic_statistics.png'))
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name, self.i18n_name = self.trAlgorithm('Basic statistics for numeric fields')
|
||||
self.group, self.i18n_group = self.trAlgorithm('Vector table tools')
|
||||
self.tags = self.tr('stats,statistics,number,table,layer')
|
||||
def tags(self):
|
||||
return self.tr('stats,statistics,number,table,layer').split(',')
|
||||
|
||||
def group(self):
|
||||
return self.tr('Vector table tools')
|
||||
|
||||
def name(self):
|
||||
return 'basicstatisticsfornumericfields'
|
||||
|
||||
def displayName(self):
|
||||
return self.tr('Basic statistics for numeric fields')
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.addParameter(ParameterTable(self.INPUT_LAYER,
|
||||
self.tr('Input vector layer')))
|
||||
self.addParameter(ParameterTableField(self.FIELD_NAME,
|
||||
|
@ -31,7 +31,8 @@ import codecs
|
||||
|
||||
from qgis.PyQt.QtGui import QIcon
|
||||
|
||||
from qgis.core import (QgsStringStatisticalSummary,
|
||||
from qgis.core import (QgsProcessingAlgorithm,
|
||||
QgsStringStatisticalSummary,
|
||||
QgsFeatureRequest)
|
||||
|
||||
from processing.core.GeoAlgorithm import GeoAlgorithm
|
||||
@ -60,19 +61,26 @@ class BasicStatisticsStrings(GeoAlgorithm):
|
||||
MIN_VALUE = 'MIN_VALUE'
|
||||
MAX_VALUE = 'MAX_VALUE'
|
||||
|
||||
def __init__(self):
|
||||
GeoAlgorithm.__init__(self)
|
||||
def flags(self):
|
||||
# this algorithm is deprecated - use BasicStatistics instead
|
||||
self.showInToolbox = False
|
||||
return QgsProcessingAlgorithm.FlagDeprecated
|
||||
|
||||
def getIcon(self):
|
||||
def icon(self):
|
||||
return QIcon(os.path.join(pluginPath, 'images', 'ftools', 'basic_statistics.png'))
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name, self.i18n_name = self.trAlgorithm('Basic statistics for text fields')
|
||||
self.group, self.i18n_group = self.trAlgorithm('Vector table tools')
|
||||
self.tags = self.tr('stats,statistics,string,table,layer')
|
||||
def tags(self):
|
||||
return self.tr('stats,statistics,string,table,layer').split(',')
|
||||
|
||||
def group(self):
|
||||
return self.tr('Vector table tools')
|
||||
|
||||
def name(self):
|
||||
return 'basicstatisticsfortextfields'
|
||||
|
||||
def displayName(self):
|
||||
return self.tr('Basic statistics for text fields')
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.addParameter(ParameterTable(self.INPUT_LAYER,
|
||||
self.tr('Input vector layer')))
|
||||
self.addParameter(ParameterTableField(self.FIELD_NAME,
|
||||
|
@ -45,13 +45,19 @@ class Boundary(GeoAlgorithm):
|
||||
INPUT_LAYER = 'INPUT_LAYER'
|
||||
OUTPUT_LAYER = 'OUTPUT_LAYER'
|
||||
|
||||
def getIcon(self):
|
||||
def icon(self):
|
||||
return QIcon(os.path.join(pluginPath, 'images', 'ftools', 'convex_hull.png'))
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name, self.i18n_name = self.trAlgorithm('Boundary')
|
||||
self.group, self.i18n_group = self.trAlgorithm('Vector geometry tools')
|
||||
def group(self):
|
||||
return self.tr('Vector geometry tools')
|
||||
|
||||
def name(self):
|
||||
return 'boundary'
|
||||
|
||||
def displayName(self):
|
||||
return self.tr('Boundary')
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.addParameter(ParameterVector(self.INPUT_LAYER,
|
||||
self.tr('Input layer'), [dataobjects.TYPE_VECTOR_LINE,
|
||||
dataobjects.TYPE_VECTOR_POLYGON]))
|
||||
|
@ -45,13 +45,19 @@ class BoundingBox(GeoAlgorithm):
|
||||
INPUT_LAYER = 'INPUT_LAYER'
|
||||
OUTPUT_LAYER = 'OUTPUT_LAYER'
|
||||
|
||||
def getIcon(self):
|
||||
def icon(self):
|
||||
return QIcon(os.path.join(pluginPath, 'images', 'ftools', 'matrix.png'))
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name, self.i18n_name = self.trAlgorithm('Bounding boxes')
|
||||
self.group, self.i18n_group = self.trAlgorithm('Vector geometry tools')
|
||||
def group(self):
|
||||
return self.tr('Vector geometry tools')
|
||||
|
||||
def name(self):
|
||||
return 'boundingboxes'
|
||||
|
||||
def displayName(self):
|
||||
return self.tr('Bounding boxes')
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.addParameter(ParameterVector(self.INPUT_LAYER,
|
||||
self.tr('Input layer')))
|
||||
self.addOutput(OutputVector(self.OUTPUT_LAYER, self.tr('Bounds'), datatype=[dataobjects.TYPE_VECTOR_POLYGON]))
|
||||
|
@ -45,13 +45,19 @@ class Centroids(GeoAlgorithm):
|
||||
INPUT_LAYER = 'INPUT_LAYER'
|
||||
OUTPUT_LAYER = 'OUTPUT_LAYER'
|
||||
|
||||
def getIcon(self):
|
||||
def icon(self):
|
||||
return QIcon(os.path.join(pluginPath, 'images', 'ftools', 'centroids.png'))
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name, self.i18n_name = self.trAlgorithm('Centroids')
|
||||
self.group, self.i18n_group = self.trAlgorithm('Vector geometry tools')
|
||||
def group(self):
|
||||
return self.tr('Vector geometry tools')
|
||||
|
||||
def name(self):
|
||||
return 'centroids'
|
||||
|
||||
def displayName(self):
|
||||
return self.tr('Centroids')
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.addParameter(ParameterVector(self.INPUT_LAYER,
|
||||
self.tr('Input layer')))
|
||||
|
||||
|
@ -49,13 +49,19 @@ class CheckValidity(GeoAlgorithm):
|
||||
INVALID_OUTPUT = 'INVALID_OUTPUT'
|
||||
ERROR_OUTPUT = 'ERROR_OUTPUT'
|
||||
|
||||
def getIcon(self):
|
||||
def icon(self):
|
||||
return QIcon(os.path.join(pluginPath, 'images', 'ftools', 'check_geometry.png'))
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name, self.i18n_name = self.trAlgorithm('Check validity')
|
||||
self.group, self.i18n_group = self.trAlgorithm('Vector geometry tools')
|
||||
def group(self):
|
||||
return self.tr('Vector geometry tools')
|
||||
|
||||
def name(self):
|
||||
return 'checkvalidity'
|
||||
|
||||
def displayName(self):
|
||||
return self.tr('Check validity')
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.methods = [self.tr('The one selected in digitizing settings'),
|
||||
'QGIS',
|
||||
'GEOS']
|
||||
|
@ -46,12 +46,19 @@ class Clip(GeoAlgorithm):
|
||||
OVERLAY = 'OVERLAY'
|
||||
OUTPUT = 'OUTPUT'
|
||||
|
||||
def getIcon(self):
|
||||
def icon(self):
|
||||
return QIcon(os.path.join(pluginPath, 'images', 'ftools', 'clip.png'))
|
||||
|
||||
def group(self):
|
||||
return self.tr('Vector overlay tools')
|
||||
|
||||
def name(self):
|
||||
return 'clip'
|
||||
|
||||
def displayName(self):
|
||||
return self.tr('Clip')
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name, self.i18n_name = self.trAlgorithm('Clip')
|
||||
self.group, self.i18n_group = self.trAlgorithm('Vector overlay tools')
|
||||
self.addParameter(ParameterVector(Clip.INPUT,
|
||||
self.tr('Input layer')))
|
||||
self.addParameter(ParameterVector(Clip.OVERLAY,
|
||||
|
@ -26,7 +26,11 @@ __copyright__ = '(C) 2014, Piotr Pociask'
|
||||
|
||||
__revision__ = '$Format:%H$'
|
||||
|
||||
from qgis.core import QgsFeatureRequest, QgsFeature, QgsGeometry, QgsWkbTypes
|
||||
from qgis.core import (QgsFeatureRequest,
|
||||
QgsFeature,
|
||||
QgsGeometry,
|
||||
QgsWkbTypes,
|
||||
QgsApplication)
|
||||
from processing.core.GeoAlgorithm import GeoAlgorithm
|
||||
from processing.core.GeoAlgorithmExecutionException import GeoAlgorithmExecutionException
|
||||
from processing.core.parameters import ParameterVector
|
||||
@ -46,9 +50,22 @@ class ConcaveHull(GeoAlgorithm):
|
||||
NO_MULTIGEOMETRY = 'NO_MULTIGEOMETRY'
|
||||
OUTPUT = 'OUTPUT'
|
||||
|
||||
def icon(self):
|
||||
return QgsApplication.getThemeIcon("/providerQgis.svg")
|
||||
|
||||
def svgIconPath(self):
|
||||
return QgsApplication.iconPath("providerQgis.svg")
|
||||
|
||||
def group(self):
|
||||
return self.tr('Vector geometry tools')
|
||||
|
||||
def name(self):
|
||||
return 'concavehull'
|
||||
|
||||
def displayName(self):
|
||||
return self.tr('Concave hull')
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name, self.i18n_name = self.trAlgorithm('Concave hull')
|
||||
self.group, self.i18n_group = self.trAlgorithm('Vector geometry tools')
|
||||
self.addParameter(ParameterVector(ConcaveHull.INPUT,
|
||||
self.tr('Input point layer'), [dataobjects.TYPE_VECTOR_POINT]))
|
||||
self.addParameter(ParameterNumber(self.ALPHA,
|
||||
@ -58,7 +75,8 @@ class ConcaveHull(GeoAlgorithm):
|
||||
self.tr('Allow holes'), True))
|
||||
self.addParameter(ParameterBoolean(self.NO_MULTIGEOMETRY,
|
||||
self.tr('Split multipart geometry into singleparts geometries'), False))
|
||||
self.addOutput(OutputVector(ConcaveHull.OUTPUT, self.tr('Concave hull'), datatype=[dataobjects.TYPE_VECTOR_POLYGON]))
|
||||
self.addOutput(
|
||||
OutputVector(ConcaveHull.OUTPUT, self.tr('Concave hull'), datatype=[dataobjects.TYPE_VECTOR_POLYGON]))
|
||||
|
||||
def processAlgorithm(self, feedback):
|
||||
layer = dataobjects.getObjectFromUri(self.getParameterValue(ConcaveHull.INPUT))
|
||||
|
@ -51,13 +51,19 @@ class ConvexHull(GeoAlgorithm):
|
||||
FIELD = 'FIELD'
|
||||
METHOD = 'METHOD'
|
||||
|
||||
def getIcon(self):
|
||||
def icon(self):
|
||||
return QIcon(os.path.join(pluginPath, 'images', 'ftools', 'convex_hull.png'))
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name, self.i18n_name = self.trAlgorithm('Convex hull')
|
||||
self.group, self.i18n_group = self.trAlgorithm('Vector geometry tools')
|
||||
def group(self):
|
||||
return self.tr('Vector geometry tools')
|
||||
|
||||
def name(self):
|
||||
return 'convexhull'
|
||||
|
||||
def displayName(self):
|
||||
return self.tr('Convex hull')
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.methods = [self.tr('Create single minimum convex hull'),
|
||||
self.tr('Create convex hulls based on field')]
|
||||
|
||||
|
@ -25,7 +25,9 @@ __copyright__ = '(C) 2016, Nyall Dawson'
|
||||
|
||||
__revision__ = '$Format:%H$'
|
||||
|
||||
from qgis.core import QgsVectorDataProvider, QgsFields
|
||||
from qgis.core import (QgsVectorDataProvider,
|
||||
QgsFields,
|
||||
QgsApplication)
|
||||
|
||||
from processing.core.GeoAlgorithm import GeoAlgorithm
|
||||
from processing.core.parameters import ParameterTable
|
||||
@ -41,10 +43,22 @@ class CreateAttributeIndex(GeoAlgorithm):
|
||||
FIELD = 'FIELD'
|
||||
OUTPUT = 'OUTPUT'
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name, self.i18n_name = self.trAlgorithm('Create attribute index')
|
||||
self.group, self.i18n_group = self.trAlgorithm('Vector general tools')
|
||||
def icon(self):
|
||||
return QgsApplication.getThemeIcon("/providerQgis.svg")
|
||||
|
||||
def svgIconPath(self):
|
||||
return QgsApplication.iconPath("providerQgis.svg")
|
||||
|
||||
def group(self):
|
||||
return self.tr('Vector general tools')
|
||||
|
||||
def name(self):
|
||||
return 'createattributeindex'
|
||||
|
||||
def displayName(self):
|
||||
return self.tr('Create attribute index')
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.addParameter(ParameterTable(self.INPUT,
|
||||
self.tr('Input Layer')))
|
||||
self.addParameter(ParameterTableField(self.FIELD,
|
||||
|
@ -27,6 +27,7 @@ __revision__ = '$Format:%H$'
|
||||
|
||||
from osgeo import gdal
|
||||
|
||||
from qgis.core import (QgsApplication)
|
||||
from processing.core.GeoAlgorithm import GeoAlgorithm
|
||||
from processing.core.parameters import ParameterRaster
|
||||
from processing.core.parameters import ParameterNumber
|
||||
@ -41,10 +42,22 @@ class CreateConstantRaster(GeoAlgorithm):
|
||||
OUTPUT = 'OUTPUT'
|
||||
NUMBER = 'NUMBER'
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name, self.i18n_name = self.trAlgorithm('Create constant raster layer')
|
||||
self.group, self.i18n_group = self.trAlgorithm('Raster tools')
|
||||
def icon(self):
|
||||
return QgsApplication.getThemeIcon("/providerQgis.svg")
|
||||
|
||||
def svgIconPath(self):
|
||||
return QgsApplication.iconPath("providerQgis.svg")
|
||||
|
||||
def group(self):
|
||||
return self.tr('Raster tools')
|
||||
|
||||
def name(self):
|
||||
return 'createconstantrasterlayer'
|
||||
|
||||
def displayName(self):
|
||||
return self.tr('Create constant raster layer')
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.addParameter(ParameterRaster(self.INPUT,
|
||||
self.tr('Reference layer')))
|
||||
self.addParameter(ParameterNumber(self.NUMBER,
|
||||
|
@ -30,7 +30,8 @@ import codecs
|
||||
import xml.sax.saxutils
|
||||
|
||||
from osgeo import ogr
|
||||
from qgis.core import QgsProcessingFeedback
|
||||
from qgis.core import (QgsProcessingFeedback,
|
||||
QgsApplication)
|
||||
from processing.tools import dataobjects
|
||||
from processing.core.GeoAlgorithm import GeoAlgorithm
|
||||
from processing.core.GeoAlgorithmExecutionException import GeoAlgorithmExecutionException
|
||||
@ -47,10 +48,22 @@ class Datasources2Vrt(GeoAlgorithm):
|
||||
VRT_FILE = 'VRT_FILE'
|
||||
VRT_STRING = 'VRT_STRING'
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name, self.i18n_name = self.trAlgorithm('Build virtual vector')
|
||||
self.group, self.i18n_group = self.trAlgorithm('Vector general tools')
|
||||
def icon(self):
|
||||
return QgsApplication.getThemeIcon("/providerQgis.svg")
|
||||
|
||||
def svgIconPath(self):
|
||||
return QgsApplication.iconPath("providerQgis.svg")
|
||||
|
||||
def group(self):
|
||||
return self.tr('Vector general tools')
|
||||
|
||||
def name(self):
|
||||
return 'buildvirtualvector'
|
||||
|
||||
def displayName(self):
|
||||
return self.tr('Build virtual vector')
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.addParameter(ParameterMultipleInput(self.DATASOURCES,
|
||||
self.tr('Input datasources'),
|
||||
dataobjects.TYPE_TABLE))
|
||||
|
@ -28,7 +28,8 @@ __revision__ = '$Format:%H$'
|
||||
import os
|
||||
import re
|
||||
|
||||
from qgis.core import QgsCoordinateReferenceSystem
|
||||
from qgis.core import (QgsCoordinateReferenceSystem,
|
||||
QgsApplication)
|
||||
from qgis.utils import iface
|
||||
|
||||
from processing.core.GeoAlgorithm import GeoAlgorithm
|
||||
@ -50,10 +51,22 @@ class DefineProjection(GeoAlgorithm):
|
||||
#def getIcon(self):
|
||||
# return QIcon(os.path.join(pluginPath, 'images', 'ftools', 'basic_statistics.png'))
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name, self.i18n_name = self.trAlgorithm('Define current projection')
|
||||
self.group, self.i18n_group = self.trAlgorithm('Vector general tools')
|
||||
def icon(self):
|
||||
return QgsApplication.getThemeIcon("/providerQgis.svg")
|
||||
|
||||
def svgIconPath(self):
|
||||
return QgsApplication.iconPath("providerQgis.svg")
|
||||
|
||||
def group(self):
|
||||
return self.tr('Vector general tools')
|
||||
|
||||
def name(self):
|
||||
return 'definecurrentprojection'
|
||||
|
||||
def displayName(self):
|
||||
return self.tr('Define current projection')
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.addParameter(ParameterVector(self.INPUT,
|
||||
self.tr('Input Layer')))
|
||||
self.addParameter(ParameterCrs(self.CRS, 'Output CRS'))
|
||||
|
@ -49,13 +49,19 @@ class Delaunay(GeoAlgorithm):
|
||||
INPUT = 'INPUT'
|
||||
OUTPUT = 'OUTPUT'
|
||||
|
||||
def getIcon(self):
|
||||
def icon(self):
|
||||
return QIcon(os.path.join(pluginPath, 'images', 'ftools', 'delaunay.png'))
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name, self.i18n_name = self.trAlgorithm('Delaunay triangulation')
|
||||
self.group, self.i18n_group = self.trAlgorithm('Vector geometry tools')
|
||||
def group(self):
|
||||
return self.tr('Vector geometry tools')
|
||||
|
||||
def name(self):
|
||||
return 'delaunaytriangulation'
|
||||
|
||||
def displayName(self):
|
||||
return self.tr('Delaunay triangulation')
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.addParameter(ParameterVector(self.INPUT,
|
||||
self.tr('Input layer'), [dataobjects.TYPE_VECTOR_POINT]))
|
||||
|
||||
|
@ -25,6 +25,7 @@ __copyright__ = '(C) 2010, Michael Minn'
|
||||
|
||||
__revision__ = '$Format:%H$'
|
||||
|
||||
from qgis.core import (QgsApplication)
|
||||
from processing.core.GeoAlgorithm import GeoAlgorithm
|
||||
from processing.core.parameters import ParameterVector
|
||||
from processing.core.parameters import ParameterTableField
|
||||
@ -38,11 +39,25 @@ class DeleteColumn(GeoAlgorithm):
|
||||
COLUMNS = 'COLUMN'
|
||||
OUTPUT = 'OUTPUT'
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name, self.i18n_name = self.trAlgorithm('Delete column')
|
||||
self.group, self.i18n_group = self.trAlgorithm('Vector table tools')
|
||||
self.tags = self.tr('drop,delete,remove,fields,columns,attributes')
|
||||
def icon(self):
|
||||
return QgsApplication.getThemeIcon("/providerQgis.svg")
|
||||
|
||||
def svgIconPath(self):
|
||||
return QgsApplication.iconPath("providerQgis.svg")
|
||||
|
||||
def tags(self):
|
||||
return self.tr('drop,delete,remove,fields,columns,attributes').split(',')
|
||||
|
||||
def group(self):
|
||||
return self.tr('Vector table tools')
|
||||
|
||||
def name(self):
|
||||
return 'deletecolumn'
|
||||
|
||||
def displayName(self):
|
||||
return self.tr('Delete column')
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.addParameter(ParameterVector(self.INPUT,
|
||||
self.tr('Input layer')))
|
||||
self.addParameter(ParameterTableField(self.COLUMNS,
|
||||
|
@ -25,7 +25,8 @@ __copyright__ = '(C) 2010, Michael Minn'
|
||||
|
||||
__revision__ = '$Format:%H$'
|
||||
|
||||
from qgis.core import QgsFeatureRequest
|
||||
from qgis.core import (QgsFeatureRequest,
|
||||
QgsApplication)
|
||||
from processing.core.GeoAlgorithm import GeoAlgorithm
|
||||
from processing.core.parameters import ParameterVector
|
||||
from processing.core.outputs import OutputVector
|
||||
@ -37,10 +38,22 @@ class DeleteDuplicateGeometries(GeoAlgorithm):
|
||||
INPUT = 'INPUT'
|
||||
OUTPUT = 'OUTPUT'
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name, self.i18n_name = self.trAlgorithm('Delete duplicate geometries')
|
||||
self.group, self.i18n_group = self.trAlgorithm('Vector general tools')
|
||||
def icon(self):
|
||||
return QgsApplication.getThemeIcon("/providerQgis.svg")
|
||||
|
||||
def svgIconPath(self):
|
||||
return QgsApplication.iconPath("providerQgis.svg")
|
||||
|
||||
def group(self):
|
||||
return self.tr('Vector general tools')
|
||||
|
||||
def name(self):
|
||||
return 'deleteduplicategeometries'
|
||||
|
||||
def displayName(self):
|
||||
return self.tr('Delete duplicate geometries')
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.addParameter(ParameterVector(self.INPUT,
|
||||
self.tr('Input layer')))
|
||||
self.addOutput(OutputVector(self.OUTPUT, self.tr('Cleaned')))
|
||||
|
@ -24,6 +24,7 @@ __copyright__ = '(C) 2015, Etienne Trimaille'
|
||||
|
||||
__revision__ = '$Format:%H$'
|
||||
|
||||
from qgis.core import (QgsApplication)
|
||||
from processing.core.GeoAlgorithm import GeoAlgorithm
|
||||
from processing.core.parameters import (ParameterVector,
|
||||
ParameterNumber)
|
||||
@ -37,11 +38,25 @@ class DeleteHoles(GeoAlgorithm):
|
||||
MIN_AREA = 'MIN_AREA'
|
||||
OUTPUT = 'OUTPUT'
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name, self.i18n_name = self.trAlgorithm('Delete holes')
|
||||
self.group, self.i18n_group = self.trAlgorithm('Vector geometry tools')
|
||||
self.tags = self.tr('remove,delete,drop,holes,rings,fill')
|
||||
def icon(self):
|
||||
return QgsApplication.getThemeIcon("/providerQgis.svg")
|
||||
|
||||
def svgIconPath(self):
|
||||
return QgsApplication.iconPath("providerQgis.svg")
|
||||
|
||||
def tags(self):
|
||||
return self.tr('remove,delete,drop,holes,rings,fill').split(',')
|
||||
|
||||
def group(self):
|
||||
return self.tr('Vector geometry tools')
|
||||
|
||||
def name(self):
|
||||
return 'deleteholes'
|
||||
|
||||
def displayName(self):
|
||||
return self.tr('Delete holes')
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.addParameter(ParameterVector(self.INPUT,
|
||||
self.tr('Input layer'), [dataobjects.TYPE_VECTOR_POLYGON]))
|
||||
self.addParameter(ParameterNumber(self.MIN_AREA,
|
||||
|
@ -28,7 +28,10 @@ __revision__ = '$Format:%H$'
|
||||
|
||||
import os
|
||||
|
||||
from qgis.core import QgsGeometry, QgsPoint, QgsWkbTypes
|
||||
from qgis.core import (QgsGeometry,
|
||||
QgsPoint,
|
||||
QgsWkbTypes,
|
||||
QgsApplication)
|
||||
|
||||
from processing.core.GeoAlgorithm import GeoAlgorithm
|
||||
from processing.core.parameters import ParameterVector
|
||||
@ -45,11 +48,25 @@ class DensifyGeometries(GeoAlgorithm):
|
||||
VERTICES = 'VERTICES'
|
||||
OUTPUT = 'OUTPUT'
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name, self.i18n_name = self.trAlgorithm('Densify geometries')
|
||||
self.group, self.i18n_group = self.trAlgorithm('Vector geometry tools')
|
||||
self.tags = self.tr('add,vertices,points')
|
||||
def icon(self):
|
||||
return QgsApplication.getThemeIcon("/providerQgis.svg")
|
||||
|
||||
def svgIconPath(self):
|
||||
return QgsApplication.iconPath("providerQgis.svg")
|
||||
|
||||
def tags(self):
|
||||
return self.tr('add,vertices,points').split(',')
|
||||
|
||||
def group(self):
|
||||
return self.tr('Vector geometry tools')
|
||||
|
||||
def name(self):
|
||||
return 'densifygeometries'
|
||||
|
||||
def displayName(self):
|
||||
return self.tr('Densify geometries')
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.addParameter(ParameterVector(self.INPUT,
|
||||
self.tr('Input layer'),
|
||||
[dataobjects.TYPE_VECTOR_POLYGON, dataobjects.TYPE_VECTOR_LINE]))
|
||||
|
@ -29,7 +29,10 @@ __revision__ = '$Format:%H$'
|
||||
|
||||
from math import sqrt
|
||||
|
||||
from qgis.core import QgsPoint, QgsGeometry, QgsWkbTypes
|
||||
from qgis.core import (QgsPoint,
|
||||
QgsGeometry,
|
||||
QgsWkbTypes,
|
||||
QgsApplication)
|
||||
|
||||
from processing.core.GeoAlgorithm import GeoAlgorithm
|
||||
from processing.core.parameters import ParameterVector
|
||||
@ -44,10 +47,22 @@ class DensifyGeometriesInterval(GeoAlgorithm):
|
||||
INTERVAL = 'INTERVAL'
|
||||
OUTPUT = 'OUTPUT'
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name, self.i18n_name = self.trAlgorithm('Densify geometries given an interval')
|
||||
self.group, self.i18n_group = self.trAlgorithm('Vector geometry tools')
|
||||
def icon(self):
|
||||
return QgsApplication.getThemeIcon("/providerQgis.svg")
|
||||
|
||||
def svgIconPath(self):
|
||||
return QgsApplication.iconPath("providerQgis.svg")
|
||||
|
||||
def group(self):
|
||||
return self.tr('Vector geometry tools')
|
||||
|
||||
def name(self):
|
||||
return 'densifygeometriesgivenaninterval'
|
||||
|
||||
def displayName(self):
|
||||
return self.tr('Densify geometries given an interval')
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.addParameter(ParameterVector(self.INPUT,
|
||||
self.tr('Input layer'),
|
||||
[dataobjects.TYPE_VECTOR_POLYGON, dataobjects.TYPE_VECTOR_LINE]))
|
||||
|
@ -46,12 +46,19 @@ class Difference(GeoAlgorithm):
|
||||
IGNORE_INVALID = 'IGNORE_INVALID'
|
||||
OUTPUT = 'OUTPUT'
|
||||
|
||||
def getIcon(self):
|
||||
def icon(self):
|
||||
return QIcon(os.path.join(pluginPath, 'images', 'ftools', 'difference.png'))
|
||||
|
||||
def group(self):
|
||||
return self.tr('Vector overlay tools')
|
||||
|
||||
def name(self):
|
||||
return 'difference'
|
||||
|
||||
def displayName(self):
|
||||
return self.tr('Difference')
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name, self.i18n_name = self.trAlgorithm('Difference')
|
||||
self.group, self.i18n_group = self.trAlgorithm('Vector overlay tools')
|
||||
self.addParameter(ParameterVector(Difference.INPUT,
|
||||
self.tr('Input layer')))
|
||||
self.addParameter(ParameterVector(Difference.OVERLAY,
|
||||
|
@ -51,12 +51,19 @@ class Dissolve(GeoAlgorithm):
|
||||
FIELD = 'FIELD'
|
||||
DISSOLVE_ALL = 'DISSOLVE_ALL'
|
||||
|
||||
def getIcon(self):
|
||||
def icon(self):
|
||||
return QIcon(os.path.join(pluginPath, 'images', 'ftools', 'dissolve.png'))
|
||||
|
||||
def group(self):
|
||||
return self.tr('Vector geometry tools')
|
||||
|
||||
def name(self):
|
||||
return 'dissolve'
|
||||
|
||||
def displayName(self):
|
||||
return self.tr('Dissolve')
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name = 'Dissolve'
|
||||
self.group = 'Vector geometry tools'
|
||||
self.addParameter(ParameterVector(Dissolve.INPUT,
|
||||
self.tr('Input layer'),
|
||||
[dataobjects.TYPE_VECTOR_POLYGON, dataobjects.TYPE_VECTOR_LINE]))
|
||||
|
@ -25,7 +25,10 @@ __copyright__ = '(C) 2016, Nyall Dawson'
|
||||
|
||||
__revision__ = '$Format:%H$'
|
||||
|
||||
from qgis.core import QgsFeatureRequest, QgsWkbTypes, QgsCoordinateReferenceSystem
|
||||
from qgis.core import (QgsFeatureRequest,
|
||||
QgsWkbTypes,
|
||||
QgsCoordinateReferenceSystem,
|
||||
QgsApplication)
|
||||
from processing.core.GeoAlgorithm import GeoAlgorithm
|
||||
from processing.core.parameters import ParameterVector
|
||||
from processing.core.outputs import OutputVector
|
||||
@ -37,11 +40,25 @@ class DropGeometry(GeoAlgorithm):
|
||||
INPUT_LAYER = 'INPUT_LAYER'
|
||||
OUTPUT_TABLE = 'OUTPUT_TABLE'
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name, self.i18n_name = self.trAlgorithm('Drop geometries')
|
||||
self.group, self.i18n_group = self.trAlgorithm('Vector general tools')
|
||||
self.tags = self.tr('remove,drop,delete,geometry,objects')
|
||||
def icon(self):
|
||||
return QgsApplication.getThemeIcon("/providerQgis.svg")
|
||||
|
||||
def svgIconPath(self):
|
||||
return QgsApplication.iconPath("providerQgis.svg")
|
||||
|
||||
def tags(self):
|
||||
return self.tr('remove,drop,delete,geometry,objects').split(',')
|
||||
|
||||
def group(self):
|
||||
return self.tr('Vector general tools')
|
||||
|
||||
def name(self):
|
||||
return 'dropgeometries'
|
||||
|
||||
def displayName(self):
|
||||
return self.tr('Drop geometries')
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.addParameter(ParameterVector(self.INPUT_LAYER,
|
||||
self.tr('Input layer'), [dataobjects.TYPE_VECTOR_POINT,
|
||||
dataobjects.TYPE_VECTOR_LINE,
|
||||
|
@ -53,13 +53,19 @@ class EliminateSelection(GeoAlgorithm):
|
||||
MODE_SMALLEST_AREA = 1
|
||||
MODE_BOUNDARY = 2
|
||||
|
||||
def getIcon(self):
|
||||
def icon(self):
|
||||
return QIcon(os.path.join(pluginPath, 'images', 'ftools', 'eliminate.png'))
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name, self.i18n_name = self.trAlgorithm('Eliminate selected polygons')
|
||||
self.group, self.i18n_group = self.trAlgorithm('Vector geometry tools')
|
||||
def group(self):
|
||||
return self.tr('Vector geometry tools')
|
||||
|
||||
def name(self):
|
||||
return 'eliminateselectedpolygons'
|
||||
|
||||
def displayName(self):
|
||||
return self.tr('Eliminate selected polygons')
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.modes = [self.tr('Largest area'),
|
||||
self.tr('Smallest Area'),
|
||||
self.tr('Largest common boundary')]
|
||||
@ -78,7 +84,7 @@ class EliminateSelection(GeoAlgorithm):
|
||||
|
||||
if inLayer.selectedFeatureCount() == 0:
|
||||
ProcessingLog.addToLog(ProcessingLog.LOG_WARNING,
|
||||
self.tr('{0}: (No selection in input layer "{1}")').format(self.commandLineName(), self.getParameterValue(self.INPUT)))
|
||||
self.tr('{0}: (No selection in input layer "{1}")').format(self.displayName(), self.getParameterValue(self.INPUT)))
|
||||
|
||||
featToEliminate = []
|
||||
selFeatIds = inLayer.selectedFeatureIds()
|
||||
|
@ -26,7 +26,9 @@ __copyright__ = '(C) 2012, Victor Olaya'
|
||||
__revision__ = '$Format:%H$'
|
||||
|
||||
from qgis.PyQt.QtCore import QVariant
|
||||
from qgis.core import QgsField, QgsFeature
|
||||
from qgis.core import (QgsField,
|
||||
QgsFeature,
|
||||
QgsApplication)
|
||||
from processing.core.GeoAlgorithm import GeoAlgorithm
|
||||
from processing.core.parameters import ParameterVector
|
||||
from processing.core.parameters import ParameterTableField
|
||||
@ -40,9 +42,22 @@ class EquivalentNumField(GeoAlgorithm):
|
||||
OUTPUT = 'OUTPUT'
|
||||
FIELD = 'FIELD'
|
||||
|
||||
def icon(self):
|
||||
return QgsApplication.getThemeIcon("/providerQgis.svg")
|
||||
|
||||
def svgIconPath(self):
|
||||
return QgsApplication.iconPath("providerQgis.svg")
|
||||
|
||||
def group(self):
|
||||
return self.tr('Vector table tools')
|
||||
|
||||
def name(self):
|
||||
return 'adduniquevalueindexfield'
|
||||
|
||||
def displayName(self):
|
||||
return self.tr('Add unique value index field')
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name, self.i18n_name = self.trAlgorithm('Add unique value index field')
|
||||
self.group, self.i18n_group = self.trAlgorithm('Vector table tools')
|
||||
self.addParameter(ParameterVector(self.INPUT,
|
||||
self.tr('Input layer')))
|
||||
self.addParameter(ParameterTableField(self.FIELD,
|
||||
|
@ -26,8 +26,11 @@ __copyright__ = '(C) 2016, Hugo Mercier'
|
||||
__revision__ = '$Format:%H$'
|
||||
|
||||
from qgis.core import (QgsFeature,
|
||||
QgsVirtualLayerDefinition, QgsVectorLayer,
|
||||
QgsCoordinateReferenceSystem, QgsWkbTypes)
|
||||
QgsVirtualLayerDefinition,
|
||||
QgsVectorLayer,
|
||||
QgsCoordinateReferenceSystem,
|
||||
QgsWkbTypes,
|
||||
QgsApplication)
|
||||
|
||||
from processing.core.GeoAlgorithm import GeoAlgorithm
|
||||
from processing.core.GeoAlgorithmExecutionException import GeoAlgorithmExecutionException
|
||||
@ -53,10 +56,22 @@ class ExecuteSQL(GeoAlgorithm):
|
||||
INPUT_GEOMETRY_CRS = 'INPUT_GEOMETRY_CRS'
|
||||
OUTPUT_LAYER = 'OUTPUT_LAYER'
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name, self.i18n_name = self.trAlgorithm('Execute SQL')
|
||||
self.group, self.i18n_group = self.trAlgorithm('Vector general tools')
|
||||
def icon(self):
|
||||
return QgsApplication.getThemeIcon("/providerQgis.svg")
|
||||
|
||||
def svgIconPath(self):
|
||||
return QgsApplication.iconPath("providerQgis.svg")
|
||||
|
||||
def group(self):
|
||||
return self.tr('Vector general tools')
|
||||
|
||||
def name(self):
|
||||
return 'executesql'
|
||||
|
||||
def displayName(self):
|
||||
return self.tr('Execute SQL')
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.addParameter(ParameterMultipleInput(name=self.INPUT_DATASOURCES,
|
||||
description=self.tr('Additional input datasources (called input1, .., inputN in the query)'),
|
||||
optional=True))
|
||||
|
@ -26,7 +26,10 @@ __copyright__ = '(C) 2012, Victor Olaya'
|
||||
|
||||
__revision__ = '$Format:%H$'
|
||||
|
||||
from qgis.core import QgsFeature, QgsGeometry, QgsWkbTypes
|
||||
from qgis.core import (QgsFeature,
|
||||
QgsGeometry,
|
||||
QgsWkbTypes,
|
||||
QgsApplication)
|
||||
from processing.core.GeoAlgorithm import GeoAlgorithm
|
||||
from processing.core.parameters import ParameterVector
|
||||
from processing.core.outputs import OutputVector
|
||||
@ -38,9 +41,22 @@ class Explode(GeoAlgorithm):
|
||||
INPUT = 'INPUT'
|
||||
OUTPUT = 'OUTPUT'
|
||||
|
||||
def icon(self):
|
||||
return QgsApplication.getThemeIcon("/providerQgis.svg")
|
||||
|
||||
def svgIconPath(self):
|
||||
return QgsApplication.iconPath("providerQgis.svg")
|
||||
|
||||
def group(self):
|
||||
return self.tr('Vector geometry tools')
|
||||
|
||||
def name(self):
|
||||
return 'explodelines'
|
||||
|
||||
def displayName(self):
|
||||
return self.tr('Explode lines')
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name, self.i18n_name = self.trAlgorithm('Explode lines')
|
||||
self.group, self.i18n_group = self.trAlgorithm('Vector geometry tools')
|
||||
self.addParameter(ParameterVector(self.INPUT,
|
||||
self.tr('Input layer'),
|
||||
[dataobjects.TYPE_VECTOR_LINE]))
|
||||
|
@ -48,14 +48,22 @@ class ExportGeometryInfo(GeoAlgorithm):
|
||||
METHOD = 'CALC_METHOD'
|
||||
OUTPUT = 'OUTPUT'
|
||||
|
||||
def getIcon(self):
|
||||
def icon(self):
|
||||
return QIcon(os.path.join(pluginPath, 'images', 'ftools', 'export_geometry.png'))
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name, self.i18n_name = self.trAlgorithm('Export/Add geometry columns')
|
||||
self.tags = self.tr('export,measurements,areas,lengths,perimeters,latitudes,longitudes,x,y,z,extract,points,lines,polygons')
|
||||
self.group, self.i18n_group = self.trAlgorithm('Vector table tools')
|
||||
def tags(self):
|
||||
return self.tr('export,measurements,areas,lengths,perimeters,latitudes,longitudes,x,y,z,extract,points,lines,polygons').split(',')
|
||||
|
||||
def group(self):
|
||||
return self.tr('Vector table tools')
|
||||
|
||||
def name(self):
|
||||
return 'exportaddgeometrycolumns'
|
||||
|
||||
def displayName(self):
|
||||
return self.tr('Export/Add geometry columns')
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.calc_methods = [self.tr('Layer CRS'),
|
||||
self.tr('Project CRS'),
|
||||
self.tr('Ellipsoidal')]
|
||||
|
@ -25,7 +25,7 @@ __copyright__ = '(C) 2016, Nyall Dawson'
|
||||
|
||||
__revision__ = '$Format:%H$'
|
||||
|
||||
|
||||
from qgis.core import (QgsApplication)
|
||||
from processing.core.GeoAlgorithm import GeoAlgorithm
|
||||
from processing.core.GeoAlgorithmExecutionException import GeoAlgorithmExecutionException
|
||||
from processing.core.parameters import ParameterVector, ParameterNumber
|
||||
@ -40,10 +40,22 @@ class ExtendLines(GeoAlgorithm):
|
||||
START_DISTANCE = 'START_DISTANCE'
|
||||
END_DISTANCE = 'END_DISTANCE'
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name, self.i18n_name = self.trAlgorithm('Extend lines')
|
||||
self.group, self.i18n_group = self.trAlgorithm('Vector geometry tools')
|
||||
def icon(self):
|
||||
return QgsApplication.getThemeIcon("/providerQgis.svg")
|
||||
|
||||
def svgIconPath(self):
|
||||
return QgsApplication.iconPath("providerQgis.svg")
|
||||
|
||||
def group(self):
|
||||
return self.tr('Vector geometry tools')
|
||||
|
||||
def name(self):
|
||||
return 'extendlines'
|
||||
|
||||
def displayName(self):
|
||||
return self.tr('Extend lines')
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.addParameter(ParameterVector(self.INPUT_LAYER,
|
||||
self.tr('Input layer'), [dataobjects.TYPE_VECTOR_LINE]))
|
||||
self.addParameter(ParameterNumber(self.START_DISTANCE,
|
||||
|
@ -48,14 +48,22 @@ class ExtentFromLayer(GeoAlgorithm):
|
||||
|
||||
OUTPUT = 'OUTPUT'
|
||||
|
||||
def getIcon(self):
|
||||
def icon(self):
|
||||
return QIcon(os.path.join(pluginPath, 'images', 'ftools', 'layer_extent.png'))
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name, self.i18n_name = self.trAlgorithm('Polygon from layer extent')
|
||||
self.group, self.i18n_group = self.trAlgorithm('Vector general tools')
|
||||
self.tags = self.tr('extent,envelope,bounds,bounding,boundary,layer')
|
||||
def tags(self):
|
||||
return self.tr('extent,envelope,bounds,bounding,boundary,layer').split(',')
|
||||
|
||||
def group(self):
|
||||
return self.tr('Vector general tools')
|
||||
|
||||
def name(self):
|
||||
return 'polygonfromlayerextent'
|
||||
|
||||
def displayName(self):
|
||||
return self.tr('Polygon from layer extent')
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.addParameter(ParameterVector(self.INPUT_LAYER,
|
||||
self.tr('Input layer')))
|
||||
self.addParameter(ParameterBoolean(self.BY_FEATURE,
|
||||
|
@ -26,7 +26,9 @@ __copyright__ = '(C) 2010, Michael Minn'
|
||||
__revision__ = '$Format:%H$'
|
||||
|
||||
from qgis.PyQt.QtCore import QVariant
|
||||
from qgis.core import QgsExpression, QgsFeatureRequest
|
||||
from qgis.core import (QgsExpression,
|
||||
QgsFeatureRequest,
|
||||
QgsApplication)
|
||||
from processing.core.GeoAlgorithm import GeoAlgorithm
|
||||
from processing.core.GeoAlgorithmExecutionException import GeoAlgorithmExecutionException
|
||||
from processing.core.parameters import ParameterVector
|
||||
@ -60,11 +62,25 @@ class ExtractByAttribute(GeoAlgorithm):
|
||||
'contains',
|
||||
'does not contain']
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name, self.i18n_name = self.trAlgorithm('Extract by attribute')
|
||||
self.group, self.i18n_group = self.trAlgorithm('Vector selection tools')
|
||||
self.tags = self.tr('extract,filter,attribute,value,contains,null,field')
|
||||
def icon(self):
|
||||
return QgsApplication.getThemeIcon("/providerQgis.svg")
|
||||
|
||||
def svgIconPath(self):
|
||||
return QgsApplication.iconPath("providerQgis.svg")
|
||||
|
||||
def tags(self):
|
||||
return self.tr('extract,filter,attribute,value,contains,null,field').split(',')
|
||||
|
||||
def group(self):
|
||||
return self.tr('Vector selection tools')
|
||||
|
||||
def name(self):
|
||||
return 'extractbyattribute'
|
||||
|
||||
def displayName(self):
|
||||
return self.tr('Extract by attribute')
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.i18n_operators = ['=',
|
||||
'!=',
|
||||
'>',
|
||||
|
@ -24,7 +24,9 @@ __copyright__ = '(C) 2016, Nyall Dawson'
|
||||
|
||||
__revision__ = '$Format:%H$'
|
||||
|
||||
from qgis.core import QgsExpression, QgsFeatureRequest
|
||||
from qgis.core import (QgsExpression,
|
||||
QgsFeatureRequest,
|
||||
QgsApplication)
|
||||
|
||||
from processing.core.GeoAlgorithmExecutionException import GeoAlgorithmExecutionException
|
||||
from processing.core.parameters import ParameterVector
|
||||
@ -40,11 +42,25 @@ class ExtractByExpression(GeoAlgorithm):
|
||||
EXPRESSION = 'EXPRESSION'
|
||||
OUTPUT = 'OUTPUT'
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name, self.i18n_name = self.trAlgorithm('Extract by expression')
|
||||
self.group, self.i18n_group = self.trAlgorithm('Vector selection tools')
|
||||
self.tags = self.tr('extract,filter,expression,field')
|
||||
def icon(self):
|
||||
return QgsApplication.getThemeIcon("/providerQgis.svg")
|
||||
|
||||
def svgIconPath(self):
|
||||
return QgsApplication.iconPath("providerQgis.svg")
|
||||
|
||||
def tags(self):
|
||||
return self.tr('extract,filter,expression,field').split(',')
|
||||
|
||||
def group(self):
|
||||
return self.tr('Vector selection tools')
|
||||
|
||||
def name(self):
|
||||
return 'extractbyexpression'
|
||||
|
||||
def displayName(self):
|
||||
return self.tr('Extract by expression')
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.addParameter(ParameterVector(self.INPUT,
|
||||
self.tr('Input Layer')))
|
||||
self.addParameter(ParameterExpression(self.EXPRESSION,
|
||||
|
@ -25,7 +25,8 @@ __copyright__ = '(C) 2012, Victor Olaya'
|
||||
|
||||
__revision__ = '$Format:%H$'
|
||||
|
||||
from qgis.core import QgsFeatureRequest
|
||||
from qgis.core import (QgsFeatureRequest,
|
||||
QgsApplication)
|
||||
from processing.core.GeoAlgorithm import GeoAlgorithm
|
||||
from processing.core.parameters import ParameterVector
|
||||
from processing.core.parameters import ParameterSelection
|
||||
@ -42,11 +43,25 @@ class ExtractByLocation(GeoAlgorithm):
|
||||
PRECISION = 'PRECISION'
|
||||
OUTPUT = 'OUTPUT'
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name, self.i18n_name = self.trAlgorithm('Extract by location')
|
||||
self.group, self.i18n_group = self.trAlgorithm('Vector selection tools')
|
||||
self.tags = self.tr('extract,filter,location,intersects,contains,within')
|
||||
def icon(self):
|
||||
return QgsApplication.getThemeIcon("/providerQgis.svg")
|
||||
|
||||
def svgIconPath(self):
|
||||
return QgsApplication.iconPath("providerQgis.svg")
|
||||
|
||||
def tags(self):
|
||||
return self.tr('extract,filter,location,intersects,contains,within').split(',')
|
||||
|
||||
def group(self):
|
||||
return self.tr('Vector selection tools')
|
||||
|
||||
def name(self):
|
||||
return 'extractbylocation'
|
||||
|
||||
def displayName(self):
|
||||
return self.tr('Extract by location')
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.predicates = (
|
||||
('intersects', self.tr('intersects')),
|
||||
('contains', self.tr('contains')),
|
||||
|
@ -46,13 +46,19 @@ class ExtractNodes(GeoAlgorithm):
|
||||
INPUT = 'INPUT'
|
||||
OUTPUT = 'OUTPUT'
|
||||
|
||||
def getIcon(self):
|
||||
def icon(self):
|
||||
return QIcon(os.path.join(pluginPath, 'images', 'ftools', 'extract_nodes.png'))
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name, self.i18n_name = self.trAlgorithm('Extract nodes')
|
||||
self.group, self.i18n_group = self.trAlgorithm('Vector geometry tools')
|
||||
def group(self):
|
||||
return self.tr('Vector geometry tools')
|
||||
|
||||
def name(self):
|
||||
return 'extractnodes'
|
||||
|
||||
def displayName(self):
|
||||
return self.tr('Extract nodes')
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.addParameter(ParameterVector(self.INPUT,
|
||||
self.tr('Input layer'),
|
||||
[dataobjects.TYPE_VECTOR_POLYGON,
|
||||
|
@ -32,7 +32,11 @@ from processing.core.parameters import ParameterVector, ParameterString
|
||||
from processing.core.outputs import OutputVector
|
||||
from processing.tools import dataobjects, vector
|
||||
|
||||
from qgis.core import QgsWkbTypes, QgsFeature, QgsGeometry, QgsField
|
||||
from qgis.core import (QgsWkbTypes,
|
||||
QgsFeature,
|
||||
QgsGeometry,
|
||||
QgsField,
|
||||
QgsApplication)
|
||||
from qgis.PyQt.QtCore import QVariant
|
||||
|
||||
|
||||
@ -42,10 +46,22 @@ class ExtractSpecificNodes(GeoAlgorithm):
|
||||
OUTPUT_LAYER = 'OUTPUT_LAYER'
|
||||
NODES = 'NODES'
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name, self.i18n_name = self.trAlgorithm('Extract specific nodes')
|
||||
self.group, self.i18n_group = self.trAlgorithm('Vector geometry tools')
|
||||
def icon(self):
|
||||
return QgsApplication.getThemeIcon("/providerQgis.svg")
|
||||
|
||||
def svgIconPath(self):
|
||||
return QgsApplication.iconPath("providerQgis.svg")
|
||||
|
||||
def group(self):
|
||||
return self.tr('Vector geometry tools')
|
||||
|
||||
def name(self):
|
||||
return 'extractspecificnodes'
|
||||
|
||||
def displayName(self):
|
||||
return self.tr('Extract specific nodes')
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.addParameter(ParameterVector(self.INPUT_LAYER,
|
||||
self.tr('Input layer'), [dataobjects.TYPE_VECTOR_ANY]))
|
||||
self.addParameter(ParameterString(self.NODES,
|
||||
|
@ -29,7 +29,9 @@ __revision__ = '$Format:%H$'
|
||||
import sys
|
||||
|
||||
from qgis.PyQt.QtCore import QVariant
|
||||
from qgis.core import QgsFeature, QgsField
|
||||
from qgis.core import (QgsFeature,
|
||||
QgsField,
|
||||
QgsApplication)
|
||||
from processing.core.GeoAlgorithm import GeoAlgorithm
|
||||
from processing.core.GeoAlgorithmExecutionException import GeoAlgorithmExecutionException
|
||||
from processing.core.parameters import ParameterVector
|
||||
@ -54,10 +56,22 @@ class FieldsPyculator(GeoAlgorithm):
|
||||
|
||||
TYPES = [QVariant.Int, QVariant.Double, QVariant.String]
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name, self.i18n_name = self.trAlgorithm('Advanced Python field calculator')
|
||||
self.group, self.i18n_group = self.trAlgorithm('Vector table tools')
|
||||
def icon(self):
|
||||
return QgsApplication.getThemeIcon("/providerQgis.svg")
|
||||
|
||||
def svgIconPath(self):
|
||||
return QgsApplication.iconPath("providerQgis.svg")
|
||||
|
||||
def group(self):
|
||||
return self.tr('Vector table tools')
|
||||
|
||||
def name(self):
|
||||
return 'advancedpythonfieldcalculator'
|
||||
|
||||
def displayName(self):
|
||||
return self.tr('Advanced Python field calculator')
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.type_names = [self.tr('Integer'),
|
||||
self.tr('Float'),
|
||||
self.tr('String')]
|
||||
|
@ -26,7 +26,15 @@ __copyright__ = '(C) 2012, Victor Olaya'
|
||||
__revision__ = '$Format:%H$'
|
||||
|
||||
from qgis.PyQt.QtCore import QVariant
|
||||
from qgis.core import QgsExpression, QgsExpressionContext, QgsExpressionContextUtils, QgsFeature, QgsField, QgsDistanceArea, QgsProject, GEO_NONE
|
||||
from qgis.core import (QgsExpression,
|
||||
QgsExpressionContext,
|
||||
QgsExpressionContextUtils,
|
||||
QgsFeature,
|
||||
QgsField,
|
||||
QgsDistanceArea,
|
||||
QgsProject,
|
||||
GEO_NONE,
|
||||
QgsApplication)
|
||||
from processing.core.GeoAlgorithm import GeoAlgorithm
|
||||
from processing.core.GeoAlgorithmExecutionException import GeoAlgorithmExecutionException
|
||||
from processing.core.parameters import ParameterVector
|
||||
@ -53,10 +61,22 @@ class FieldsCalculator(GeoAlgorithm):
|
||||
|
||||
TYPES = [QVariant.Double, QVariant.Int, QVariant.String, QVariant.Date]
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.name, self.i18n_name = self.trAlgorithm('Field calculator')
|
||||
self.group, self.i18n_group = self.trAlgorithm('Vector table tools')
|
||||
def icon(self):
|
||||
return QgsApplication.getThemeIcon("/providerQgis.svg")
|
||||
|
||||
def svgIconPath(self):
|
||||
return QgsApplication.iconPath("providerQgis.svg")
|
||||
|
||||
def group(self):
|
||||
return self.tr('Vector table tools')
|
||||
|
||||
def name(self):
|
||||
return 'fieldcalculator'
|
||||
|
||||
def displayName(self):
|
||||
return self.tr('Field calculator')
|
||||
|
||||
def defineCharacteristics(self):
|
||||
self.type_names = [self.tr('Float'),
|
||||
self.tr('Integer'),
|
||||
self.tr('String'),
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user