GEOS 3.14.0dev
IndexedNestedHoleTester.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 * Copyright (C) 2021 Martin Davis
8 *
9 * This is free software; you can redistribute and/or modify it under
10 * the terms of the GNU Lesser General Public Licence as published
11 * by the Free Software Foundation.
12 * See the COPYING file for more information.
13 *
14 **********************************************************************/
15
16#pragma once
17
18#include <geos/export.h>
19#include <geos/index/strtree/TemplateSTRtree.h>
20
21#include <memory>
22
23// Forward declarations
24namespace geos {
25namespace geom {
26class Coordinate;
27class Polygon;
28class LinearRing;
29}
30}
31
32
33namespace geos { // geos.
34namespace operation { // geos.operation
35namespace valid { // geos.operation.valid
36
37class GEOS_DLL IndexedNestedHoleTester {
38 using Polygon = geos::geom::Polygon;
39 using LinearRing = geos::geom::LinearRing;
40 using CoordinateXY = geos::geom::CoordinateXY;
41
42private:
43
44 const Polygon* polygon;
45 index::strtree::TemplateSTRtree<const LinearRing*> index;
46 CoordinateXY nestedPt;
47
48 void loadIndex();
49
50
51public:
52
53 IndexedNestedHoleTester(const Polygon* p_polygon)
54 : polygon(p_polygon)
55 {
56 loadIndex();
57 }
58
64 const CoordinateXY& getNestedPoint() { return nestedPt; }
65
72 bool isNested();
73
74};
75
76
77
78} // namespace geos.operation.valid
79} // namespace geos.operation
80} // namespace geos
81
Models an OGC SFS LinearRing. A LinearRing is a LineString which is both closed and simple.
Definition LinearRing.h:54
Represents a linear polygon, which may include holes.
Definition Polygon.h:61
Basic namespace for all GEOS functionalities.
Definition geos.h:39