return name and reference separately

This commit is contained in:
karenzshea
2016-09-05 09:01:51 -04:00
committed by Moritz Kobitzsch
parent 938dff011f
commit dcc1b5ab2b
29 changed files with 131 additions and 74 deletions
+2
View File
@@ -33,6 +33,7 @@ struct ExtractionWay
is_startpoint = true;
is_access_restricted = false;
name.clear();
ref.clear();
pronunciation.clear();
destinations.clear();
forward_travel_mode = TRAVEL_MODE_INACCESSIBLE;
@@ -53,6 +54,7 @@ struct ExtractionWay
double backward_speed;
double duration;
std::string name;
std::string ref;
std::string pronunciation;
std::string destinations;
std::string turn_lanes_forward;
+18 -3
View File
@@ -16,6 +16,21 @@ class Node;
class Way;
}
namespace std
{
template <> struct hash<std::tuple<std::string, std::string, std::string>>
{
std::size_t operator()(const std::tuple<std::string, std::string, std::string> &mk) const noexcept
{
std::size_t seed = 0;
boost::hash_combine(seed, std::get<0>(mk));
boost::hash_combine(seed, std::get<1>(mk));
boost::hash_combine(seed, std::get<2>(mk));
return seed;
}
};
}
namespace osrm
{
namespace extractor
@@ -27,7 +42,7 @@ struct ExtractionNode;
struct ExtractionWay;
/**
* This class is uses by the extractor with the results of the
* This class is used by the extractor with the results of the
* osmium based parsing and the customization through the lua profile.
*
* It mediates between the multi-threaded extraction process and the external memory containers.
@@ -37,9 +52,9 @@ class ExtractorCallbacks
{
private:
// used to deduplicate street names and street destinations: actually maps to name ids
using MapKey = std::pair<std::string, std::string>;
using MapKey = std::tuple<std::string, std::string, std::string>;
using MapVal = unsigned;
std::unordered_map<MapKey, MapVal, boost::hash<MapKey>> string_map;
std::unordered_map<MapKey, MapVal> string_map;
guidance::LaneDescriptionMap lane_description_map;
ExtractionContainers &external_memory;