SnappingNoder.h
/**********************************************************************
*
* GEOS - Geometry Engine Open Source
* http://geos.osgeo.org
*
* Copyright (C) 2020 Paul Ramsey <pramsey@cleverelephant.ca>
*
* This is free software; you can redistribute and/or modify it under
* the terms of the GNU Lesser General Public Licence as published
* by the Free Software Foundation.
* See the COPYING file for more information.
*
**********************************************************************
*
* Last port: noding/snap/SnappingNoder.java
*
**********************************************************************/
#pragma once
#include <geos/export.h>
#include <geos/geom/Coordinate.h>
#include <geos/geom/CoordinateSequence.h>
#include <geos/geom/Envelope.h>
#include <geos/noding/Noder.h>
#include <geos/noding/snap/SnappingPointIndex.h>
// Forward declarations
namespace geos {
namespace geom {
class Envelope;
class PrecisionModel;
}
namespace noding {
class NodedSegmentString;
}
}
namespace geos {
namespace noding { // geos::noding
namespace snap { // geos::noding::snap
class GEOS_DLL SnappingNoder : public Noder {
private:
// Members
double snapTolerance;
SnappingPointIndex snapIndex;
std::vector<SegmentString*>* nodedResult;
// Methods
void seedSnapIndex(std::vector<SegmentString*>& segStrings);
void snapVertices(std::vector<SegmentString*>& segStrings, std::vector<SegmentString*>& nodedStrings);
SegmentString* snapVertices(SegmentString* ss);
std::unique_ptr<geom::CoordinateSequence> snap(const geom::CoordinateSequence* cs);
std::unique_ptr<std::vector<SegmentString*>> snapIntersections(std::vector<SegmentString*>& inputSS);
public:
SnappingNoder(double p_snapTolerance)
: snapTolerance(p_snapTolerance)
, snapIndex(p_snapTolerance)
{}
std::vector<SegmentString*>* getNodedSubstrings() const override;
void computeNodes(std::vector<SegmentString*>* inputSegStrings) override;
};
} // namespace geos::noding::snap
} // namespace geos::noding
} // namespace geos
geos::geom::CoordinateSequence
The internal representation of a list of coordinates inside a Geometry.
Definition CoordinateSequence.h:56
geos::geom::Envelope
An Envelope defines a rectangulare region of the 2D coordinate plane.
Definition Envelope.h:59
geos::geom::PrecisionModel
Specifies the precision model of the Coordinate in a Geometry.
Definition PrecisionModel.h:87
geos::noding::NodedSegmentString
Represents a list of contiguous line segments, and supports noding the segments.
Definition NodedSegmentString.h:58
geos::noding::SegmentString
An interface for classes which represent a sequence of contiguous line segments.
Definition SegmentString.h:47
geos::noding::snap::SnappingNoder::SnappingNoder
SnappingNoder(double p_snapTolerance)
Definition SnappingNoder.h:103
geos::noding::snap::SnappingNoder::getNodedSubstrings
std::vector< SegmentString * > * getNodedSubstrings() const override
geos::noding::snap::SnappingNoder::computeNodes
void computeNodes(std::vector< SegmentString * > *inputSegStrings) override
Computes the noding for a collection of SegmentStrings.
geos::geom
Definition Angle.h:26
geos::noding
Classes to compute nodings for arrangements of line segments and line segment sequences.
Definition CoverageCleaner.h:42
geos
Basic namespace for all GEOS functionalities.
Definition geos.h:38