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