/********************************************************************** * * GEOS - Geometry Engine Open Source * http://geos.osgeo.org * * Copyright (C) 2021 Paul Ramsey * * 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. * **********************************************************************/ #pragma once #include #include #include #include #include // Forward declarations namespace geos { namespace geom { class Envelope; class PrecisionModel; } namespace noding { class SegmentString; } } namespace geos { namespace noding { // geos::noding /** * A noder which extracts all line segments * as SegmentString. * This enables fast overlay of geometries which are known to be already fully noded. * In particular, it provides fast union of polygonal and linear coverages. * Unioning a noded set of lines is an effective way * to perform line merging and line dissolving. * * No precision reduction is carried out. * If that is required, another noder must be used (such as a snap-rounding noder), * or the input must be precision-reduced beforehand. * */ class GEOS_DLL SegmentExtractingNoder : public Noder { private: std::vector* segList; void extractSegments( const std::vector& inputSegs, std::vector& outputSegs); void extractSegments( const SegmentString* ss, std::vector& outputSegs); public: /** * Creates a new segment-extracting noder. */ SegmentExtractingNoder() : segList(nullptr) {}; void computeNodes(std::vector* segStrings) override; /** * @return a Collection of SegmentString representing the * substrings. Caller takes ownership over vector and contents. */ std::vector* getNodedSubstrings() const override; }; } // namespace geos::noding } // namespace geos