GEOS  3.9.1dev
SnappingNoder.h
Go to the documentation of this file.
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>
27 
28 
29 // Forward declarations
30 namespace geos {
31 namespace geom {
32 class Envelope;
33 class PrecisionModel;
34 }
35 namespace noding {
36 class NodedSegmentString;
37 }
38 }
39 
40 namespace geos {
41 namespace noding { // geos::noding
42 namespace snap { // geos::noding::snap
43 
66 class GEOS_DLL SnappingNoder : public Noder {
67 
68 private:
69 
70  // Members
71  double snapTolerance;
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 
93 public:
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 
#define GEOS_DLL
Definition: export.h:28
An interface for classes which represent a sequence of contiguous line segments.
Definition: SegmentString.h:46
std::vector< SegmentString * > * nodedResult
Definition: SnappingNoder.h:73
SnappingNoder(double p_snapTolerance)
Definition: SnappingNoder.h:99
Basic namespace for all GEOS functionalities.
Computes all intersections between segments in a set of SegmentString.
Definition: Noder.h:49
The internal representation of a list of coordinates inside a Geometry.