GEOS  3.14.0dev
Public Member Functions | List of all members
geos::index::SpatialIndex Class Referenceabstract

Abstract class defines basic insertion and query operations supported by classes implementing spatial index algorithms. More...

#include <SpatialIndex.h>

Inheritance diagram for geos::index::SpatialIndex:
geos::index::quadtree::Quadtree geos::index::strtree::STRtree geos::index::strtree::SimpleSTRtree

Public Member Functions

virtual void insert (const geom::Envelope *itemEnv, void *item)=0
 Adds a spatial item with an extent specified by the given Envelope to the index. More...
 
virtual void query (const geom::Envelope *searchEnv, std::vector< void * > &)=0
 Queries the index for all items whose extents intersect the given search Envelope. More...
 
virtual void query (const geom::Envelope *searchEnv, ItemVisitor &visitor)=0
 Queries the index for all items whose extents intersect the given search Envelope and applies an ItemVisitor to them. More...
 
virtual bool remove (const geom::Envelope *itemEnv, void *item)=0
 Removes a single item from the tree. More...
 

Detailed Description

Abstract class defines basic insertion and query operations supported by classes implementing spatial index algorithms.

A spatial index typically provides a primary filter for range rectangle queries. A secondary filter is required to test for exact intersection. Of course, this secondary filter may consist of other tests besides intersection, such as testing other kinds of spatial relationships.

Last port: index/SpatialIndex.java rev. 1.11 (JTS-1.7)

Member Function Documentation

◆ insert()

virtual void geos::index::SpatialIndex::insert ( const geom::Envelope itemEnv,
void *  item 
)
pure virtual

Adds a spatial item with an extent specified by the given Envelope to the index.

Parameters
itemEnvEnvelope of the item, ownership left to caller. TODO: Reference hold by this class ?
itemOpaque item, ownership left to caller. Reference hold by this class.

Implemented in geos::index::strtree::STRtree, geos::index::strtree::SimpleSTRtree, and geos::index::quadtree::Quadtree.

◆ query() [1/2]

virtual void geos::index::SpatialIndex::query ( const geom::Envelope searchEnv,
ItemVisitor visitor 
)
pure virtual

Queries the index for all items whose extents intersect the given search Envelope and applies an ItemVisitor to them.

Note that some kinds of indexes may also return objects which do not in fact intersect the query envelope.

Parameters
searchEnvthe envelope to query for
visitora visitor object to apply to the items found

Implemented in geos::index::strtree::STRtree, geos::index::strtree::SimpleSTRtree, and geos::index::quadtree::Quadtree.

◆ query() [2/2]

virtual void geos::index::SpatialIndex::query ( const geom::Envelope searchEnv,
std::vector< void * > &   
)
pure virtual

Queries the index for all items whose extents intersect the given search Envelope.

Note that some kinds of indexes may also return objects which do not in fact intersect the query envelope.

Parameters
searchEnvthe envelope to query for

Implemented in geos::index::quadtree::Quadtree, geos::index::strtree::STRtree, and geos::index::strtree::SimpleSTRtree.

◆ remove()

virtual bool geos::index::SpatialIndex::remove ( const geom::Envelope itemEnv,
void *  item 
)
pure virtual

Removes a single item from the tree.

Parameters
itemEnvthe Envelope of the item to remove
itemthe item to remove
Returns
true if the item was found

Implemented in geos::index::strtree::SimpleSTRtree, geos::index::strtree::STRtree, and geos::index::quadtree::Quadtree.


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