diff options
author | Kirill Zhdanovich <kzhdanovich@gmail.com> | 2013-09-06 12:18:20 +0400 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 02:04:14 +0300 |
commit | a25a68c5f92459c8247517ede61cfb56e554edd8 (patch) | |
tree | 3febe38eb262e060f269cec3d4cf0c1756e38d4a /map/bookmark.cpp | |
parent | cc678cf07e52f69bda67f13e85e915da999edd7a (diff) |
[core]parse gx:Tracks
Diffstat (limited to 'map/bookmark.cpp')
-rw-r--r-- | map/bookmark.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/map/bookmark.cpp b/map/bookmark.cpp index fa7530d888..9a5e44a1e8 100644 --- a/map/bookmark.cpp +++ b/map/bookmark.cpp @@ -193,16 +193,16 @@ namespace } } - void ParseLineCoordinates(string const & s) + void ParseLineCoordinates(string const & s, string const & blockSeparator, string const & coordSeparator) { double lon, lat; - strings::SimpleTokenizer cortegeIter(s, " \n\r\t"); + strings::SimpleTokenizer cortegeIter(s, blockSeparator.c_str()); LOG(LDEBUG,("Start Parsing", m_name, s)); while (cortegeIter) { string const token = *cortegeIter; - strings::SimpleTokenizer coordIter(token, ","); + strings::SimpleTokenizer coordIter(token, coordSeparator.c_str()); if (coordIter) { if (strings::to_double(*coordIter, lon) && MercatorBounds::ValidLon(lon) && ++coordIter) @@ -325,9 +325,15 @@ namespace } else if (prevTag == "LineString") { + LOG(LINFO,(prevTag, currTag)); m_geometryType = LINE; if (currTag == "coordinates") - ParseLineCoordinates(value); + ParseLineCoordinates(value, " \n\r\t", ","); + } + else if (prevTag == "gx:Track") + { + if (currTag == "gx:coord") + ParseLineCoordinates(value, "\n\r\t", " "); } else if (prevTag == "ExtendedData") { |