diff --git a/examples/osggpx/osggpx.cpp b/examples/osggpx/osggpx.cpp index ab263a776..4cde32493 100644 --- a/examples/osggpx/osggpx.cpp +++ b/examples/osggpx/osggpx.cpp @@ -98,7 +98,7 @@ protected: double convertTime(const std::string& timestr) { - //osg::notify(osg::NOTICE)<<" time = "<addChild(createTrackModel(track, osg::Vec4(1.0,1.0,1.0,1.0))); + // smooth the track + if (average) + { + for(Track::TrackSegments::iterator itr = track->getTrackSegments().begin(); + itr != track->getTrackSegments().end(); + ++itr) + { + *itr = computeAveragedSpeedTrackSegment(itr->get()); + } + } + // smooth the track if (smooth) { @@ -401,6 +494,45 @@ int main(int argv, char **argc) } + if (!outputFilename.empty()) + { + std::ofstream fout(outputFilename.c_str()); + + fout<<""<get(); + + fout<<""<The track description"<getTrackSegments().begin(); + itr != track->getTrackSegments().end(); + ++itr) + { + TrackSegment* ts = itr->get(); + fout<<""<getTrackPoints().begin(); + pitr != ts->getTrackPoints().end(); + ++pitr) + { + fout<<"latitude<<"\" lon=\""<longitude<<"\">"<"<elevation<<""<"<time<<""<"<"<"<"<