00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef GEOS_NODING_SEGMENTSTRINGUTIL_H
00021 #define GEOS_NODING_SEGMENTSTRINGUTIL_H
00022
00023 #include <geos/noding/NodedSegmentString.h>
00024 #include <geos/geom/LineString.h>
00025 #include <geos/geom/CoordinateSequence.h>
00026 #include <geos/geom/util/LinearComponentExtracter.h>
00027
00028 namespace geos {
00029 namespace noding {
00030
00037 class SegmentStringUtil
00038 {
00039 public:
00051 static void extractSegmentStrings(const geom::Geometry * g,
00052 SegmentString::ConstVect& segStr)
00053 {
00054 geom::LineString::ConstVect lines;
00055 geom::util::LinearComponentExtracter::getLines(*g, lines);
00056
00057 for (std::size_t i=0, n=lines.size(); i<n; i++)
00058 {
00059 geom::LineString* line = (geom::LineString*)(lines[i]);
00060
00061
00062
00063
00064 geom::CoordinateSequence* pts = line->getCoordinates();
00065
00066 segStr.push_back(new NodedSegmentString(pts, g));
00067 }
00068 }
00069
00070 };
00071
00072 }
00073 }
00074
00075 #endif // GEOS_NODING_SEGMENTSTRINGUTIL_H