SegmentStringUtil.h
/**********************************************************************
*
* GEOS - Geometry Engine Open Source
* http://geos.osgeo.org
*
* Copyright (C) 2006 Refractions Research Inc.
*
* 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/SegmentStringUtil.java rev. 1.2 (JTS-1.9)
*
**********************************************************************/
#pragma once
#include <geos/noding/BasicSegmentString.h>
#include <geos/noding/NodedSegmentString.h>
#include <geos/geom/LineString.h>
#include <geos/geom/CoordinateSequence.h>
#include <geos/geom/util/LinearComponentExtracter.h>
namespace geos {
namespace noding { // geos::noding
class SegmentStringUtil {
public:
static void
extractSegmentStrings(const geom::Geometry* g,
SegmentString::ConstVect& segStr)
{
geom::LineString::ConstVect lines;
geom::util::LinearComponentExtracter::getLines(*g, lines);
for(const geom::LineString* line : lines) {
auto pts = line->getCoordinatesRO();
segStr.push_back(new BasicSegmentString(const_cast<geom::CoordinateSequence*>(pts), g));
}
}
};
} // geos::noding
} // geos
geos::geom::CoordinateSequence
The internal representation of a list of coordinates inside a Geometry.
Definition CoordinateSequence.h:56
geos::geom::Geometry
Basic implementation of Geometry, constructed and destructed by GeometryFactory.
Definition Geometry.h:196
geos::geom::LineString
Definition LineString.h:66
geos::geom::LineString::ConstVect
std::vector< const LineString * > ConstVect
A vector of const LineString pointers.
Definition LineString.h:73
geos::geom::util::LinearComponentExtracter::getLines
static void getLines(const Geometry &geom, std::vector< const LineString * > &ret)
geos::noding::BasicSegmentString
Represents a list of contiguous line segments, and supports noding the segments.
Definition BasicSegmentString.h:44
geos::noding::SegmentStringUtil
Utility methods for processing SegmentStrings.
Definition SegmentStringUtil.h:37
geos::noding::SegmentStringUtil::extractSegmentStrings
static void extractSegmentStrings(const geom::Geometry *g, SegmentString::ConstVect &segStr)
Extracts all linear components from a given Geometry to SegmentStrings.
Definition SegmentStringUtil.h:51
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