WIP: [styles] Add Turkey road shield #7153
1 changed files with 21 additions and 1 deletions
|
@ -72,6 +72,9 @@ std::unordered_map<std::string, RoadShieldType> const kRoadNetworkShields = {
|
|||
{"pl:national", RoadShieldType::Generic_Red},
|
||||
{"pl:regional", RoadShieldType::Generic_Orange},
|
||||
{"pl:local", RoadShieldType::Generic_White},
|
||||
{"tr:motorway", RoadShieldType::Generic_Orange},
|
||||
{"tr:road", RoadShieldType::Generic_Blue},
|
||||
{"tr:provincial", RoadShieldType::Generic_White},
|
||||
![]() I didn't realize that it was case-sensitive and thought it wasn't strictly matching. Here are example relations: I didn't realize that it was case-sensitive and thought it wasn't strictly matching. Here are example relations:
[TR:motorway](https://www.openstreetmap.org/relation/153991)
[TR-roads](https://www.openstreetmap.org/relation/1720464)
[TR:provincial - only one available as a relation](https://www.openstreetmap.org/relation/16142889)
![]() Yes, the processing is case sensitive. Yes, the processing is case sensitive.
Fix TR and dash and add unit tests here: road_shields_parser_tests.cpp
![]() Honestly, after thinking about it a bit more, the implementation can wait; because the data on OpenStreetMap is very inconsistent. There are many problems lying with motorway/state road relations, namely:
I'd like to consult with the local community and take at least some action towards standardizing reference and relation tags, before going further with this pull request. Honestly, after thinking about it a bit more, the implementation can wait; because the data on OpenStreetMap is very inconsistent. There are many problems lying with motorway/state road relations, namely:
- some motorway relations include their motorway_link junctions.
- some portions of state roads are mapped with subsection number ([example](https://www.openstreetmap.org/way/191189583)) on their ref tag.
- there is no consistency with the variants of "D".
- and finally, motorway sections on construction are included inside Turkish motorway road network relation or existing motorway relations, in turn which makes the situation worse.
I'd like to consult with the local community and take at least some action towards standardizing reference and relation tags, before going further with this pull request.
![]() Ok, remove it for now. Ok, remove it for now.
|
||||
{"ua:national", RoadShieldType::Generic_Blue},
|
||||
{"ua:regional", RoadShieldType::Generic_Blue},
|
||||
{"ua:territorial", RoadShieldType::Generic_White},
|
||||
|
@ -548,7 +551,7 @@ class CyprusRoadShieldParser : public SimpleRoadShieldParser
|
|||
{
|
||||
public:
|
||||
explicit CyprusRoadShieldParser(std::string const & baseRoadNumber)
|
||||
: SimpleRoadShieldParser(baseRoadNumber, {// North Cuprus.
|
||||
: SimpleRoadShieldParser(baseRoadNumber, {// North Cyprus.
|
||||
{"D.", RoadShieldType::Generic_Blue}, // White font.
|
||||
{"GM.", RoadShieldType::Generic_White}, // Blue font.
|
||||
{"GZ.", RoadShieldType::Generic_White}, // Blue font.
|
||||
|
@ -565,6 +568,21 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
class TurkeyRoadShieldParser : public SimpleRoadShieldParser
|
||||
//TODO: Implement provincial road shields, formatted as (province number, between 01-81)-(two digit number)
|
||||
{
|
||||
public:
|
||||
explicit TurkeyRoadShieldParser(std::string const & baseRoadNumber)
|
||||
: SimpleRoadShieldParser(baseRoadNumber, {
|
||||
{"O-", RoadShieldType::Generic_Orange}, // Black font. Hexagon.
|
||||
{"D.", RoadShieldType::Generic_Blue}, // White font.
|
||||
{"D-", RoadShieldType::Generic_Blue}, // White font.
|
||||
{"D", RoadShieldType::Generic_Blue}, // White font.
|
||||
{"D ", RoadShieldType::Generic_Blue}}) // White font.
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
class MexicoRoadShieldParser : public RoadShieldParser
|
||||
{
|
||||
public:
|
||||
|
@ -658,6 +676,8 @@ RoadShieldsSetT GetRoadShields(std::string const & mwmName, std::string const &
|
|||
return MexicoRoadShieldParser(roadNumber).GetRoadShields();
|
||||
if (mwmName == "Cyprus")
|
||||
return CyprusRoadShieldParser(roadNumber).GetRoadShields();
|
||||
if (mwmName == "Turkey")
|
||||
return TurkeyRoadShieldParser(roadNumber).GetRoadShields();
|
||||
|
||||
return SimpleRoadShieldParser(roadNumber, SimpleRoadShieldParser::ShieldTypes()).GetRoadShields();
|
||||
}
|
||||
|
|
Reference in a new issue
Where are these come from?
When I make the overpass query like "network"~"tr:" (https://overpass-turbo.eu/s/1FVM), I got nothing.