mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-08 00:05:09 -04:00
108 lines
3.4 KiB
Plaintext
108 lines
3.4 KiB
Plaintext
/************************************************************************
|
|
* This file has been generated automatically from *
|
|
* *
|
|
* src/core/qgsmaplayerutils.h *
|
|
* *
|
|
* Do not edit manually ! Edit header and run scripts/sipify.py again *
|
|
************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
class QgsMapLayerUtils
|
|
{
|
|
%Docstring(signature="appended")
|
|
Contains utility functions for working with map layers.
|
|
|
|
.. versionadded:: 3.20
|
|
%End
|
|
|
|
%TypeHeaderCode
|
|
#include "qgsmaplayerutils.h"
|
|
%End
|
|
public:
|
|
|
|
static QgsRectangle combinedExtent( const QList<QgsMapLayer *> &layers, const QgsCoordinateReferenceSystem &crs, const QgsCoordinateTransformContext &transformContext );
|
|
%Docstring
|
|
Returns the combined extent of a list of ``layers``.
|
|
|
|
The ``crs`` argument specifies the desired coordinate reference system
|
|
for the combined extent.
|
|
%End
|
|
|
|
static QgsAbstractDatabaseProviderConnection *databaseConnection( const QgsMapLayer *layer ) /Factory/;
|
|
%Docstring
|
|
Creates and returns the (possibly ``None``) database connection for a
|
|
``layer``. Ownership is transferred to the caller.
|
|
|
|
.. versionadded:: 3.22
|
|
%End
|
|
|
|
static bool layerSourceMatchesPath( const QgsMapLayer *layer, const QString &path );
|
|
%Docstring
|
|
Returns ``True`` if the source of the specified ``layer`` matches the
|
|
given ``path``.
|
|
|
|
This method can be used to test whether a layer is associated with a
|
|
file path.
|
|
|
|
.. versionadded:: 3.22
|
|
%End
|
|
|
|
static bool updateLayerSourcePath( QgsMapLayer *layer, const QString &newPath );
|
|
%Docstring
|
|
Updates a ``layer``'s data source, replacing its data source with a path
|
|
referring to ``newPath``.
|
|
|
|
Returns ``True`` if the layer was updated, or ``False`` if the layer was
|
|
not updated (e.g. it uses a data provider which does not specify paths
|
|
in a layer URI.
|
|
|
|
.. versionadded:: 3.22
|
|
%End
|
|
|
|
static QList< QgsMapLayer * > sortLayersByType( const QList< QgsMapLayer * > &layers, const QList< Qgis::LayerType > &order );
|
|
%Docstring
|
|
Sorts a list of map ``layers`` by their layer type, respecting the
|
|
``order`` of types specified.
|
|
|
|
Layer types which appear earlier in the ``order`` list will result in
|
|
matching layers appearing earlier in the result list.
|
|
|
|
.. versionadded:: 3.26
|
|
%End
|
|
|
|
static QString launderLayerName( const QString &name );
|
|
%Docstring
|
|
Launders a layer's name, converting it into a format which is general
|
|
suitable for file names or database layer names.
|
|
|
|
Specifically this method:
|
|
|
|
- Converts the name to lowercase
|
|
- Replaces spaces by underscore characters
|
|
- Removes any characters which are not alphanumeric or '_'.
|
|
|
|
.. versionadded:: 3.28
|
|
%End
|
|
|
|
static bool isOpenStreetMapLayer( QgsMapLayer *layer );
|
|
%Docstring
|
|
Returns ``True`` if the layer is served by OpenStreetMap server.
|
|
|
|
.. versionadded:: 3.40
|
|
%End
|
|
|
|
};
|
|
|
|
|
|
|
|
/************************************************************************
|
|
* This file has been generated automatically from *
|
|
* *
|
|
* src/core/qgsmaplayerutils.h *
|
|
* *
|
|
* Do not edit manually ! Edit header and run scripts/sipify.py again *
|
|
************************************************************************/
|