GEOS  3.14.0dev
SegmentStringUtil.h
1 /**********************************************************************
2  *
3  * GEOS - Geometry Engine Open Source
4  * http://geos.osgeo.org
5  *
6  * Copyright (C) 2006 Refractions Research Inc.
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  *
16  * Last port: noding/SegmentStringUtil.java rev. 1.2 (JTS-1.9)
17  *
18  **********************************************************************/
19 
20 #pragma once
21 
22 #include <geos/noding/BasicSegmentString.h>
23 #include <geos/noding/NodedSegmentString.h>
24 #include <geos/geom/LineString.h>
25 #include <geos/geom/CoordinateSequence.h>
26 #include <geos/geom/util/LinearComponentExtracter.h>
27 
28 namespace geos {
29 namespace noding { // geos::noding
30 
38 public:
50  static void
52  SegmentString::ConstVect& segStr)
53  {
56 
57  for(const geom::LineString* line : lines) {
58  auto pts = line->getCoordinatesRO();
59  segStr.push_back(new BasicSegmentString(const_cast<geom::CoordinateSequence*>(pts), g));
60  }
61  }
62 
63 };
64 
65 } // geos::noding
66 } // geos
67 
The internal representation of a list of coordinates inside a Geometry.
Definition: CoordinateSequence.h:56
Basic implementation of Geometry, constructed and destructed by GeometryFactory.
Definition: Geometry.h:197
Definition: LineString.h:66
std::vector< const LineString * > ConstVect
A vector of const LineString pointers.
Definition: LineString.h:73
static void getLines(const Geometry &geom, std::vector< const LineString * > &ret)
Represents a list of contiguous line segments, and supports noding the segments.
Definition: BasicSegmentString.h:44
Utility methods for processing SegmentStrings.
Definition: SegmentStringUtil.h:37
static void extractSegmentStrings(const geom::Geometry *g, SegmentString::ConstVect &segStr)
Extracts all linear components from a given Geometry to SegmentStrings.
Definition: SegmentStringUtil.h:51
Basic namespace for all GEOS functionalities.
Definition: Angle.h:25