From 647f05471428eabf5b268eba7a40fe7003cae029 Mon Sep 17 00:00:00 2001 From: DennisOSRM Date: Tue, 15 Nov 2011 11:21:37 +0100 Subject: [PATCH] GPX export working with edge based routing --- Plugins/GPXDescriptor.h | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/Plugins/GPXDescriptor.h b/Plugins/GPXDescriptor.h index 3cc1cd2d7..bb273d6b5 100644 --- a/Plugins/GPXDescriptor.h +++ b/Plugins/GPXDescriptor.h @@ -21,43 +21,39 @@ or see http://www.gnu.org/licenses/agpl.txt. #ifndef GPX_DESCRIPTOR_H_ #define GPX_DESCRIPTOR_H_ +#include #include "BaseDescriptor.h" template class GPXDescriptor : public BaseDescriptor{ private: _DescriptorConfig config; - string tmp; _Coordinate current; + + std::string tmp; public: void SetConfig(const _DescriptorConfig& c) { config = c; } void Run(http::Reply & reply, RawRouteData &rawRoute, PhantomNodes &phantomNodes, SearchEngineT &sEngine, unsigned distance) { reply.content += (""); reply.content += ""; + "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" " + "xsi:schemaLocation=\"http://www.topografix.com/GPX/1/1 gpx.xsd" + "\">"; reply.content += ""; if(distance != UINT_MAX && rawRoute.routeSegments.size()) { - convertInternalLatLonToString(phantomNodes.startPhantom.location.lat, tmp); reply.content += ""; for(unsigned segmentIdx = 0; segmentIdx < rawRoute.routeSegments.size(); segmentIdx++) { - const std::vector< _PathData > & path = rawRoute.routeSegments[segmentIdx]; - if( ! path.size() ) - continue; - for(vector< _PathData >::const_iterator it = path.begin(); it != path.end(); it++) { - sEngine.GetCoordinatesForNodeID(it->node, current); + BOOST_FOREACH(_PathData pathData, rawRoute.routeSegments[segmentIdx]) { + sEngine.GetCoordinatesForNodeID(pathData.node, current); convertInternalLatLonToString(current.lat, tmp); reply.content += ""; - - reply.content +=""; + reply.content += "lon=\"" + tmp + "\">"; } } convertInternalLatLonToString(phantomNodes.targetPhantom.location.lat, tmp);