16 #ifndef QGSSPATIALINDEX_H 17 #define QGSSPATIALINDEX_H 25 class IStorageManager;
30 namespace StorageManager
41 #include "qgis_core.h" 44 #include <QSharedDataPointer> 48 class QgsSpatialIndexData;
77 FlagStoreFeatureGeometries = 1 << 0,
79 Q_DECLARE_FLAGS( Flags,
Flag )
135 bool addFeature(
QgsFeature &feature, QgsFeatureSink::Flags flags =
nullptr )
override;
144 bool addFeatures(
QgsFeatureList &features, QgsFeatureSink::Flags flags =
nullptr )
override;
163 bool deleteFeature(
const QgsFeature &feature );
175 QList<QgsFeatureId> intersects(
const QgsRectangle &rectangle )
const;
193 QList<QgsFeatureId> nearestNeighbor(
const QgsPointXY &point,
int neighbors = 1,
double maxDistance = 0 )
const;
218 std::unique_ptr< QgsGeometry > g = qgis::make_unique< QgsGeometry >( sipCpp->geometry( a0 ) );
221 PyErr_SetString( PyExc_KeyError, QStringLiteral(
"No geometry with feature id %1 exists in the index." ).arg( a0 ).toUtf8().constData() );
226 sipRes = sipConvertFromType( g.release(), sipType_QgsGeometry, Py_None );
238 static SpatialIndex::Region rectToRegion(
const QgsRectangle &rect );
261 friend class QgsFeatureIteratorDataStream;
265 QSharedDataPointer<QgsSpatialIndexData> d;
269 Q_DECLARE_OPERATORS_FOR_FLAGS( QgsSpatialIndex::Flags )
271 #endif //QGSSPATIALINDEX_H Wrapper for iterator of features from vector data provider or vector layer.
A rectangle specified with double values.
QList< QgsFeature > QgsFeatureList
A class to represent a 2D point.
An interface for objects which accept features via addFeature(s) methods.
A geometry is the spatial representation of a feature.
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
#define SIP_TYPEHINT(type)
Base class for feedback objects to be used for cancelation of something running in a worker thread...
A spatial index for QgsFeature objects.
An interface for objects which provide features via a getFeatures method.
Flag
Flags controlling how features are added to a sink.
#define SIP_PYALTERNATIVETYPE(type)