From 6a9b05e1266dbd6cca56bc7e8c2c27cd00f62dbd Mon Sep 17 00:00:00 2001 From: DennisOSRM Date: Mon, 19 Mar 2012 13:37:43 +0100 Subject: [PATCH] bollards are ignored if access=yes tag is set at the node. --- DataStructures/PBFParser.h | 3 ++- DataStructures/XMLParser.h | 10 +++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/DataStructures/PBFParser.h b/DataStructures/PBFParser.h index 966b94d51..fd3355864 100644 --- a/DataStructures/PBFParser.h +++ b/DataStructures/PBFParser.h @@ -224,7 +224,8 @@ private: denseTagIndex += 2; } std::string barrierValue = keyVals.Find("barrier"); - if(0 < barrierValue.length() && "border_control" != barrierValue && "toll_booth" != barrierValue && "no" != barrierValue) + std::string access = keyVals.Find("access"); + if(access != "yes" && 0 < barrierValue.length() && "border_control" != barrierValue && "toll_booth" != barrierValue && "no" != barrierValue) n.bollard = true; if("traffic_signals" == keyVals.Find("highway")) diff --git a/DataStructures/XMLParser.h b/DataStructures/XMLParser.h index ee84e2a3e..39455a8ba 100644 --- a/DataStructures/XMLParser.h +++ b/DataStructures/XMLParser.h @@ -246,17 +246,23 @@ private: continue; } + bool accessYes = false; if ( xmlStrEqual( childName, ( const xmlChar* ) "tag" ) == 1 ) { xmlChar* k = xmlTextReaderGetAttribute( inputReader, ( const xmlChar* ) "k" ); xmlChar* value = xmlTextReaderGetAttribute( inputReader, ( const xmlChar* ) "v" ); if ( k != NULL && value != NULL ) { + if ( xmlStrEqual( k, ( const xmlChar* ) "access" ) == 1 ) { + if ( xmlStrEqual( value, ( const xmlChar* ) "yes" ) == 1 ){ + accessYes = true; + } + } if ( xmlStrEqual( k, ( const xmlChar* ) "highway" ) == 1 ) { if ( xmlStrEqual( value, ( const xmlChar* ) "traffic_signals" ) == 1 ){ node.trafficLight = true; } } if ( xmlStrEqual( k, ( const xmlChar* ) "barrier" ) == 1 ) { - if ( xmlStrEqual( value, ( const xmlChar* ) "" ) != 1 && xmlStrEqual( value, ( const xmlChar* ) "border_control" ) != 1 && xmlStrEqual( value, ( const xmlChar* ) "toll_booth" ) != 1 && xmlStrEqual( value, ( const xmlChar* ) "no" ) != 1){ + if (!accessYes && xmlStrEqual( value, ( const xmlChar* ) "" ) != 1 && xmlStrEqual( value, ( const xmlChar* ) "border_control" ) != 1 && xmlStrEqual( value, ( const xmlChar* ) "toll_booth" ) != 1 && xmlStrEqual( value, ( const xmlChar* ) "no" ) != 1){ node.bollard = true; } } @@ -271,6 +277,8 @@ private: if ( value != NULL ) xmlFree( value ); } + if(accessYes) + node.bollard = false; xmlFree( childName ); }