GEOS 3.14.0dev
Public Member Functions | Static Public Member Functions | List of all members
geos::index::bintree::Bintree Class Reference

A BinTree (or "Binary Interval Tree") is a 1-dimensional version of a quadtree. More...

#include <Bintree.h>

Public Member Functions

int depth ()
 
int size ()
 
int nodeSize ()
 
void insert (Interval *itemInterval, void *item)
 
std::vector< void * > * iterator ()
 
std::vector< void * > * query (double x)
 
std::vector< void * > * query (Interval *interval)
 
void query (Interval *interval, std::vector< void * > *foundItems)
 

Static Public Member Functions

static IntervalensureExtent (const Interval *itemInterval, double minExtent)
 Ensure that the Interval for the inserted item has non-zero extents.
 

Detailed Description

A BinTree (or "Binary Interval Tree") is a 1-dimensional version of a quadtree.

It indexes 1-dimensional intervals (which of course may be the projection of 2-D objects on an axis). It supports range searching (where the range may be a single point).

This implementation does not require specifying the extent of the inserted items beforehand. It will automatically expand to accommodate any extent of dataset.

This index is different to the "Interval Tree of Edelsbrunner" or the "Segment Tree of Bentley".

Member Function Documentation

◆ ensureExtent()

static Interval * geos::index::bintree::Bintree::ensureExtent ( const Interval itemInterval,
double  minExtent 
)
static

Ensure that the Interval for the inserted item has non-zero extents.

Use the current minExtent to pad it, if necessary.

Note
In GEOS this function always return a newly allocated object with ownership transferred to caller. TODO: change this ?
Parameters
itemIntervalsource interval, ownership left to caller, no references hold
minExtentminimal extent

◆ insert()

void geos::index::bintree::Bintree::insert ( Interval itemInterval,
void *  item 
)
Parameters
itemIntervalOwnership left to caller, NO reference hold by this class.
itemOwnership left to caller, reference kept by this class.

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