GEOS 3.14.0dev
SegmentMCIndex.h
1/**********************************************************************
2 *
3 * GEOS - Geometry Engine Open Source
4 * http://geos.osgeo.org
5 *
6 * Copyright (C) 2021 Paul Ramsey <pramsey@cleverelephant.ca>
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/index/chain/MonotoneChain.h>
18#include <geos/index/strtree/TemplateSTRtree.h>
19
20
21// Forward declarations
22namespace geos {
23namespace geom {
24class CoordinateSequence;
25class Envelope;
26}
27}
28
29namespace geos {
30namespace operation {
31namespace buffer {
32
33class GEOS_DLL SegmentMCIndex {
34 using CoordinateSequence = geos::geom::CoordinateSequence;
35 using Envelope = geos::geom::Envelope;
36 using MonotoneChain = geos::index::chain::MonotoneChain;
37 using MonotoneChainSelectAction = geos::index::chain::MonotoneChainSelectAction;
38 template<typename ItemType>
39 using TemplateSTRtree = geos::index::strtree::TemplateSTRtree<ItemType>;
40
41private:
42
43 TemplateSTRtree<const MonotoneChain*> index;
44 std::vector<MonotoneChain> segChains;
45
46 void buildIndex(const CoordinateSequence* segs);
47
48public:
49
50 SegmentMCIndex(const CoordinateSequence* segs);
51
52 void query(const Envelope* env, MonotoneChainSelectAction& action);
53};
54
55
56} // geos.operation.buffer
57} // geos.operation
58} // geos
The internal representation of a list of coordinates inside a Geometry.
Definition CoordinateSequence.h:56
An Envelope defines a rectangulare region of the 2D coordinate plane.
Definition Envelope.h:59
Definition MonotoneChainSelectAction.h:44
Monotone Chains are a way of partitioning the segments of a linestring to allow for fast searching of...
Definition index/chain/MonotoneChain.h:85
Basic namespace for all GEOS functionalities.
Definition geos.h:39