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