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 )
84 QgsSpatialIndex( QgsSpatialIndex::Flags flags = QgsSpatialIndex::Flags() );
152 bool addFeature(
QgsFeature &feature, QgsFeatureSink::Flags flags = QgsFeatureSink::Flags() )
override;
180 bool deleteFeature(
const QgsFeature &feature );
192 QList<QgsFeatureId> intersects(
const QgsRectangle &rectangle )
const;
210 QList<QgsFeatureId> nearestNeighbor(
const QgsPointXY &point,
int neighbors = 1,
double maxDistance = 0 )
const;
230 QList<QgsFeatureId> nearestNeighbor(
const QgsGeometry &geometry,
int neighbors = 1,
double maxDistance = 0 )
const;
255 std::unique_ptr< QgsGeometry > g = qgis::make_unique< QgsGeometry >( sipCpp->geometry( a0 ) );
258 PyErr_SetString( PyExc_KeyError, QStringLiteral(
"No geometry with feature id %1 exists in the index." ).arg( a0 ).toUtf8().constData() );
263 sipRes = sipConvertFromType( g.release(), sipType_QgsGeometry, Py_None );
296 friend class QgsFeatureIteratorDataStream;
300 QSharedDataPointer<QgsSpatialIndexData> d;
304 Q_DECLARE_OPERATORS_FOR_FLAGS( QgsSpatialIndex::Flags )
306 #endif //QGSSPATIALINDEX_H