mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-26 00:02:08 -05:00
Instead, parameters evaluate to QgsFeatureSource, which are used for retrieving features, feature count, crs, wkb type, etc. This abstracts away the actual feature source, so that algorithms may potentially operate from non-layer feature sources. It also helps remove the need for specialised QgsProcessingUtils methods like getFeatures, featureCount, and createSpatialIndex. Instead the standard API methods using QgsFeatureSources can be used instead.
110 lines
2.8 KiB
Plaintext
110 lines
2.8 KiB
Plaintext
/************************************************************************
|
|
* This file has been generated automatically from *
|
|
* *
|
|
* src/core/qgsspatialindex.h *
|
|
* *
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class QgsSpatialIndex
|
|
{
|
|
|
|
%TypeHeaderCode
|
|
#include "qgsspatialindex.h"
|
|
%End
|
|
public:
|
|
|
|
|
|
QgsSpatialIndex();
|
|
%Docstring
|
|
Constructor - creates R-tree
|
|
%End
|
|
|
|
explicit QgsSpatialIndex( const QgsFeatureIterator &fi );
|
|
%Docstring
|
|
Constructor - creates R-tree and bulk loads it with features from the iterator.
|
|
This is much faster approach than creating an empty index and then inserting features one by one.
|
|
|
|
.. versionadded:: 2.8
|
|
%End
|
|
|
|
explicit QgsSpatialIndex( const QgsFeatureSource &source );
|
|
%Docstring
|
|
Constructor - creates R-tree and bulk loads it with features from the source.
|
|
This is much faster approach than creating an empty index and then inserting features one by one.
|
|
|
|
.. versionadded:: 3.0
|
|
%End
|
|
|
|
QgsSpatialIndex( const QgsSpatialIndex &other );
|
|
%Docstring
|
|
Copy constructor
|
|
%End
|
|
|
|
~QgsSpatialIndex();
|
|
%Docstring
|
|
Destructor finalizes work with spatial index
|
|
%End
|
|
|
|
|
|
|
|
bool insertFeature( const QgsFeature &f );
|
|
%Docstring
|
|
Add feature to index
|
|
:rtype: bool
|
|
%End
|
|
|
|
bool insertFeature( QgsFeatureId id, const QgsRectangle &bounds );
|
|
%Docstring
|
|
Add a feature ``id`` to the index with a specified bounding box.
|
|
:return: true if feature was successfully added to index.
|
|
.. versionadded:: 3.0
|
|
:rtype: bool
|
|
%End
|
|
|
|
bool deleteFeature( const QgsFeature &f );
|
|
%Docstring
|
|
Remove feature from index
|
|
:rtype: bool
|
|
%End
|
|
|
|
|
|
|
|
QList<QgsFeatureId> intersects( const QgsRectangle &rect ) const;
|
|
%Docstring
|
|
Returns features that intersect the specified rectangle
|
|
:rtype: list of QgsFeatureId
|
|
%End
|
|
|
|
QList<QgsFeatureId> nearestNeighbor( const QgsPointXY &point, int neighbors ) const;
|
|
%Docstring
|
|
Returns nearest neighbors (their count is specified by second parameter)
|
|
:rtype: list of QgsFeatureId
|
|
%End
|
|
|
|
|
|
int refs() const;
|
|
%Docstring
|
|
get reference count - just for debugging!
|
|
:rtype: QAtomicInt
|
|
%End
|
|
|
|
};
|
|
|
|
|
|
/************************************************************************
|
|
* This file has been generated automatically from *
|
|
* *
|
|
* src/core/qgsspatialindex.h *
|
|
* *
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
************************************************************************/
|