GEOS 3.9.1
SnappingNoder.h
1/**********************************************************************
2 *
3 * GEOS - Geometry Engine Open Source
4 * http://geos.osgeo.org
5 *
6 * Copyright (C) 2020 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 * Last port: noding/snap/SnappingNoder.java
16 *
17 **********************************************************************/
18
19#pragma once
20
21#include <geos/export.h>
22
23#include <geos/geom/Coordinate.h>
24#include <geos/geom/Envelope.h>
25#include <geos/noding/Noder.h>
26#include <geos/noding/snap/SnappingPointIndex.h>
27
28
29// Forward declarations
30namespace geos {
31namespace geom {
32class Envelope;
33class PrecisionModel;
34}
35namespace noding {
36class NodedSegmentString;
37}
38}
39
40namespace geos {
41namespace noding { // geos::noding
42namespace snap { // geos::noding::snap
43
66class GEOS_DLL SnappingNoder : public Noder {
67
68private:
69
70 // Members
71 double snapTolerance;
72 SnappingPointIndex snapIndex;
73 std::vector<SegmentString*>* nodedResult;
74
75 // Methods
76 void snapVertices(std::vector<SegmentString*>& segStrings, std::vector<SegmentString*>& nodedStrings);
77
78 SegmentString* snapVertices(SegmentString* ss);
79
80 std::unique_ptr<std::vector<geom::Coordinate>> snap(geom::CoordinateSequence* cs);
81
90 std::unique_ptr<std::vector<SegmentString*>> snapIntersections(std::vector<SegmentString*>& inputSS);
91
92
93public:
94
99 SnappingNoder(double p_snapTolerance)
100 : snapTolerance(p_snapTolerance)
101 , snapIndex(p_snapTolerance)
102 {}
103
107 std::vector<SegmentString*>* getNodedSubstrings() const override;
108
109 void computeNodes(std::vector<SegmentString*>* inputSegStrings) override;
110
111
112};
113
114
115} // namespace geos::noding::snap
116} // namespace geos::noding
117} // namespace geos
118
119
120
The internal representation of a list of coordinates inside a Geometry.
Definition: CoordinateSequence.h:58
Computes all intersections between segments in a set of SegmentString.
Definition: Noder.h:49
An interface for classes which represent a sequence of contiguous line segments.
Definition: SegmentString.h:46
Definition: SnappingNoder.h:66
SnappingNoder(double p_snapTolerance)
Definition: SnappingNoder.h:99
std::vector< SegmentString * > * getNodedSubstrings() const override
void computeNodes(std::vector< SegmentString * > *inputSegStrings) override
Computes the noding for a collection of SegmentStrings.
Basic namespace for all GEOS functionalities.
Definition: IndexedNestedRingTester.h:26