2017-04-05 14:37:06 +10:00
|
|
|
/************************************************************************
|
|
|
|
* This file has been generated automatically from *
|
|
|
|
* *
|
|
|
|
* src/core/processing/qgsprocessingutils.h *
|
|
|
|
* *
|
|
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
|
|
************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class QgsProcessingUtils
|
|
|
|
{
|
|
|
|
%Docstring
|
|
|
|
Utility functions for use with processing classes.
|
|
|
|
.. versionadded:: 3.0
|
|
|
|
%End
|
|
|
|
|
|
|
|
%TypeHeaderCode
|
|
|
|
#include "qgsprocessingutils.h"
|
|
|
|
%End
|
|
|
|
public:
|
|
|
|
|
|
|
|
static QList< QgsRasterLayer * > compatibleRasterLayers( QgsProject *project, bool sort = true );
|
|
|
|
%Docstring
|
2017-04-17 13:49:59 +10:00
|
|
|
Returns a list of raster layers from a ``project`` which are compatible with the processing
|
2017-04-05 14:37:06 +10:00
|
|
|
framework.
|
|
|
|
|
2017-04-17 13:49:59 +10:00
|
|
|
If the ``sort`` argument is true then the layers will be sorted by their QgsMapLayer.name()
|
2017-04-05 14:37:06 +10:00
|
|
|
value.
|
|
|
|
\see compatibleVectorLayers()
|
|
|
|
\see compatibleLayers()
|
2017-04-07 11:23:53 +10:00
|
|
|
:rtype: list of QgsRasterLayer
|
2017-04-05 14:37:06 +10:00
|
|
|
%End
|
|
|
|
|
|
|
|
static QList< QgsVectorLayer * > compatibleVectorLayers( QgsProject *project,
|
|
|
|
const QList< QgsWkbTypes::GeometryType > &geometryTypes = QList< QgsWkbTypes::GeometryType >(),
|
|
|
|
bool sort = true );
|
|
|
|
%Docstring
|
2017-04-17 13:49:59 +10:00
|
|
|
Returns a list of vector layers from a ``project`` which are compatible with the processing
|
2017-04-05 14:37:06 +10:00
|
|
|
framework.
|
|
|
|
|
2017-04-17 13:49:59 +10:00
|
|
|
If the ``geometryTypes`` list is non-empty then the layers will be sorted so that only
|
|
|
|
layers with geometry types included in the list will be returned. Leaving the ``geometryTypes``
|
2017-04-05 14:37:06 +10:00
|
|
|
list empty will cause all vector layers, regardless of their geometry type, to be returned.
|
|
|
|
|
2017-04-17 13:49:59 +10:00
|
|
|
If the ``sort`` argument is true then the layers will be sorted by their QgsMapLayer.name()
|
2017-04-05 14:37:06 +10:00
|
|
|
value.
|
|
|
|
\see compatibleRasterLayers()
|
|
|
|
\see compatibleLayers()
|
2017-04-07 11:23:53 +10:00
|
|
|
:rtype: list of QgsVectorLayer
|
2017-04-05 14:37:06 +10:00
|
|
|
%End
|
|
|
|
|
|
|
|
static QList< QgsMapLayer * > compatibleLayers( QgsProject *project, bool sort = true );
|
|
|
|
%Docstring
|
2017-04-17 13:49:59 +10:00
|
|
|
Returns a list of map layers from a ``project`` which are compatible with the processing
|
2017-04-05 14:37:06 +10:00
|
|
|
framework.
|
|
|
|
|
2017-04-17 13:49:59 +10:00
|
|
|
If the ``sort`` argument is true then the layers will be sorted by their QgsMapLayer.name()
|
2017-04-05 14:37:06 +10:00
|
|
|
value.
|
|
|
|
\see compatibleRasterLayers()
|
|
|
|
\see compatibleVectorLayers()
|
2017-04-07 11:23:53 +10:00
|
|
|
:rtype: list of QgsMapLayer
|
2017-04-05 14:37:06 +10:00
|
|
|
%End
|
|
|
|
|
2017-04-05 18:35:55 +10:00
|
|
|
|
|
|
|
static QgsMapLayer *mapLayerFromProject( const QString &string, QgsProject *project );
|
|
|
|
%Docstring
|
2017-04-17 13:49:59 +10:00
|
|
|
Interprets a ``string`` as a map layer from a project.
|
2017-04-05 18:35:55 +10:00
|
|
|
|
|
|
|
This method attempts to match a string to a project map layer, using
|
|
|
|
first the layer ID, then layer names, and finally layer source.
|
|
|
|
If the string matches a normalized version of any layer source
|
2017-04-17 13:49:59 +10:00
|
|
|
for layers in the specified ``project``, then those matching layers will be
|
2017-04-05 18:35:55 +10:00
|
|
|
returned.
|
|
|
|
\see mapLayerFromString()
|
2017-04-07 11:23:53 +10:00
|
|
|
:rtype: QgsMapLayer
|
2017-04-05 18:35:55 +10:00
|
|
|
%End
|
|
|
|
|
|
|
|
static QgsMapLayer *mapLayerFromString( const QString &string ) /Factory/;
|
|
|
|
%Docstring
|
|
|
|
Interprets a string as a map layer. The method will attempt to
|
2017-04-17 13:49:59 +10:00
|
|
|
load a layer matching the passed ``string``. E.g. if the string is a file path,
|
2017-04-05 18:35:55 +10:00
|
|
|
then the layer at this file path will be loaded.
|
|
|
|
The caller takes responsibility for deleting the returned map layer.
|
|
|
|
\see mapLayerFromProject()
|
2017-04-07 11:23:53 +10:00
|
|
|
:rtype: QgsMapLayer
|
2017-04-05 18:35:55 +10:00
|
|
|
%End
|
|
|
|
|
|
|
|
static QString normalizeLayerSource( const QString &source );
|
|
|
|
%Docstring
|
2017-04-17 13:49:59 +10:00
|
|
|
Normalizes a layer ``source`` string for safe comparison across different
|
2017-04-05 18:35:55 +10:00
|
|
|
operating system environments.
|
2017-04-07 11:23:53 +10:00
|
|
|
:rtype: str
|
2017-04-05 18:35:55 +10:00
|
|
|
%End
|
|
|
|
|
2017-04-05 14:37:06 +10:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/************************************************************************
|
|
|
|
* This file has been generated automatically from *
|
|
|
|
* *
|
|
|
|
* src/core/processing/qgsprocessingutils.h *
|
|
|
|
* *
|
|
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
|
|
************************************************************************/
|