GEOS  3.14.0dev
BoundaryOp.h
1 /**********************************************************************
2  *
3  * GEOS - Geometry Engine Open Source
4  * http://geos.osgeo.org
5  *
6  * Copyright (C) 2022 ISciences LLC
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  * Last port: operation/BoundaryOp.java fd5aebb
16  *
17  **********************************************************************/
18 
19 #pragma once
20 
21 #include <geos/algorithm/BoundaryNodeRule.h>
22 #include <geos/geom/Geometry.h>
23 #include <map>
24 
25 namespace geos {
26 namespace geom {
27 class LineString;
28 class MultiLineString;
29 }
30 }
31 
32 namespace geos {
33 namespace operation {
34 
46 class GEOS_DLL BoundaryOp {
47 
48 public:
54  BoundaryOp(const geom::Geometry& geom);
55 
63 
70  static std::unique_ptr<geom::Geometry> getBoundary(const geom::Geometry& g);
71 
80  static std::unique_ptr<geom::Geometry> getBoundary(const geom::Geometry& g, const algorithm::BoundaryNodeRule& bnRule);
81 
97  static bool hasBoundary(const geom::Geometry& geom, const algorithm::BoundaryNodeRule& boundaryNodeRule);
98 
104  std::unique_ptr<geom::Geometry> getBoundary();
105 
106 private:
107  const geom::Geometry& m_geom;
108  const geom::GeometryFactory& m_geomFact;
109  const algorithm::BoundaryNodeRule& m_bnRule;
110 
111  std::unique_ptr<geom::Geometry> boundaryMultiLineString(const geom::MultiLineString& mLine);
112 
113  std::unique_ptr<geom::CoordinateSequence> computeBoundaryCoordinates(const geom::MultiLineString& mLine);
114 
115  std::unique_ptr<geom::Geometry> boundaryLineString(const geom::LineString& line);
116 };
117 
118 }
119 }
120 
An interface for rules which determine whether node points which are in boundaries of lineal geometry...
Definition: BoundaryNodeRule.h:52
Supplies a set of utility methods for building Geometry objects from CoordinateSequence or other Geom...
Definition: GeometryFactory.h:70
Basic implementation of Geometry, constructed and destructed by GeometryFactory.
Definition: Geometry.h:197
Definition: LineString.h:66
Models a collection of LineStrings.
Definition: MultiLineString.h:49
Definition: BoundaryOp.h:46
static bool hasBoundary(const geom::Geometry &geom, const algorithm::BoundaryNodeRule &boundaryNodeRule)
BoundaryOp(const geom::Geometry &geom, const algorithm::BoundaryNodeRule &bnRule)
static std::unique_ptr< geom::Geometry > getBoundary(const geom::Geometry &g, const algorithm::BoundaryNodeRule &bnRule)
std::unique_ptr< geom::Geometry > getBoundary()
BoundaryOp(const geom::Geometry &geom)
static std::unique_ptr< geom::Geometry > getBoundary(const geom::Geometry &g)
Basic namespace for all GEOS functionalities.
Definition: Angle.h:25