GEOS 3.14.0dev
CoverageBoundarySegmentFinder.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 <unordered_set>
18
19#include <geos/geom/CoordinateSequenceFilter.h>
20#include <geos/geom/Coordinate.h>
21#include <geos/geom/LineSegment.h>
22#include <geos/export.h>
23
24namespace geos {
25namespace geom {
26class CoordinateSequence;
27class Geometry;
28}
29}
30
31namespace geos {
32namespace coverage { // geos::coverage
33
34class CoverageBoundarySegmentFinder : public geos::geom::CoordinateSequenceFilter
35{
36 using Coordinate = geos::geom::Coordinate;
37 using CoordinateSequence = geos::geom::CoordinateSequence;
38 using CoordinateSequenceFilter = geos::geom::CoordinateSequenceFilter;
39 using Geometry = geos::geom::Geometry;
40 using LineSegment = geos::geom::LineSegment;
41
42public:
43
44 CoverageBoundarySegmentFinder(LineSegment::UnorderedSet& segs)
45 : m_boundarySegs(segs)
46 {};
47
48 bool isGeometryChanged() const override {
49 return false;
50 }
51
52 bool isDone() const override {
53 return false;
54 }
55
56 void filter_ro(const CoordinateSequence& seq, std::size_t i) override;
57
58
59 static LineSegment::UnorderedSet
60 findBoundarySegments(const std::vector<const Geometry*>& geoms);
61
62 static bool isBoundarySegment(
63 const LineSegment::UnorderedSet& boundarySegs,
64 const CoordinateSequence* seq,
65 std::size_t i);
66
67private:
68
69 static LineSegment
70 createSegment(const CoordinateSequence& seq, std::size_t i);
71
72
73 LineSegment::UnorderedSet& m_boundarySegs;
74
75
76}; // CoverageBoundarySegmentFinder
77
78
79
80} // geos::coverage
81} // geos
Interface for classes which provide operations that can be applied to the coordinates in a Coordinate...
Definition CoordinateSequenceFilter.h:56
The internal representation of a list of coordinates inside a Geometry.
Definition CoordinateSequence.h:56
Coordinate is the lightweight class used to store coordinates.
Definition Coordinate.h:217
Basic implementation of Geometry, constructed and destructed by GeometryFactory.
Definition Geometry.h:197
Definition LineSegment.h:61
Basic namespace for all GEOS functionalities.
Definition geos.h:39