-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8054 from m-kuhn/geometryCheckPyBindings
Python bindings for QgsGeometryCheck and co
- Loading branch information
Showing
88 changed files
with
3,958 additions
and
1,325 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# The following has been generated automatically from src/analysis/vector/geometry_checker/qgsgeometrycheck.h | ||
QgsGeometryCheck.Flags.baseClass = QgsGeometryCheck | ||
Flags = QgsGeometryCheck # dirty hack since SIP seems to introduce the flags in module |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/************************************************************************ | ||
* This file has been generated automatically from * | ||
* * | ||
* src/analysis/qgsanalysis.h * | ||
* * | ||
* Do not edit manually ! Edit header and run scripts/sipify.pl again * | ||
************************************************************************/ | ||
|
||
|
||
|
||
|
||
|
||
|
||
class QgsAnalysis | ||
{ | ||
%Docstring | ||
QgsAnalysis is a singleton class containing various registry and other global members | ||
related to analysis classes. | ||
|
||
.. versionadded:: 3.4 | ||
%End | ||
|
||
%TypeHeaderCode | ||
#include "qgsanalysis.h" | ||
%End | ||
public: | ||
|
||
|
||
|
||
static QgsAnalysis *instance(); | ||
%Docstring | ||
Returns a pointer to the singleton instance. | ||
%End | ||
|
||
static QgsGeometryCheckRegistry *geometryCheckRegistry(); | ||
%Docstring | ||
Returns the global geometry checker registry, used for managing all geometry check factories. | ||
%End | ||
|
||
private: | ||
QgsAnalysis( const QgsAnalysis &other ); | ||
}; | ||
|
||
/************************************************************************ | ||
* This file has been generated automatically from * | ||
* * | ||
* src/analysis/qgsanalysis.h * | ||
* * | ||
* Do not edit manually ! Edit header and run scripts/sipify.pl again * | ||
************************************************************************/ |
102 changes: 102 additions & 0 deletions
102
python/analysis/auto_generated/vector/geometry_checker/qgsfeaturepool.sip.in
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
/************************************************************************ | ||
* This file has been generated automatically from * | ||
* * | ||
* src/analysis/vector/geometry_checker/qgsfeaturepool.h * | ||
* * | ||
* Do not edit manually ! Edit header and run scripts/sipify.pl again * | ||
************************************************************************/ | ||
|
||
|
||
|
||
|
||
|
||
|
||
class QgsFeaturePool : QgsFeatureSink /Abstract/ | ||
{ | ||
%Docstring | ||
A feature pool is based on a vector layer and caches features. | ||
%End | ||
|
||
%TypeHeaderCode | ||
#include "qgsfeaturepool.h" | ||
%End | ||
public: | ||
QgsFeaturePool( QgsVectorLayer *layer ); | ||
virtual ~QgsFeaturePool(); | ||
|
||
bool getFeature( QgsFeatureId id, QgsFeature &feature ); | ||
%Docstring | ||
Retrieve the feature with the specified ``id`` into ``feature``. | ||
It will be retrieved from the cache or from the underlying layer if unavailable. | ||
If the feature is neither available from the cache nor from the layer it will return false. | ||
%End | ||
|
||
virtual void updateFeature( QgsFeature &feature ) = 0; | ||
%Docstring | ||
Updates a feature in this pool. | ||
Implementations will update the feature on the layer or on the data provider. | ||
%End | ||
|
||
virtual void deleteFeature( QgsFeatureId fid ) = 0; | ||
%Docstring | ||
Removes a feature from this pool. | ||
Implementations will remove the feature from the layer or from the data provider. | ||
%End | ||
|
||
|
||
|
||
QgsVectorLayer *layer() const; | ||
%Docstring | ||
Get a pointer to the underlying layer. | ||
May return a ``None`` if the layer has been deleted. | ||
This must only be called from the main thread. | ||
%End | ||
|
||
|
||
QString layerId() const; | ||
%Docstring | ||
The layer id of the layer. | ||
%End | ||
|
||
QgsWkbTypes::GeometryType geometryType() const; | ||
%Docstring | ||
The geometry type of this layer. | ||
%End | ||
|
||
QgsCoordinateReferenceSystem crs() const; | ||
%Docstring | ||
The coordinate reference system of this layer. | ||
%End | ||
|
||
protected: | ||
|
||
void insertFeature( const QgsFeature &feature ); | ||
%Docstring | ||
Inserts a feature into the cache and the spatial index. | ||
To be used by implementations of ``addFeature``. | ||
%End | ||
|
||
void refreshCache( const QgsFeature &feature ); | ||
%Docstring | ||
Changes a feature in the cache and the spatial index. | ||
To be used by implementations of ``updateFeature``. | ||
%End | ||
|
||
void removeFeature( const QgsFeatureId featureId ); | ||
%Docstring | ||
Removes a feature from the cache and the spatial index. | ||
To be used by implementations of ``deleteFeature``. | ||
%End | ||
|
||
|
||
private: | ||
QgsFeaturePool( const QgsFeaturePool &other ); | ||
}; | ||
|
||
/************************************************************************ | ||
* This file has been generated automatically from * | ||
* * | ||
* src/analysis/vector/geometry_checker/qgsfeaturepool.h * | ||
* * | ||
* Do not edit manually ! Edit header and run scripts/sipify.pl again * | ||
************************************************************************/ |
180 changes: 180 additions & 0 deletions
180
python/analysis/auto_generated/vector/geometry_checker/qgsgeometrycheck.sip.in
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,180 @@ | ||
/************************************************************************ | ||
* This file has been generated automatically from * | ||
* * | ||
* src/analysis/vector/geometry_checker/qgsgeometrycheck.h * | ||
* * | ||
* Do not edit manually ! Edit header and run scripts/sipify.pl again * | ||
************************************************************************/ | ||
|
||
|
||
|
||
|
||
|
||
|
||
class QgsGeometryCheck | ||
{ | ||
%Docstring | ||
************************************************************************* | ||
qgsgeometrycheck.h | ||
--------------------- | ||
begin : September 2014 | ||
copyright : (C) 2014 by Sandro Mani / Sourcepole AG | ||
email : smani at sourcepole dot ch | ||
************************************************************************** | ||
|
||
This program is free software; you can redistribute it and/or modify * | ||
it under the terms of the GNU General Public License as published by * | ||
the Free Software Foundation; either version 2 of the License, or * | ||
(at your option) any later version. * | ||
|
||
************************************************************************** | ||
%End | ||
|
||
%TypeHeaderCode | ||
#include "qgsgeometrycheck.h" | ||
%End | ||
public: | ||
static const QMetaObject staticMetaObject; | ||
|
||
public: | ||
|
||
struct LayerFeatureIds | ||
{ | ||
LayerFeatureIds(); | ||
|
||
|
||
}; | ||
|
||
enum ChangeWhat | ||
{ | ||
ChangeFeature, | ||
ChangePart, | ||
ChangeRing, | ||
ChangeNode | ||
}; | ||
|
||
enum ChangeType | ||
{ | ||
ChangeAdded, | ||
ChangeRemoved, | ||
ChangeChanged | ||
}; | ||
|
||
enum CheckType | ||
{ | ||
FeatureNodeCheck, | ||
FeatureCheck, | ||
LayerCheck | ||
}; | ||
|
||
enum Flag | ||
{ | ||
AvailableInValidation | ||
}; | ||
typedef QFlags<QgsGeometryCheck::Flag> Flags; | ||
|
||
|
||
struct Change | ||
{ | ||
Change(); | ||
|
||
Change( ChangeWhat _what, ChangeType _type, QgsVertexId _vidx = QgsVertexId() ); | ||
%Docstring | ||
Create a new Change | ||
%End | ||
|
||
ChangeWhat what; | ||
|
||
ChangeType type; | ||
|
||
QgsVertexId vidx; | ||
bool operator==( const Change &other ); | ||
}; | ||
|
||
typedef QMap<QString, QMap<QgsFeatureId, QList<Change> > > Changes; | ||
|
||
QgsGeometryCheck( const QgsGeometryCheckContext *context, const QVariantMap &configuration ); | ||
%Docstring | ||
Create a new geometry check. | ||
%End | ||
virtual ~QgsGeometryCheck(); | ||
|
||
|
||
virtual bool isCompatible( QgsVectorLayer *layer ) const; | ||
%Docstring | ||
Returns if this geometry check is compatible with ``layer``. | ||
By default it checks for the geometry type in ``compatibleGeometryTypes``(). | ||
|
||
.. versionadded:: 3.4 | ||
%End | ||
|
||
virtual QList<QgsWkbTypes::GeometryType> compatibleGeometryTypes() const = 0; | ||
%Docstring | ||
A list of geometry types for which this check can be performed. | ||
|
||
.. versionadded:: 3.4 | ||
%End | ||
|
||
virtual QgsGeometryCheck::Flags flags() const; | ||
%Docstring | ||
Flags for this geometry check. | ||
%End | ||
|
||
virtual void collectErrors( const QMap<QString, QgsFeaturePool *> &featurePools, QList<QgsGeometryCheckError *> &errors /In,Out/, QStringList &messages /In,Out/, QgsFeedback *feedback = 0, const LayerFeatureIds &ids = QgsGeometryCheck::LayerFeatureIds() ) const = 0; | ||
%Docstring | ||
The main worker method. | ||
Check all features available from ``featurePools`` and write errors found to ``errors``. | ||
Other status messages can be written to ``messages``. | ||
Progress should be reported to ``feedback``. Only features and layers listed in ``ids`` should be checked. | ||
|
||
.. versionadded:: 3.4 | ||
%End | ||
|
||
|
||
virtual QStringList resolutionMethods() const = 0; | ||
%Docstring | ||
Returns a list of descriptions for available resolutions for errors. The index will be passed as ``method`` to :py:func:`fixError`. | ||
|
||
.. versionadded:: 3.4 | ||
%End | ||
|
||
virtual QString description() const = 0; | ||
%Docstring | ||
Returns a human readable description for this check. | ||
|
||
.. versionadded:: 3.4 | ||
%End | ||
|
||
virtual QString id() const = 0; | ||
%Docstring | ||
Returns an id for this check. | ||
|
||
.. versionadded:: 3.4 | ||
%End | ||
|
||
virtual CheckType checkType() const = 0; | ||
%Docstring | ||
Returns the check type. | ||
|
||
.. versionadded:: 3.4 | ||
%End | ||
|
||
const QgsGeometryCheckContext *context() const; | ||
%Docstring | ||
Returns the context | ||
|
||
.. versionadded:: 3.4 | ||
%End | ||
|
||
protected: | ||
|
||
|
||
}; | ||
|
||
/************************************************************************ | ||
* This file has been generated automatically from * | ||
* * | ||
* src/analysis/vector/geometry_checker/qgsgeometrycheck.h * | ||
* * | ||
* Do not edit manually ! Edit header and run scripts/sipify.pl again * | ||
************************************************************************/ |
Oops, something went wrong.