diff --git a/data/mapcss-mapping.csv b/data/mapcss-mapping.csv index 5efa253b36..a6ef920ce0 100644 --- a/data/mapcss-mapping.csv +++ b/data/mapcss-mapping.csv @@ -937,7 +937,7 @@ amenity|exhibition_centre;863; deprecated:railway|siding|tunnel:06.2023;864;x deprecated:railway|yard|tunnel:06.2023;865;x area:highway|footway;866; -deprecated|deprecated;867;x +junction|circular;867; area:highway|residential;868; area:highway|secondary;869; area:highway|tertiary;870; @@ -1079,6 +1079,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; +# Useless now, it is detected by the classifier, but has no any rules and isn't set as an exception. 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; diff --git a/data/strings/types_strings.txt b/data/strings/types_strings.txt index 41cb3a6e2b..132fb172e3 100644 --- a/data/strings/types_strings.txt +++ b/data/strings/types_strings.txt @@ -13366,7 +13366,7 @@ uk = Перехрестя zh-Hans = 交叉口 - [type.junction.roundabout] + [type.junction.circular] en = Roundabout af = Verkeersirkel ar = دوّار @@ -13387,6 +13387,9 @@ uk = Кільце zh-Hans = 环岛 + [type.junction.roundabout] + ref = type.junction.circular + [type.landuse] en = Landuse af = Grondgebruik diff --git a/generator/generator_tests/feature_builder_test.cpp b/generator/generator_tests/feature_builder_test.cpp index a5b5cfb764..94a6423d23 100644 --- a/generator/generator_tests/feature_builder_test.cpp +++ b/generator/generator_tests/feature_builder_test.cpp @@ -8,6 +8,7 @@ #include "indexer/data_header.hpp" #include "indexer/feature_visibility.hpp" +#include "indexer/ftypes_matcher.hpp" #include "base/geo_object_id.hpp" @@ -96,7 +97,9 @@ UNIT_CLASS_TEST(TestWithClassificator, FBuilder_LineTypes) TEST(fb2.IsValid(), (fb2)); TEST_EQUAL(fb1, fb2, ()); + TEST_EQUAL(fb2.GetTypesCount(), 5, ()); + ftypes::IsRoundAboutChecker::Instance()(fb2.GetTypes()); } UNIT_CLASS_TEST(TestWithClassificator, FBuilder_Waterfall) @@ -198,7 +201,7 @@ UNIT_CLASS_TEST(TestWithClassificator, FBuilder_RemoveUselessNames) TEST(fb1.IsValid(), (fb1)); } -UNIT_CLASS_TEST(TestWithClassificator, FeatureBuilderParams_Parsing) +UNIT_CLASS_TEST(TestWithClassificator, FBuilder_ParamsParsing) { FeatureBuilderParams params; @@ -215,7 +218,7 @@ UNIT_CLASS_TEST(TestWithClassificator, FeatureBuilderParams_Parsing) TEST_EQUAL(params.house.Get(), "0", ()); } -UNIT_CLASS_TEST(TestWithClassificator, FeatureBuilder_SerializeLocalityObjectForBuildingPoint) +UNIT_CLASS_TEST(TestWithClassificator, FBuilder_SerializeLocalityObjectForBuildingPoint) { FeatureBuilder fb; FeatureBuilderParams params; @@ -247,7 +250,7 @@ UNIT_CLASS_TEST(TestWithClassificator, FeatureBuilder_SerializeLocalityObjectFor fb.SerializeLocalityObject(serial::GeometryCodingParams(), buffer); } -UNIT_CLASS_TEST(TestWithClassificator, FeatureBuilder_SerializeAccuratelyForIntermediate) +UNIT_CLASS_TEST(TestWithClassificator, FBuilder_SerializeAccuratelyForIntermediate) { FeatureBuilder fb1; FeatureBuilderParams params; @@ -257,7 +260,7 @@ UNIT_CLASS_TEST(TestWithClassificator, FeatureBuilder_SerializeAccuratelyForInte { "highway", "motorway" }, { "hwtag", "oneway" }, { "psurface", "paved_good" }, - { "junction", "roundabout" }, + { "junction", "circular" }, }; AddTypes(params, arr2); @@ -266,7 +269,7 @@ UNIT_CLASS_TEST(TestWithClassificator, FeatureBuilder_SerializeAccuratelyForInte auto const diff = 0.33333333334567; for (size_t i = 0; i < 100; ++i) - fb1.AddPoint(m2::PointD(i + diff, i + 1 + diff)); + fb1.AddPoint(m2::PointD(i + diff, i + 1 + diff)); fb1.SetLinear(); @@ -282,6 +285,9 @@ UNIT_CLASS_TEST(TestWithClassificator, FeatureBuilder_SerializeAccuratelyForInte TEST(fb2.IsValid(), (fb2)); TEST(fb1.IsExactEq(fb2), ()); + + TEST_EQUAL(fb2.GetTypesCount(), 5, ()); + ftypes::IsRoundAboutChecker::Instance()(fb2.GetTypes()); } UNIT_CLASS_TEST(TestWithClassificator, FBuilder_RemoveUselessAltName) diff --git a/generator/generator_tests/osm_type_test.cpp b/generator/generator_tests/osm_type_test.cpp index 22d5d6eb69..9e61002526 100644 --- a/generator/generator_tests/osm_type_test.cpp +++ b/generator/generator_tests/osm_type_test.cpp @@ -1332,28 +1332,17 @@ UNIT_CLASS_TEST(TestWithClassificator, OsmType_NoExit) UNIT_CLASS_TEST(TestWithClassificator, OsmType_Junctions) { - for (char const * value : { "yes", "circular", "jughandle" }) + for (char const * value : { "yes", "jughandle" }) { Tags const tags = { {"junction", value } }; + // Useless now, because they don't have any rules and are not set as an exception. 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_Recycling) @@ -2013,6 +2002,7 @@ UNIT_CLASS_TEST(TestWithClassificator, OsmType_SimpleTypesSmoke) {"hwtag", "yescar"}, {"hwtag", "yesfoot"}, {"internet_access", "wlan"}, + {"junction", "circular"}, {"junction", "roundabout"}, {"landuse", "allotments"}, {"landuse", "basin"}, diff --git a/indexer/feature_visibility.cpp b/indexer/feature_visibility.cpp index 22f21cf647..1a6a2717cf 100644 --- a/indexer/feature_visibility.cpp +++ b/indexer/feature_visibility.cpp @@ -4,6 +4,7 @@ #include "indexer/drawing_rules.hpp" #include "indexer/feature.hpp" #include "indexer/feature_data.hpp" +#include "indexer/ftypes_matcher.hpp" #include "indexer/scales.hpp" #include "base/assert.hpp" @@ -175,11 +176,11 @@ namespace return false; static uint32_t const hwtag = cl.GetTypeByPath({"hwtag"}); - static uint32_t const roundabout = cl.GetTypeByPath({"junction", "roundabout"}); static uint32_t const psurface = cl.GetTypeByPath({"psurface"}); /// @todo "roundabout" type itself has caption drawing rules (for point junctions?). - if ((geomType == GeomType::Line || geomType == GeomType::Undefined) && type == roundabout) + if ((geomType == GeomType::Line || geomType == GeomType::Undefined) && + ftypes::IsRoundAboutChecker::Instance()(type)) return true; ftype::TruncValue(type, 1); diff --git a/indexer/ftypes_matcher.cpp b/indexer/ftypes_matcher.cpp index 9ae2584170..8dd0cf29af 100644 --- a/indexer/ftypes_matcher.cpp +++ b/indexer/ftypes_matcher.cpp @@ -410,6 +410,7 @@ IsOneWayChecker::IsOneWayChecker() IsRoundAboutChecker::IsRoundAboutChecker() { Classificator const & c = classif(); + m_types.push_back(c.GetTypeByPath({"junction", "circular"})); m_types.push_back(c.GetTypeByPath({"junction", "roundabout"})); }