GEOS  3.14.0dev
SpatialIndex.h
1 /**********************************************************************
2  *
3  * GEOS - Geometry Engine Open Source
4  * http://geos.osgeo.org
5  *
6  * Copyright (C) 2006 Refractions Research Inc.
7  *
8  * This is free software; you can redistribute and/or modify it under
9  * the terms of the GNU Lesser General Public Licence as published
10  * by the Free Software Foundation.
11  * See the COPYING file for more information.
12  *
13  **********************************************************************/
14 
15 #pragma once
16 
17 #include <geos/export.h>
18 
19 #include <vector>
20 
21 // Forward declarations
22 namespace geos {
23 namespace geom {
24 class Envelope;
25 }
26 namespace index {
27 class ItemVisitor;
28 }
29 }
30 
31 namespace geos {
32 namespace index {
33 
46 class GEOS_DLL SpatialIndex {
47 public:
48 
49  virtual
50  ~SpatialIndex() {}
51 
64  virtual void insert(const geom::Envelope* itemEnv, void* item) = 0;
65 
74  //virtual std::vector<void*>* query(const geom::Envelope *searchEnv)=0;
75  virtual void query(const geom::Envelope* searchEnv, std::vector<void*>&) = 0;
76 
87  virtual void query(const geom::Envelope* searchEnv, ItemVisitor& visitor) = 0;
88 
96  virtual bool remove(const geom::Envelope* itemEnv, void* item) = 0;
97 
98 };
99 
100 
101 } // namespace geos.index
102 } // namespace geos
103 
An Envelope defines a rectangulare region of the 2D coordinate plane.
Definition: Envelope.h:59
A visitor for items in an index.
Definition: ItemVisitor.h:28
Abstract class defines basic insertion and query operations supported by classes implementing spatial...
Definition: SpatialIndex.h:46
virtual bool remove(const geom::Envelope *itemEnv, void *item)=0
Removes a single item from the tree.
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.
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 Item...
virtual void query(const geom::Envelope *searchEnv, std::vector< void * > &)=0
Queries the index for all items whose extents intersect the given search Envelope.
Basic namespace for all GEOS functionalities.
Definition: Angle.h:25