Expanding mph maxspeed detection
This commit is contained in:
commit
f87450efd6
@ -84,6 +84,14 @@ private:
|
||||
}
|
||||
return matched;
|
||||
}
|
||||
|
||||
inline int parseMaxspeed(const std::string& input) const {
|
||||
int n = atoi(input.c_str());
|
||||
if (input.find("mph") != std::string::npos || input.find("MPH") != std::string::npos || input.find("mp/h") != std::string::npos) {
|
||||
n = (n*1609)/1000;
|
||||
}
|
||||
return n;
|
||||
}
|
||||
|
||||
public:
|
||||
ExtractorCallbacks(STXXLContainers * ext, Settings set, StringMap * strMap) {
|
||||
@ -135,10 +143,7 @@ public:
|
||||
std::string ref( w.keyVals.Find("ref"));
|
||||
std::string junction( w.keyVals.Find("junction") );
|
||||
std::string route( w.keyVals.Find("route") );
|
||||
std::string speedlimit = w.keyVals.Find("maxspeed");
|
||||
int maxspeed( atoi(speedlimit.c_str()) );
|
||||
if(speedlimit.find("mph") != std::string::npos || speedlimit.find("mp/h") != std::string::npos)
|
||||
maxspeed *= 1.609;
|
||||
int maxspeed( parseMaxspeed(w.keyVals.Find("maxspeed")) );
|
||||
std::string access( w.keyVals.Find("access") );
|
||||
std::string accessTag( w.keyVals.Find(settings.accessTag) );
|
||||
std::string man_made( w.keyVals.Find("man_made") );
|
||||
|
@ -260,3 +260,4 @@ env.Program(target = 'osrm-extract', source = ["extractor.cpp", Glob('DataStruct
|
||||
env.Program(target = 'osrm-prepare', source = ["createHierarchy.cpp", 'Contractor/EdgeBasedGraphFactory.cpp', Glob('Util/SRTMLookup/*.cpp'), Glob('Algorithms/*.cpp')])
|
||||
env.Program(target = 'osrm-routed', source = ["routed.cpp", 'Descriptors/DescriptionFactory.cpp', Glob('ThirdParty/*.cc')], CCFLAGS = env['CCFLAGS'] + ['-DROUTED'])
|
||||
env = conf.Finish()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user