QGIS API Documentation 3.37.0-Master (fdefdf9c27f)
Classes | Public Member Functions | List of all members
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. More...
 
bool insert (T *data, const QgsRectangle &bounds)
 Inserts new data into the spatial index, with the specified bounds. More...
 
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. More...
 
bool isEmpty () const
 Returns true if the index contains no items. More...
 
bool remove (T *data, const QgsRectangle &bounds)
 Removes existing data from the spatial index, with the specified bounds. More...
 

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 44 of file qgsgenericspatialindex.h.

Constructor & Destructor Documentation

◆ QgsGenericSpatialIndex()

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

Constructor for QgsGenericSpatialIndex.

Definition at line 51 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 63 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 123 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 136 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 101 of file qgsgenericspatialindex.h.


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