GEOS 3.11.1
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
22namespace geos {
23namespace geom {
24class Envelope;
25}
26namespace index {
27class ItemVisitor;
28}
29}
30
31namespace geos {
32namespace index {
33
46class GEOS_DLL SpatialIndex {
47public:
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:58
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: geos.h:39