RSpatialIndexNavel
Class in Spatialindex Module
Header: #include <src/spatialindex/RSpatialIndexNavel.h>
Inherits: RSpatialIndex
Nested classes: RSiPoint, RSiRegion, Visitor
Description
Section titled “Description”Spatial index class.
Each instance of this class offers a spatial index. This class wraps the API of the “spatial index” library.
Scriptable: This class is available in script environments.
Public Functions
Section titled “Public Functions”RSpatialIndexNavel()Creates a 2d spatial index in memory (r-tree, star shape). |
|
~RSpatialIndexNavel() |
|
| virtual void | addToIndex(int id, int pos, const RBox &bb)Adds a new entry into this spatial index. |
| virtual void | addToIndex(int id, int pos, double x1, double y1, double z1, double x2, double y2, double z2)Adds an item to the index. |
| virtual void | bulkLoad(const QList< int > &ids, const QList< QList< RBox > > &bbs) |
| virtual void | clear() |
| virtual RSpatialIndex * | create() |
| virtual QMap< int, QSet< int > > | queryContained(double x1, double y1, double z1, double x2, double y2, double z2, RSpatialIndexVisitor *dataVisitor=NULL)Queries the index for all items that are completely inside the given box x1,y1,z1,x2,y2,z2. |
| virtual QMap< int, QSet< int > > | queryIntersected(double x1, double y1, double z1, double x2, double y2, double z2, RSpatialIndexVisitor *dataVisitor=NULL)Removes the item with the given ID from this spatial index. |
| QList< int > | queryIntersectedSimple(const RBox &b) |
| virtual QPair< int, int > | queryNearestNeighbor(double x, double y, double z)Convenience implementation for scripts. |
| virtual QMap< int, QSet< int > > | queryNearestNeighbor(unsigned int k, double x, double y, double z, RSpatialIndexVisitor *dataVisitor=NULL)Queries the index for closest neighbor items. |
| virtual bool | removeFromIndex(int id, const QList< RBox > &bb)Removes the entry with the given ID from this spatial index. |
| virtual bool | removeFromIndex(int id, int pos, const RBox &bb)Removes the entry with the given ID from this spatial index. |
| virtual bool | removeFromIndex(int id, int pos, double x1, double y1, double z1, double x2, double y2, double z2)Removes the entry with the given ID from this spatial index. |
Protected Functions
Section titled “Protected Functions”| void | addToIndex(int id, int pos, const RSiRegion ®ion, size_t dataLength=0, const uint8_t *data=NULL)Internal. |
| void | init() |
| QMap< int, QSet< int > > | queryContained(const RSiRegion ®ion, RSpatialIndexVisitor *dataVisitor=NULL)Internal. |
| QMap< int, QSet< int > > | queryIntersected(const RSiRegion ®ion, RSpatialIndexVisitor *dataVisitor=NULL)Internal. |
| QMap< int, QSet< int > > | queryNearestNeighbor(unsigned int k, const RSiPoint &point, RSpatialIndexVisitor *dataVisitor=NULL)Internal. |
| void | uninit() |
Protected Attributes
Section titled “Protected Attributes”| SpatialIndex::IStorageManager * | buff |
| SpatialIndex::ISpatialIndex * | tree |
Member Documentation
Section titled “Member Documentation”RSpatialIndexNavel
Section titled “RSpatialIndexNavel”RSpatialIndexNavel::RSpatialIndexNavel()Creates a 2d spatial index in memory (r-tree, star shape).
~RSpatialIndexNavel
Section titled “~RSpatialIndexNavel”RSpatialIndexNavel::~RSpatialIndexNavel()addToIndex
Section titled “addToIndex”virtual void RSpatialIndexNavel::addToIndex(int id, int pos, const RBox &bb)virtual
Adds a new entry into this spatial index.
Reimplemented from addToIndex.
addToIndex
Section titled “addToIndex”virtual void RSpatialIndexNavel::addToIndex(int id, int pos, double x1, double y1, double z1, double x2, double y2, double z2)virtual
Adds an item to the index.
Parameters:
id: ID of the item.x1: lower value of the first dimension.y1: lower value of the second dimension.z1: lower value of the third dimension.x2: higher value of the first dimension.y2: higher value of the second dimension.z2: higher value of the third dimension.dataLength: Length of the data in bytes or 0.data: Pointer to the data associated with the item. The index makes a deep copy of the data, the caller is responsible for deleting the data. NULL indicates that the item data is stored externally (e.g. in a map or list).
Reimplemented from addToIndex.
bulkLoad
Section titled “bulkLoad”virtual void RSpatialIndexNavel::bulkLoad(const QList< int > &ids, const QList< QList< RBox > > &bbs)virtual
Reimplemented from bulkLoad.
virtual void RSpatialIndexNavel::clear()virtual
Reimplemented from clear.
create
Section titled “create”virtual RSpatialIndex * RSpatialIndexNavel::create()virtual
Reimplemented from create.
queryContained
Section titled “queryContained”virtual QMap< int, QSet< int > > RSpatialIndexNavel::queryContained(double x1, double y1, double z1, double x2, double y2, double z2, RSpatialIndexVisitor *dataVisitor=NULL)virtual
Queries the index for all items that are completely inside the given box x1,y1,z1,x2,y2,z2.
Parameters:
x1: lower region boundary of the first dimension.y1: lower region boundary of the second dimension.z1: lower region boundary of the third dimension.x2: higher region boundary of the first dimension.y2: higher region boundary of the second dimension.z2: higher region boundary of the third dimension.dataVisitor: The item data is handed back to the caller over this object (visitor pattern).
Reimplemented from queryContained.
queryIntersected
Section titled “queryIntersected”virtual QMap< int, QSet< int > > RSpatialIndexNavel::queryIntersected(double x1, double y1, double z1, double x2, double y2, double z2, RSpatialIndexVisitor *dataVisitor=NULL)virtual
Removes the item with the given ID from this spatial index.
Reimplemented from queryIntersected.
queryIntersectedSimple
Section titled “queryIntersectedSimple”QList< int > RSpatialIndexNavel::queryIntersectedSimple(const RBox &b)inline
queryNearestNeighbor
Section titled “queryNearestNeighbor”virtual QPair< int, int > RSpatialIndexNavel::queryNearestNeighbor(double x, double y, double z)virtual
Convenience implementation for scripts.
Reimplemented from queryNearestNeighbor.
queryNearestNeighbor
Section titled “queryNearestNeighbor”virtual QMap< int, QSet< int > > RSpatialIndexNavel::queryNearestNeighbor(unsigned int k, double x, double y, double z, RSpatialIndexVisitor *dataVisitor=NULL)virtual
Queries the index for closest neighbor items.
Parameters:
x1: position of the first dimension.y1: position of the second dimension.z1: position of the third dimension.dataVisitor: The item data is handed back to the caller over this object (visitor pattern).
Reimplemented from queryNearestNeighbor.
removeFromIndex
Section titled “removeFromIndex”virtual bool RSpatialIndexNavel::removeFromIndex(int id, const QList< RBox > &bb)virtual
Removes the entry with the given ID from this spatial index.
the bounding boxes are provided for faster lookup.
Reimplemented from removeFromIndex.
removeFromIndex
Section titled “removeFromIndex”virtual bool RSpatialIndexNavel::removeFromIndex(int id, int pos, const RBox &bb)virtual
Removes the entry with the given ID from this spatial index.
the bounding box is provided for faster lookup.
Reimplemented from removeFromIndex.
removeFromIndex
Section titled “removeFromIndex”virtual bool RSpatialIndexNavel::removeFromIndex(int id, int pos, double x1, double y1, double z1, double x2, double y2, double z2)virtual
Removes the entry with the given ID from this spatial index.
Removes the entry with the given ID from this spatial index. the bounding box is provided for fast lookup.
Reimplemented from removeFromIndex.
addToIndex
Section titled “addToIndex”void RSpatialIndexNavel::addToIndex(int id, int pos, const RSiRegion ®ion, size_t dataLength=0, const uint8_t *data=NULL)protected
Internal.
Non-Scriptable: This function is not available in script environments.
void RSpatialIndexNavel::init()protected
queryContained
Section titled “queryContained”QMap< int, QSet< int > > RSpatialIndexNavel::queryContained(const RSiRegion ®ion, RSpatialIndexVisitor *dataVisitor=NULL)protected
Internal.
Non-Scriptable: This function is not available in script environments.
queryIntersected
Section titled “queryIntersected”QMap< int, QSet< int > > RSpatialIndexNavel::queryIntersected(const RSiRegion ®ion, RSpatialIndexVisitor *dataVisitor=NULL)protected
Internal.
Non-Scriptable: This function is not available in script environments.
queryNearestNeighbor
Section titled “queryNearestNeighbor”QMap< int, QSet< int > > RSpatialIndexNavel::queryNearestNeighbor(unsigned int k, const RSiPoint &point, RSpatialIndexVisitor *dataVisitor=NULL)protected
Internal.
Non-Scriptable: This function is not available in script environments.
uninit
Section titled “uninit”void RSpatialIndexNavel::uninit()protected
SpatialIndex::IStorageManager* RSpatialIndexNavel::buffprotected
SpatialIndex::ISpatialIndex* RSpatialIndexNavel::treeprotected