From ade2ecdb8eb8ed64fa8bfaf1783b774bd032f0e8 Mon Sep 17 00:00:00 2001 From: DennisOSRM Date: Tue, 28 Feb 2012 15:31:47 +0100 Subject: [PATCH] Parsing traffic lights from input data --- DataStructures/PBFParser.h | 3 +++ DataStructures/XMLParser.h | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/DataStructures/PBFParser.h b/DataStructures/PBFParser.h index 55ea019d7..0690a64ed 100644 --- a/DataStructures/PBFParser.h +++ b/DataStructures/PBFParser.h @@ -226,6 +226,9 @@ private: if("" != keyVals.Find("barrier")) n.bollard = true; + if("traffic_signals" == keyVals.Find("highway")) + n.trafficLight = true; + if(!(*addressCallback)(n, keyVals)) std::cerr << "[PBFParser] adress not parsed" << std::endl; diff --git a/DataStructures/XMLParser.h b/DataStructures/XMLParser.h index cefd004da..3f4f42488 100644 --- a/DataStructures/XMLParser.h +++ b/DataStructures/XMLParser.h @@ -261,6 +261,11 @@ private: node.bollard = true; } } + if ( xmlStrEqual( k, ( const xmlChar* ) "highway" ) == 1 ) { + if ( xmlStrEqual( value, ( const xmlChar* ) "traffic_lights" ) == 1 ){ + node.trafficLight = true; + } + } } if ( k != NULL ) xmlFree( k );