GEOS 3.16.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// Forward declarations
22namespace geos {
23namespace geom {
24class Coordinate;
25class Polygon;
26class LinearRing;
27}
28}
29
30
31namespace geos { // geos.
32namespace operation { // geos.operation
33namespace valid { // geos.operation.valid
34
35class GEOS_DLL IndexedNestedHoleTester {
36 using Polygon = geos::geom::Polygon;
37 using LinearRing = geos::geom::LinearRing;
38 using CoordinateXY = geos::geom::CoordinateXY;
39
40private:
41
42 const Polygon* polygon;
43 index::strtree::TemplateSTRtree<const LinearRing*> index;
44 CoordinateXY nestedPt;
45
46 void loadIndex();
47
48
49public:
50
51 IndexedNestedHoleTester(const Polygon* p_polygon)
52 : polygon(p_polygon)
53 {
54 loadIndex();
55 }
56
62 const CoordinateXY& getNestedPoint() const { return nestedPt; }
63
70 bool isNested();
71
72};
73
74
75
76} // namespace geos.operation.valid
77} // namespace geos.operation
78} // namespace geos
79
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:38