QGIS API Documentation 3.99.0-Master (2fe06baccd8)
Loading...
Searching...
No Matches
QgsGenericSpatialIndex< T > Class Template Reference

A generic rtree spatial index based on a libspatialindex backend. More...

#include <qgsgenericspatialindex.h>

Public Member Functions

 QgsGenericSpatialIndex ()
 Constructor for QgsGenericSpatialIndex.
bool insert (T *data, const QgsRectangle &bounds)
 Inserts new data into the spatial index, with the specified bounds.
bool intersects (const QgsRectangle &bounds, const std::function< bool(T *data)> &callback) const
 Performs an intersection check against the index, for data intersecting the specified bounds.
bool isEmpty () const
 Returns true if the index contains no items.
bool remove (T *data, const QgsRectangle &bounds)
 Removes existing data from the spatial index, with the specified bounds.

Detailed Description

template<typename T>
class QgsGenericSpatialIndex< T >

A generic rtree spatial index based on a libspatialindex backend.

Note
Not available in Python bindings.
Since
QGIS 3.12

Definition at line 45 of file qgsgenericspatialindex.h.

Constructor & Destructor Documentation

◆ QgsGenericSpatialIndex()

template<typename T>
QgsGenericSpatialIndex< T >::QgsGenericSpatialIndex ( )
inline

Constructor for QgsGenericSpatialIndex.

Definition at line 52 of file qgsgenericspatialindex.h.

Member Function Documentation

◆ insert()

template<typename T>
bool QgsGenericSpatialIndex< T >::insert ( T * data,
const QgsRectangle & bounds )
inline

Inserts new data into the spatial index, with the specified bounds.

Ownership of data is not transferred, and it is the caller's responsibility to ensure that it exists for the lifetime of the spatial index.

Definition at line 64 of file qgsgenericspatialindex.h.

◆ intersects()

template<typename T>
bool QgsGenericSpatialIndex< T >::intersects ( const QgsRectangle & bounds,
const std::function< bool(T *data)> & callback ) const
inline

Performs an intersection check against the index, for data intersecting the specified bounds.

The callback function will be called once for each matching data object encountered.

Definition at line 124 of file qgsgenericspatialindex.h.

◆ isEmpty()

template<typename T>
bool QgsGenericSpatialIndex< T >::isEmpty ( ) const
inline

Returns true if the index contains no items.

Definition at line 155 of file qgsgenericspatialindex.h.

◆ remove()

template<typename T>
bool QgsGenericSpatialIndex< T >::remove ( T * data,
const QgsRectangle & bounds )
inline

Removes existing data from the spatial index, with the specified bounds.

data is not deleted, and it is the caller's responsibility to ensure that it is appropriately cleaned up.

Definition at line 102 of file qgsgenericspatialindex.h.


The documentation for this class was generated from the following file: