From 14be72a736b4f9909ecc06be0fdc9ccc3065dd8a Mon Sep 17 00:00:00 2001 From: Viktor Govako Date: Thu, 30 Sep 2021 12:04:33 +0200 Subject: [PATCH] [classificator] Added generic "junction" type. Signed-off-by: Viktor Govako --- data/mapcss-mapping.csv | 2 +- data/styles/clear/include/Roads.mapcss | 3 ++- data/styles/clear/include/Roads_label.mapcss | 6 +++-- data/styles/vehicle/include/Roads.mapcss | 3 ++- .../styles/vehicle/include/Roads_label.mapcss | 6 +++-- generator/generator_tests/osm_type_test.cpp | 26 +++++++++++++++++++ 6 files changed, 39 insertions(+), 7 deletions(-) diff --git a/data/mapcss-mapping.csv b/data/mapcss-mapping.csv index 809ad7b13e..99299f1046 100644 --- a/data/mapcss-mapping.csv +++ b/data/mapcss-mapping.csv @@ -1004,7 +1004,7 @@ place|city|capital|10;[place=city][capital=10],[place=city][capital?][admin_leve place|city|capital|11;[place=city][capital=11],[place=city][capital?][admin_level=11];;name;int_name;1006; hwtag|yesfoot;1007; public_transport|platform;1008; -deprecated|deprecated;1009;x +junction;[junction];;name;int_name;1009; aeroway|aerodrome|international;[aeroway=aerodrome][aerodrome=international],[aeroway=aerodrome][aerodrome:type=international];;name;int_name;1010; railway|station|light_rail;[railway=station][station=light_rail],[railway=station][transport=light_rail];;name;int_name;1011; railway|station|monorail;[railway=station][station=monorail],[railway=station][transport=monorail];;name;int_name;1012; diff --git a/data/styles/clear/include/Roads.mapcss b/data/styles/clear/include/Roads.mapcss index 11297fd5b2..4fdd7201d4 100644 --- a/data/styles/clear/include/Roads.mapcss +++ b/data/styles/clear/include/Roads.mapcss @@ -233,7 +233,8 @@ line[railway=tram] line[highway=cycleway], line[highway=steps], -node[highway=motorway_junction] +node[highway=motorway_junction], +node[junction], {z-index: 1000;} line[aerialway=cable_car]::dash, diff --git a/data/styles/clear/include/Roads_label.mapcss b/data/styles/clear/include/Roads_label.mapcss index 5168bfd837..4c2748f3a8 100644 --- a/data/styles/clear/include/Roads_label.mapcss +++ b/data/styles/clear/include/Roads_label.mapcss @@ -535,10 +535,12 @@ line|z18-[hwtag=oneway]::arrows /* 13.JUNCTION */ -node|z15-[highway=motorway_junction] +node|z15-[highway=motorway_junction], +node|z17-[junction], {text: name;text-color: @subway_label;text-position: center;} node|z15[highway=motorway_junction] {font-size: 9;} -node|z16-[highway=motorway_junction] +node|z16-[highway=motorway_junction], +node|z17-[junction], {font-size: 10;} diff --git a/data/styles/vehicle/include/Roads.mapcss b/data/styles/vehicle/include/Roads.mapcss index 843608e22d..0ff90b72d3 100644 --- a/data/styles/vehicle/include/Roads.mapcss +++ b/data/styles/vehicle/include/Roads.mapcss @@ -233,7 +233,8 @@ line[railway=tram] line[highway=cycleway], line[highway=steps], -node[highway=motorway_junction] +node[highway=motorway_junction], +node[junction], {z-index: 1000;} line[aerialway=cable_car]::dash, diff --git a/data/styles/vehicle/include/Roads_label.mapcss b/data/styles/vehicle/include/Roads_label.mapcss index 4340c878ac..0c90dbf48d 100644 --- a/data/styles/vehicle/include/Roads_label.mapcss +++ b/data/styles/vehicle/include/Roads_label.mapcss @@ -569,10 +569,12 @@ line|z18-[hwtag=oneway]::arrows /* 13.JUNCTION */ -node|z15-[highway=motorway_junction] +node|z15-[highway=motorway_junction], +node|z17-[junction], {text: name;text-color: @subway_label;text-position: center;} node|z15[highway=motorway_junction] {font-size: 9;} -node|z16-[highway=motorway_junction] +node|z16-[highway=motorway_junction], +node|z17-[junction], {font-size: 10;} diff --git a/generator/generator_tests/osm_type_test.cpp b/generator/generator_tests/osm_type_test.cpp index aca08a8c2d..9521fb62a6 100644 --- a/generator/generator_tests/osm_type_test.cpp +++ b/generator/generator_tests/osm_type_test.cpp @@ -1252,6 +1252,32 @@ UNIT_CLASS_TEST(TestWithClassificator, OsmType_CuisineType) } } +UNIT_CLASS_TEST(TestWithClassificator, OsmType_Junctions) +{ + for (char const * value : { "yes", "circular", "jughandle" }) + { + Tags const tags = { + {"junction", value } + }; + + auto const params = GetFeatureBuilderParams(tags); + + TEST_EQUAL(params.m_types.size(), 1, (params)); + TEST(params.IsTypeExist(GetType({"junction"})), (params)); + } + + { + Tags const tags = { + {"junction", "roundabout" } + }; + + auto const params = GetFeatureBuilderParams(tags); + + TEST_EQUAL(params.m_types.size(), 1, (params)); + TEST(params.IsTypeExist(GetType({"junction", "roundabout"})), (params)); + } +} + UNIT_CLASS_TEST(TestWithClassificator, OsmType_SimpleTypesSmoke) { Tags const oneTypes = {