GEOS 3.13.1
LinearBoundary.h
1/**********************************************************************
2 *
3 * GEOS - Geometry Engine Open Source
4 * http://geos.osgeo.org
5 *
6 * Copyright (c) 2024 Martin Davis
7 * Copyright (C) 2024 Paul Ramsey <pramsey@cleverelephant.ca>
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/geom/Coordinate.h>
19#include <geos/export.h>
20
21#include <memory>
22#include <vector>
23
24// Forward declarations
25namespace geos {
26namespace algorithm {
27 class BoundaryNodeRule;
28}
29namespace geom {
30 class CoordinateXY;
31 class LineString;
32}
33}
34
35
38using geos::geom::CoordinateXY;
40
41
42namespace geos { // geos.
43namespace operation { // geos.operation
44namespace relateng { // geos.operation.relateng
45
46class GEOS_DLL LinearBoundary {
47
48private:
49
50 // Members
51
52 Coordinate::ConstIntMap m_vertexDegree;
53 bool m_hasBoundary;
54 const BoundaryNodeRule& m_boundaryNodeRule;
55
56
57public:
58
59 // Constructors
60
61 LinearBoundary(std::vector<const LineString*>& lines, const BoundaryNodeRule& bnRule);
62
63 bool hasBoundary() const;
64
65 bool isBoundary(const CoordinateXY* pt) const;
66
67
68private:
69
70 // Methods
71
72 bool checkBoundary(Coordinate::ConstIntMap& vertexDegree) const;
73
74 static void computeBoundaryPoints(
75 std::vector<const LineString*>& lines,
76 Coordinate::ConstIntMap& vertexDegree);
77
78 static void addEndpoint(
79 const CoordinateXY *p,
80 Coordinate::ConstIntMap& vertexDegree);
81
82
83};
84
85} // namespace geos.operation.relateng
86} // namespace geos.operation
87} // namespace geos
88
An interface for rules which determine whether node points which are in boundaries of lineal geometry...
Definition BoundaryNodeRule.h:52
Coordinate is the lightweight class used to store coordinates.
Definition Coordinate.h:217
Definition LineString.h:66
Basic namespace for all GEOS functionalities.
Definition geos.h:39