diff --git a/data/classificator.txt b/data/classificator.txt index 877750f5ac..7f1dadda52 100644 --- a/data/classificator.txt +++ b/data/classificator.txt @@ -832,10 +832,7 @@ world + toxic - {} route + - ferry + - motor_vehicle - - motorcar - - {} + ferry - shuttle_train - {} shop + diff --git a/data/drules_proto.bin b/data/drules_proto.bin index 9e661d9ccc..61bd582a40 100644 Binary files a/data/drules_proto.bin and b/data/drules_proto.bin differ diff --git a/data/drules_proto.txt b/data/drules_proto.txt index b11244e9c1..d9c46b3402 100644 --- a/data/drules_proto.txt +++ b/data/drules_proto.txt @@ -55964,410 +55964,6 @@ cont { } } } -cont { - name: "route-ferry-motor_vehicle" - element { - scale: 10 - lines { - width: 1.0 - color: 4495803 - dashdot { - dd: 5.4 - dd: 2.7 - } - priority: 1149 - join: BEVELJOIN - cap: BUTTCAP - } - path_text { - primary { - height: 9 - color: 4495803 - } - priority: 16149 - } - } - element { - scale: 11 - lines { - width: 1.0 - color: 4495803 - dashdot { - dd: 5.4 - dd: 2.7 - } - priority: 1149 - join: BEVELJOIN - cap: BUTTCAP - } - path_text { - primary { - height: 9 - color: 4495803 - } - priority: 16149 - } - } - element { - scale: 12 - lines { - width: 1.0 - color: 4495803 - dashdot { - dd: 5.4 - dd: 2.7 - } - priority: 1149 - join: BEVELJOIN - cap: BUTTCAP - } - path_text { - primary { - height: 9 - color: 4495803 - } - priority: 16149 - } - } - element { - scale: 13 - lines { - width: 1.0 - color: 4495803 - dashdot { - dd: 5.4 - dd: 2.7 - } - priority: 1149 - cap: BUTTCAP - } - path_text { - primary { - height: 9 - color: 4495803 - } - priority: 16149 - } - } - element { - scale: 14 - lines { - width: 1.0 - color: 4495803 - dashdot { - dd: 5.4 - dd: 2.7 - } - priority: 1149 - cap: BUTTCAP - } - path_text { - primary { - height: 9 - color: 4495803 - } - priority: 16149 - } - } - element { - scale: 15 - lines { - width: 1.0 - color: 4495803 - dashdot { - dd: 5.4 - dd: 2.7 - } - priority: 1149 - cap: BUTTCAP - } - path_text { - primary { - height: 9 - color: 4495803 - } - priority: 16149 - } - } - element { - scale: 16 - lines { - width: 1.0 - color: 4495803 - dashdot { - dd: 5.4 - dd: 2.7 - } - priority: 1149 - } - path_text { - primary { - height: 9 - color: 4495803 - } - priority: 16149 - } - } - element { - scale: 17 - lines { - width: 1.0 - color: 4495803 - dashdot { - dd: 5.4 - dd: 2.7 - } - priority: 1149 - } - path_text { - primary { - height: 10 - color: 4495803 - } - priority: 16149 - } - } - element { - scale: 18 - lines { - width: 1.0 - color: 4495803 - dashdot { - dd: 5.4 - dd: 2.7 - } - priority: 1149 - } - path_text { - primary { - height: 10 - color: 4495803 - } - priority: 16149 - } - } - element { - scale: 19 - lines { - width: 1.0 - color: 4495803 - dashdot { - dd: 5.4 - dd: 2.7 - } - priority: 1149 - } - path_text { - primary { - height: 10 - color: 4495803 - } - priority: 16149 - } - } -} -cont { - name: "route-ferry-motorcar" - element { - scale: 10 - lines { - width: 1.0 - color: 4495803 - dashdot { - dd: 5.4 - dd: 2.7 - } - priority: 1149 - join: BEVELJOIN - cap: BUTTCAP - } - path_text { - primary { - height: 9 - color: 4495803 - } - priority: 16149 - } - } - element { - scale: 11 - lines { - width: 1.0 - color: 4495803 - dashdot { - dd: 5.4 - dd: 2.7 - } - priority: 1149 - join: BEVELJOIN - cap: BUTTCAP - } - path_text { - primary { - height: 9 - color: 4495803 - } - priority: 16149 - } - } - element { - scale: 12 - lines { - width: 1.0 - color: 4495803 - dashdot { - dd: 5.4 - dd: 2.7 - } - priority: 1149 - join: BEVELJOIN - cap: BUTTCAP - } - path_text { - primary { - height: 9 - color: 4495803 - } - priority: 16149 - } - } - element { - scale: 13 - lines { - width: 1.0 - color: 4495803 - dashdot { - dd: 5.4 - dd: 2.7 - } - priority: 1149 - cap: BUTTCAP - } - path_text { - primary { - height: 9 - color: 4495803 - } - priority: 16149 - } - } - element { - scale: 14 - lines { - width: 1.0 - color: 4495803 - dashdot { - dd: 5.4 - dd: 2.7 - } - priority: 1149 - cap: BUTTCAP - } - path_text { - primary { - height: 9 - color: 4495803 - } - priority: 16149 - } - } - element { - scale: 15 - lines { - width: 1.0 - color: 4495803 - dashdot { - dd: 5.4 - dd: 2.7 - } - priority: 1149 - cap: BUTTCAP - } - path_text { - primary { - height: 9 - color: 4495803 - } - priority: 16149 - } - } - element { - scale: 16 - lines { - width: 1.0 - color: 4495803 - dashdot { - dd: 5.4 - dd: 2.7 - } - priority: 1149 - } - path_text { - primary { - height: 9 - color: 4495803 - } - priority: 16149 - } - } - element { - scale: 17 - lines { - width: 1.0 - color: 4495803 - dashdot { - dd: 5.4 - dd: 2.7 - } - priority: 1149 - } - path_text { - primary { - height: 10 - color: 4495803 - } - priority: 16149 - } - } - element { - scale: 18 - lines { - width: 1.0 - color: 4495803 - dashdot { - dd: 5.4 - dd: 2.7 - } - priority: 1149 - } - path_text { - primary { - height: 10 - color: 4495803 - } - priority: 16149 - } - } - element { - scale: 19 - lines { - width: 1.0 - color: 4495803 - dashdot { - dd: 5.4 - dd: 2.7 - } - priority: 1149 - } - path_text { - primary { - height: 10 - color: 4495803 - } - priority: 16149 - } - } -} cont { name: "shop" element { diff --git a/data/drules_proto_clear.bin b/data/drules_proto_clear.bin index dbee901e27..29343cec9f 100644 Binary files a/data/drules_proto_clear.bin and b/data/drules_proto_clear.bin differ diff --git a/data/drules_proto_clear.txt b/data/drules_proto_clear.txt index 7dfef789f5..e9653bfa2a 100644 --- a/data/drules_proto_clear.txt +++ b/data/drules_proto_clear.txt @@ -55596,410 +55596,6 @@ cont { } } } -cont { - name: "route-ferry-motor_vehicle" - element { - scale: 10 - lines { - width: 1.0 - color: 4495803 - dashdot { - dd: 5.4 - dd: 2.7 - } - priority: 1149 - join: BEVELJOIN - cap: BUTTCAP - } - path_text { - primary { - height: 9 - color: 4495803 - } - priority: 16149 - } - } - element { - scale: 11 - lines { - width: 1.0 - color: 4495803 - dashdot { - dd: 5.4 - dd: 2.7 - } - priority: 1149 - join: BEVELJOIN - cap: BUTTCAP - } - path_text { - primary { - height: 9 - color: 4495803 - } - priority: 16149 - } - } - element { - scale: 12 - lines { - width: 1.0 - color: 4495803 - dashdot { - dd: 5.4 - dd: 2.7 - } - priority: 1149 - join: BEVELJOIN - cap: BUTTCAP - } - path_text { - primary { - height: 9 - color: 4495803 - } - priority: 16149 - } - } - element { - scale: 13 - lines { - width: 1.0 - color: 4495803 - dashdot { - dd: 5.4 - dd: 2.7 - } - priority: 1149 - cap: BUTTCAP - } - path_text { - primary { - height: 9 - color: 4495803 - } - priority: 16149 - } - } - element { - scale: 14 - lines { - width: 1.0 - color: 4495803 - dashdot { - dd: 5.4 - dd: 2.7 - } - priority: 1149 - cap: BUTTCAP - } - path_text { - primary { - height: 9 - color: 4495803 - } - priority: 16149 - } - } - element { - scale: 15 - lines { - width: 1.0 - color: 4495803 - dashdot { - dd: 5.4 - dd: 2.7 - } - priority: 1149 - cap: BUTTCAP - } - path_text { - primary { - height: 9 - color: 4495803 - } - priority: 16149 - } - } - element { - scale: 16 - lines { - width: 1.0 - color: 4495803 - dashdot { - dd: 5.4 - dd: 2.7 - } - priority: 1149 - } - path_text { - primary { - height: 9 - color: 4495803 - } - priority: 16149 - } - } - element { - scale: 17 - lines { - width: 1.0 - color: 4495803 - dashdot { - dd: 5.4 - dd: 2.7 - } - priority: 1149 - } - path_text { - primary { - height: 10 - color: 4495803 - } - priority: 16149 - } - } - element { - scale: 18 - lines { - width: 1.0 - color: 4495803 - dashdot { - dd: 5.4 - dd: 2.7 - } - priority: 1149 - } - path_text { - primary { - height: 10 - color: 4495803 - } - priority: 16149 - } - } - element { - scale: 19 - lines { - width: 1.0 - color: 4495803 - dashdot { - dd: 5.4 - dd: 2.7 - } - priority: 1149 - } - path_text { - primary { - height: 10 - color: 4495803 - } - priority: 16149 - } - } -} -cont { - name: "route-ferry-motorcar" - element { - scale: 10 - lines { - width: 1.0 - color: 4495803 - dashdot { - dd: 5.4 - dd: 2.7 - } - priority: 1149 - join: BEVELJOIN - cap: BUTTCAP - } - path_text { - primary { - height: 9 - color: 4495803 - } - priority: 16149 - } - } - element { - scale: 11 - lines { - width: 1.0 - color: 4495803 - dashdot { - dd: 5.4 - dd: 2.7 - } - priority: 1149 - join: BEVELJOIN - cap: BUTTCAP - } - path_text { - primary { - height: 9 - color: 4495803 - } - priority: 16149 - } - } - element { - scale: 12 - lines { - width: 1.0 - color: 4495803 - dashdot { - dd: 5.4 - dd: 2.7 - } - priority: 1149 - join: BEVELJOIN - cap: BUTTCAP - } - path_text { - primary { - height: 9 - color: 4495803 - } - priority: 16149 - } - } - element { - scale: 13 - lines { - width: 1.0 - color: 4495803 - dashdot { - dd: 5.4 - dd: 2.7 - } - priority: 1149 - cap: BUTTCAP - } - path_text { - primary { - height: 9 - color: 4495803 - } - priority: 16149 - } - } - element { - scale: 14 - lines { - width: 1.0 - color: 4495803 - dashdot { - dd: 5.4 - dd: 2.7 - } - priority: 1149 - cap: BUTTCAP - } - path_text { - primary { - height: 9 - color: 4495803 - } - priority: 16149 - } - } - element { - scale: 15 - lines { - width: 1.0 - color: 4495803 - dashdot { - dd: 5.4 - dd: 2.7 - } - priority: 1149 - cap: BUTTCAP - } - path_text { - primary { - height: 9 - color: 4495803 - } - priority: 16149 - } - } - element { - scale: 16 - lines { - width: 1.0 - color: 4495803 - dashdot { - dd: 5.4 - dd: 2.7 - } - priority: 1149 - } - path_text { - primary { - height: 9 - color: 4495803 - } - priority: 16149 - } - } - element { - scale: 17 - lines { - width: 1.0 - color: 4495803 - dashdot { - dd: 5.4 - dd: 2.7 - } - priority: 1149 - } - path_text { - primary { - height: 10 - color: 4495803 - } - priority: 16149 - } - } - element { - scale: 18 - lines { - width: 1.0 - color: 4495803 - dashdot { - dd: 5.4 - dd: 2.7 - } - priority: 1149 - } - path_text { - primary { - height: 10 - color: 4495803 - } - priority: 16149 - } - } - element { - scale: 19 - lines { - width: 1.0 - color: 4495803 - dashdot { - dd: 5.4 - dd: 2.7 - } - priority: 1149 - } - path_text { - primary { - height: 10 - color: 4495803 - } - priority: 16149 - } - } -} cont { name: "shop" element { diff --git a/data/drules_proto_dark.bin b/data/drules_proto_dark.bin index f9482cef5d..00eae025ce 100644 Binary files a/data/drules_proto_dark.bin and b/data/drules_proto_dark.bin differ diff --git a/data/drules_proto_dark.txt b/data/drules_proto_dark.txt index 2f9da04efc..3d2fc850df 100644 --- a/data/drules_proto_dark.txt +++ b/data/drules_proto_dark.txt @@ -55683,410 +55683,6 @@ cont { } } } -cont { - name: "route-ferry-motor_vehicle" - element { - scale: 10 - lines { - width: 1.0 - color: 2770241 - dashdot { - dd: 5.4 - dd: 2.7 - } - priority: 1149 - join: BEVELJOIN - cap: BUTTCAP - } - path_text { - primary { - height: 9 - color: 19033 - } - priority: 16149 - } - } - element { - scale: 11 - lines { - width: 1.0 - color: 2770241 - dashdot { - dd: 5.4 - dd: 2.7 - } - priority: 1149 - join: BEVELJOIN - cap: BUTTCAP - } - path_text { - primary { - height: 9 - color: 19033 - } - priority: 16149 - } - } - element { - scale: 12 - lines { - width: 1.0 - color: 2770241 - dashdot { - dd: 5.4 - dd: 2.7 - } - priority: 1149 - join: BEVELJOIN - cap: BUTTCAP - } - path_text { - primary { - height: 9 - color: 19033 - } - priority: 16149 - } - } - element { - scale: 13 - lines { - width: 1.0 - color: 2770241 - dashdot { - dd: 5.4 - dd: 2.7 - } - priority: 1149 - cap: BUTTCAP - } - path_text { - primary { - height: 9 - color: 19033 - } - priority: 16149 - } - } - element { - scale: 14 - lines { - width: 1.0 - color: 2770241 - dashdot { - dd: 5.4 - dd: 2.7 - } - priority: 1149 - cap: BUTTCAP - } - path_text { - primary { - height: 9 - color: 19033 - } - priority: 16149 - } - } - element { - scale: 15 - lines { - width: 1.0 - color: 2770241 - dashdot { - dd: 5.4 - dd: 2.7 - } - priority: 1149 - cap: BUTTCAP - } - path_text { - primary { - height: 9 - color: 19033 - } - priority: 16149 - } - } - element { - scale: 16 - lines { - width: 1.0 - color: 2770241 - dashdot { - dd: 5.4 - dd: 2.7 - } - priority: 1149 - } - path_text { - primary { - height: 9 - color: 19033 - } - priority: 16149 - } - } - element { - scale: 17 - lines { - width: 1.0 - color: 2770241 - dashdot { - dd: 5.4 - dd: 2.7 - } - priority: 1149 - } - path_text { - primary { - height: 10 - color: 19033 - } - priority: 16149 - } - } - element { - scale: 18 - lines { - width: 1.0 - color: 2770241 - dashdot { - dd: 5.4 - dd: 2.7 - } - priority: 1149 - } - path_text { - primary { - height: 10 - color: 19033 - } - priority: 16149 - } - } - element { - scale: 19 - lines { - width: 1.0 - color: 2770241 - dashdot { - dd: 5.4 - dd: 2.7 - } - priority: 1149 - } - path_text { - primary { - height: 10 - color: 19033 - } - priority: 16149 - } - } -} -cont { - name: "route-ferry-motorcar" - element { - scale: 10 - lines { - width: 1.0 - color: 2770241 - dashdot { - dd: 5.4 - dd: 2.7 - } - priority: 1149 - join: BEVELJOIN - cap: BUTTCAP - } - path_text { - primary { - height: 9 - color: 19033 - } - priority: 16149 - } - } - element { - scale: 11 - lines { - width: 1.0 - color: 2770241 - dashdot { - dd: 5.4 - dd: 2.7 - } - priority: 1149 - join: BEVELJOIN - cap: BUTTCAP - } - path_text { - primary { - height: 9 - color: 19033 - } - priority: 16149 - } - } - element { - scale: 12 - lines { - width: 1.0 - color: 2770241 - dashdot { - dd: 5.4 - dd: 2.7 - } - priority: 1149 - join: BEVELJOIN - cap: BUTTCAP - } - path_text { - primary { - height: 9 - color: 19033 - } - priority: 16149 - } - } - element { - scale: 13 - lines { - width: 1.0 - color: 2770241 - dashdot { - dd: 5.4 - dd: 2.7 - } - priority: 1149 - cap: BUTTCAP - } - path_text { - primary { - height: 9 - color: 19033 - } - priority: 16149 - } - } - element { - scale: 14 - lines { - width: 1.0 - color: 2770241 - dashdot { - dd: 5.4 - dd: 2.7 - } - priority: 1149 - cap: BUTTCAP - } - path_text { - primary { - height: 9 - color: 19033 - } - priority: 16149 - } - } - element { - scale: 15 - lines { - width: 1.0 - color: 2770241 - dashdot { - dd: 5.4 - dd: 2.7 - } - priority: 1149 - cap: BUTTCAP - } - path_text { - primary { - height: 9 - color: 19033 - } - priority: 16149 - } - } - element { - scale: 16 - lines { - width: 1.0 - color: 2770241 - dashdot { - dd: 5.4 - dd: 2.7 - } - priority: 1149 - } - path_text { - primary { - height: 9 - color: 19033 - } - priority: 16149 - } - } - element { - scale: 17 - lines { - width: 1.0 - color: 2770241 - dashdot { - dd: 5.4 - dd: 2.7 - } - priority: 1149 - } - path_text { - primary { - height: 10 - color: 19033 - } - priority: 16149 - } - } - element { - scale: 18 - lines { - width: 1.0 - color: 2770241 - dashdot { - dd: 5.4 - dd: 2.7 - } - priority: 1149 - } - path_text { - primary { - height: 10 - color: 19033 - } - priority: 16149 - } - } - element { - scale: 19 - lines { - width: 1.0 - color: 2770241 - dashdot { - dd: 5.4 - dd: 2.7 - } - priority: 1149 - } - path_text { - primary { - height: 10 - color: 19033 - } - priority: 16149 - } - } -} cont { name: "shop" element { diff --git a/data/mapcss-mapping.csv b/data/mapcss-mapping.csv index 2757bb3e9d..6a017ea410 100644 --- a/data/mapcss-mapping.csv +++ b/data/mapcss-mapping.csv @@ -984,12 +984,12 @@ internet_access|wlan;985; amenity|waste_disposal;986; amenity|bbq;987; deprecated|deprecated;988;x -route|ferry|motorcar;[route=ferry][motorcar];;name;int_name;989; +route|ferry|motorcar;[route=ferry][motorcar];x;name;int_name;989;route|ferry junction|roundabout;990; highway|speed_camera;991; shop|beauty;992; shop|sports;993; -route|ferry|motor_vehicle;[route=ferry][motor_vehicle];;name;int_name;994; +route|ferry|motor_vehicle;[route=ferry][motor_vehicle];x;name;int_name;994;route|ferry railway|rail|motor_vehicle;[railway=rail][motor_vehicle];;name;int_name;995; hwtag|nofoot;996; place|city|capital|2;[place=city][capital=2],[place=city][capital?][admin_level=2];;name;int_name;997; diff --git a/data/types.txt b/data/types.txt index 3c9e3c1ee5..dcab0453af 100644 --- a/data/types.txt +++ b/data/types.txt @@ -986,12 +986,12 @@ mapswithme *amenity|waste_disposal *amenity|bbq mapswithme -*route|ferry|motorcar +route|ferry *junction|roundabout *highway|speed_camera *shop|beauty *shop|sports -*route|ferry|motor_vehicle +route|ferry *railway|rail|motor_vehicle *hwtag|nofoot *place|city|capital|2 diff --git a/data/visibility.txt b/data/visibility.txt index ab61a1ed4c..88938ec084 100644 --- a/data/visibility.txt +++ b/data/visibility.txt @@ -832,10 +832,7 @@ world 00000000000000000000 + toxic 00000000000000000000 - {} route 00000000000000000000 + - ferry 00000000000000000000 + - motor_vehicle 00000000000000000000 - - motorcar 00000000000000000000 - - {} + ferry 00000000000000000000 - shuttle_train 00000000000000000000 - {} shop 00000000000000000000 + diff --git a/generator/generator_tests/osm_type_test.cpp b/generator/generator_tests/osm_type_test.cpp index ad7e44b87d..6d028b3387 100644 --- a/generator/generator_tests/osm_type_test.cpp +++ b/generator/generator_tests/osm_type_test.cpp @@ -527,31 +527,44 @@ UNIT_CLASS_TEST(TestWithClassificator, OsmType_Ferry) { routing::CarModel const & carModel = routing::CarModel::AllLimitsInstance(); - Tags const tags = { - { "motorcar", "yes" }, - { "highway", "primary" }, - { "bridge", "yes" }, - { "route", "ferry" }, - }; + { + Tags const tags = { + { "route", "ferry" }, + }; - auto const params = GetFeatureBuilderParams(tags); + auto const params = GetFeatureBuilderParams(tags); - TEST_EQUAL(params.m_types.size(), 3, (params)); + TEST_EQUAL(params.m_types.size(), 2, (params)); - uint32_t type = GetType({"highway", "primary", "bridge"}); - TEST(params.IsTypeExist(type), ()); - TEST(carModel.IsRoadType(type), ()); + uint32_t type = GetType({"route", "ferry"}); + TEST(params.IsTypeExist(type), (params)); + TEST(carModel.IsRoadType(type), ()); - type = GetType({"route", "ferry", "motorcar"}); - TEST(params.IsTypeExist(type), (params)); - TEST(carModel.IsRoadType(type), ()); + type = GetType({"hwtag", "nocar"}); + TEST(params.IsTypeExist(type), ()); + } - type = GetType({"route", "ferry"}); - TEST(!params.IsTypeExist(type), ()); - TEST(carModel.IsRoadType(type), ()); + { + Tags const tags = { + { "foot", "no" }, + { "motorcar", "yes" }, + { "route", "ferry" }, + }; - type = GetType({"hwtag", "yescar"}); - TEST(params.IsTypeExist(type), ()); + auto const params = GetFeatureBuilderParams(tags); + + TEST_EQUAL(params.m_types.size(), 3, (params)); + + uint32_t type = GetType({"route", "ferry"}); + TEST(params.IsTypeExist(type), (params)); + TEST(carModel.IsRoadType(type), ()); + + type = GetType({"hwtag", "yescar"}); + TEST(params.IsTypeExist(type), ()); + + type = GetType({"hwtag", "nofoot"}); + TEST(params.IsTypeExist(type), ()); + } } UNIT_CLASS_TEST(TestWithClassificator, OsmType_YesCarNoCar) @@ -1218,7 +1231,7 @@ UNIT_CLASS_TEST(TestWithClassificator, OsmType_CuisineType) UNIT_CLASS_TEST(TestWithClassificator, OsmType_SimpleTypesSmoke) { - Tags const simpleTypes = { + Tags const oneTypes = { // Filtered out by MatchTypes filter because have no styles. // {"aeroway", "apron"}, // {"area:highway", "cycleway"}, @@ -1679,7 +1692,6 @@ UNIT_CLASS_TEST(TestWithClassificator, OsmType_SimpleTypesSmoke) {"railway", "tram"}, {"railway", "tram_stop"}, {"railway", "yard"}, - {"route", "ferry"}, {"route", "shuttle_train"}, {"shop", "alcohol"}, {"shop", "bakery"}, @@ -1826,11 +1838,22 @@ UNIT_CLASS_TEST(TestWithClassificator, OsmType_SimpleTypesSmoke) {"wheelchair", "yes"}, }; - for (auto const & type : simpleTypes) + for (auto const & type : oneTypes) { - auto const params = GetFeatureBuilderParams({type}); - TEST_EQUAL(params.m_types.size(), 1, (type, params)); - TEST(params.IsTypeExist(classif().GetTypeByPath({type.m_key, type.m_value})), (type, params)); + auto const params = GetFeatureBuilderParams({type}); + TEST_EQUAL(params.m_types.size(), 1, (type, params)); + TEST(params.IsTypeExist(classif().GetTypeByPath({type.m_key, type.m_value})), (type, params)); + } + + Tags const exTypes = { + {"route", "ferry"}, + }; + + for (auto const & type : exTypes) + { + auto const params = GetFeatureBuilderParams({type}); + TEST_GREATER(params.m_types.size(), 1, (type, params)); + TEST(params.IsTypeExist(classif().GetTypeByPath({type.m_key, type.m_value})), (type, params)); } } @@ -2129,8 +2152,6 @@ UNIT_CLASS_TEST(TestWithClassificator, OsmType_ComplexTypesSmoke) {{"railway", "tram", "tunnel"}, {{"railway", "tram"}, {"tunnel", "any_value"}}}, {{"railway", "yard", "bridge"}, {{"railway", "yard"}, {"bridge", "any_value"}}}, {{"railway", "yard", "tunnel"}, {{"railway", "yard"}, {"tunnel", "any_value"}}}, - {{"route", "ferry", "motor_vehicle"}, {{"route", "ferry"}, {"motor_vehicle", "any_value"}}}, - {{"route", "ferry", "motorcar"}, {{"route", "ferry"}, {"motorcar", "any_value"}}}, {{"shop", "car_repair", "tyres"}, {{"shop", "car_repair"}, {"service", "tyres"}}}, {{"shop", "clothes"}, {{"shop", "clothes"}}}, {{"shop", "clothes"}, {{"shop", "fashion"}}}, diff --git a/generator/osm2type.cpp b/generator/osm2type.cpp index 4edb30188e..70cd315829 100644 --- a/generator/osm2type.cpp +++ b/generator/osm2type.cpp @@ -235,6 +235,7 @@ public: BarrierGate, Toll, BicycleOnedir, + Ferry, Count }; @@ -267,7 +268,9 @@ public: {Type::WheelchairYes, {"wheelchair", "yes"}}, {Type::BarrierGate, {"barrier", "gate"}}, {Type::Toll, {"hwtag", "toll"}}, - {Type::BicycleOnedir, {"hwtag", "onedir_bicycle"}}}; + {Type::BicycleOnedir, {"hwtag", "onedir_bicycle"}}, + {Type::Ferry, {"route", "ferry"}}, + }; m_types.resize(static_cast(Type::Count)); for (auto const & kv : kTypeToName) @@ -285,7 +288,15 @@ public: return t == Get(Type::Highway); } - bool IsRailwayStation(uint32_t t) const { return t == Get(Type::RailwayStation); } + bool IsFerry(uint32_t t) const + { + return t == Get(Type::Ferry); + } + + bool IsRailwayStation(uint32_t t) const + { + return t == Get(Type::RailwayStation); + } bool IsSubwayStation(uint32_t t) const { @@ -725,12 +736,15 @@ void PostprocessElement(OsmElement * p, FeatureBuilderParams & params) bool highwayDone = false; bool subwayDone = false; bool railwayDone = false; + bool ferryDone = false; bool addOneway = false; bool noOneway = false; + bool yesMotorFerry = false; // Get a copy of source types, because we will modify params in the loop; FeatureBuilderParams::Types const vTypes = params.m_types; + for (size_t i = 0; i < vTypes.size(); ++i) { if (!highwayDone && types.IsHighway(vTypes[i])) @@ -787,6 +801,23 @@ void PostprocessElement(OsmElement * p, FeatureBuilderParams & params) highwayDone = true; } + if (!ferryDone && types.IsFerry(vTypes[i])) + { + TagProcessor(p).ApplyRules({ + {"foot", "!", [¶ms] { params.AddType(types.Get(CachedTypes::Type::NoFoot)); }}, + {"foot", "~", [¶ms] { params.AddType(types.Get(CachedTypes::Type::YesFoot)); }}, + {"bicycle", "!", [¶ms] { params.AddType(types.Get(CachedTypes::Type::NoBicycle)); }}, + {"bicycle", "~", [¶ms] { params.AddType(types.Get(CachedTypes::Type::YesBicycle)); }}, + {"motor_vehicle", "yes", [&yesMotorFerry] { yesMotorFerry = true; }}, + {"motorcar", "yes", [&yesMotorFerry] { yesMotorFerry = true; }}, + }); + + // For car routing 'motorcar' tag should be explicitly defined. + params.AddType(types.Get(yesMotorFerry ? CachedTypes::Type::YesCar : CachedTypes::Type::NoCar)); + + ferryDone = true; + } + /// @todo Probably, we can delete this processing because cities /// are matched by limit rect in MatchCity. if (!subwayDone && types.IsSubwayStation(vTypes[i])) diff --git a/routing/routing_options.cpp b/routing/routing_options.cpp index f709b23530..34c9429c52 100644 --- a/routing/routing_options.cpp +++ b/routing/routing_options.cpp @@ -67,8 +67,6 @@ RoutingOptionsClassifier::RoutingOptionsClassifier() {{"hwtag", "toll"}, RoutingOptions::Road::Toll}, {{"route", "ferry"}, RoutingOptions::Road::Ferry}, - {{"route", "ferry", "motorcar"}, RoutingOptions::Road::Ferry}, - {{"route", "ferry", "motor_vehicle"}, RoutingOptions::Road::Ferry}, {{"highway", "track"}, RoutingOptions::Road::Dirty}, {{"highway", "road"}, RoutingOptions::Road::Dirty}, diff --git a/routing/single_vehicle_world_graph.cpp b/routing/single_vehicle_world_graph.cpp index 8f19845653..c88ab2de68 100644 --- a/routing/single_vehicle_world_graph.cpp +++ b/routing/single_vehicle_world_graph.cpp @@ -120,6 +120,7 @@ void SingleVehicleWorldGraph::GetEdgeList( auto & indexGraph = GetIndexGraph(parent.GetMwmId()); indexGraph.GetEdgeList(parentVertexData, parent, isOutgoing, jointEdges, parentWeights, parents); + // Comment this call to debug routing on single generated mwm. if (m_mode != WorldGraphMode::JointSingleMwm) CheckAndProcessTransitFeatures(parent, jointEdges, parentWeights, isOutgoing); } diff --git a/routing_common/car_model.cpp b/routing_common/car_model.cpp index 72868262b8..8d405fa49a 100644 --- a/routing_common/car_model.cpp +++ b/routing_common/car_model.cpp @@ -129,11 +129,9 @@ VehicleModel::LimitsInitList const kCarOptionsGermany = { vector const kAdditionalTags = { // {{highway tags}, {weightSpeed, etaSpeed}} - {{"route", "ferry", "motorcar"}, kHighwayBasedSpeeds.at(HighwayType::RouteFerryMotorcar)}, - {{"route", "ferry", "motor_vehicle"}, kHighwayBasedSpeeds.at(HighwayType::RouteFerryMotorVehicle)}, {{"railway", "rail", "motor_vehicle"}, kHighwayBasedSpeeds.at(HighwayType::RailwayRailMotorVehicle)}, {{"route", "shuttle_train"}, kHighwayBasedSpeeds.at(HighwayType::RouteShuttleTrain)}, - {{"route", "ferry"}, kHighwayBasedSpeeds.at(HighwayType::RouteFerryMotorcar)}, + {{"route", "ferry"}, kHighwayBasedSpeeds.at(HighwayType::RouteFerry)}, {{"man_made", "pier"}, kHighwayBasedSpeeds.at(HighwayType::ManMadePier)}}; VehicleModel::SurfaceInitList const kCarSurface = { diff --git a/routing_common/car_model_coefs.hpp b/routing_common/car_model_coefs.hpp index 1619b657db..8562232246 100644 --- a/routing_common/car_model_coefs.hpp +++ b/routing_common/car_model_coefs.hpp @@ -32,8 +32,7 @@ HighwayBasedFactors const kHighwayBasedFactors = { {HighwayType::HighwayUnclassified, InOutCityFactor(0.80)}, {HighwayType::ManMadePier, InOutCityFactor(0.90)}, {HighwayType::RailwayRailMotorVehicle, InOutCityFactor(0.90)}, - {HighwayType::RouteFerryMotorcar, InOutCityFactor(0.90)}, - {HighwayType::RouteFerryMotorVehicle, InOutCityFactor(0.90)}, + {HighwayType::RouteFerry, InOutCityFactor(0.90)}, {HighwayType::RouteShuttleTrain, InOutCityFactor(0.90)}, }; @@ -57,8 +56,7 @@ HighwayBasedSpeeds const kHighwayBasedSpeeds = { {HighwayType::HighwayUnclassified, InOutCitySpeedKMpH({30.00, 30.00} /* in city */, {40.00, 40.00} /* out city */)}, {HighwayType::ManMadePier, InOutCitySpeedKMpH({17.00, 10.00} /* in city */, {17.00, 10.00} /* out city */)}, {HighwayType::RailwayRailMotorVehicle, InOutCitySpeedKMpH({10.00, 10.00} /* in city */, {10.00, 10.00} /* out city */)}, - {HighwayType::RouteFerryMotorcar, InOutCitySpeedKMpH({10.00, 10.00} /* in city */, {10.00, 10.00} /* out city */)}, - {HighwayType::RouteFerryMotorVehicle, InOutCitySpeedKMpH({10.00, 10.00} /* in city */, {10.00, 10.00} /* out city */)}, + {HighwayType::RouteFerry, InOutCitySpeedKMpH({10.00, 10.00} /* in city */, {10.00, 10.00} /* out city */)}, {HighwayType::RouteShuttleTrain, InOutCitySpeedKMpH({25.00, 25.00} /* in city */, {25.00, 25.00} /* out city */)}, }; } // namespace routing diff --git a/routing_common/routing_common_tests/vehicle_model_test.cpp b/routing_common/routing_common_tests/vehicle_model_test.cpp index 66be591616..c637e01601 100644 --- a/routing_common/routing_common_tests/vehicle_model_test.cpp +++ b/routing_common/routing_common_tests/vehicle_model_test.cpp @@ -274,8 +274,8 @@ UNIT_TEST(VehicleModel_CarModelValidation) HighwayType::HighwayTrack, HighwayType::HighwayTrunk, HighwayType::HighwayTrunkLink, HighwayType::HighwayUnclassified, HighwayType::ManMadePier, HighwayType::RailwayRailMotorVehicle, - HighwayType::RouteFerryMotorcar, HighwayType::RouteFerryMotorVehicle, - HighwayType::RouteShuttleTrain}; + HighwayType::RouteFerry, HighwayType::RouteShuttleTrain, + }; for (auto const hwType : carRoadTypes) { diff --git a/routing_common/vehicle_model.cpp b/routing_common/vehicle_model.cpp index 21b696bb92..56579aadf9 100644 --- a/routing_common/vehicle_model.cpp +++ b/routing_common/vehicle_model.cpp @@ -94,6 +94,11 @@ void VehicleModel::SetAdditionalRoadTypes(Classificator const & c, } } +uint32_t VehicleModel::PrepareToMatchType(uint32_t type) +{ + return ftypes::BaseChecker::PrepareToMatch(type, 2); +} + SpeedKMpH VehicleModel::GetSpeed(FeatureType & f, SpeedParams const & speedParams) const { feature::TypesHolder const types(f); @@ -130,8 +135,7 @@ double VehicleModel::GetMaxWeightSpeed() const optional VehicleModel::GetHighwayType(uint32_t type) const { optional hwType; - type = ftypes::BaseChecker::PrepareToMatch(type, 2); - auto const it = m_roadTypes.find(type); + auto const it = m_roadTypes.find(PrepareToMatchType(type)); if (it != m_roadTypes.cend()) hwType = it->second.GetHighwayType(); @@ -287,8 +291,7 @@ bool VehicleModel::HasPassThroughType(feature::TypesHolder const & types) const { for (uint32_t t : types) { - uint32_t const type = ftypes::BaseChecker::PrepareToMatch(t, 2); - auto it = m_roadTypes.find(type); + auto it = m_roadTypes.find(PrepareToMatchType(t)); if (it != m_roadTypes.end() && it->second.IsPassThroughAllowed()) return true; } @@ -299,7 +302,7 @@ bool VehicleModel::HasPassThroughType(feature::TypesHolder const & types) const bool VehicleModel::IsRoadType(uint32_t type) const { return FindAdditionalRoadType(type) != m_addRoadTypes.cend() || - m_roadTypes.find(ftypes::BaseChecker::PrepareToMatch(type, 2)) != m_roadTypes.end(); + m_roadTypes.find(PrepareToMatchType(type)) != m_roadTypes.end(); } VehicleModelInterface::RoadAvailability VehicleModel::GetRoadAvailability(feature::TypesHolder const & /* types */) const @@ -307,11 +310,11 @@ VehicleModelInterface::RoadAvailability VehicleModel::GetRoadAvailability(featur return RoadAvailability::Unknown; } -vector::const_iterator VehicleModel::FindAdditionalRoadType( - uint32_t type) const +vector::const_iterator +VehicleModel::FindAdditionalRoadType(uint32_t type) const { return find_if(m_addRoadTypes.begin(), m_addRoadTypes.cend(), - [&type](AdditionalRoadType const & t) { return t.m_type == type; }); + [type](AdditionalRoadType const & t) { return t.m_type == type; }); } VehicleModelFactory::VehicleModelFactory( @@ -455,8 +458,6 @@ string DebugPrint(HighwayType type) case HighwayType::HighwaySecondaryLink: return "highway-secondary_link"; case HighwayType::RouteFerry: return "route-ferry"; case HighwayType::HighwayTertiaryLink: return "highway-tertiary_link"; - case HighwayType::RouteFerryMotorcar: return "route-ferry-motorcar"; - case HighwayType::RouteFerryMotorVehicle: return "route-ferry-motor_vehicle"; case HighwayType::RailwayRailMotorVehicle: return "railway-rail-motor_vehicle"; case HighwayType::RouteShuttleTrain: return "route-shuttle_train"; } diff --git a/routing_common/vehicle_model.hpp b/routing_common/vehicle_model.hpp index c37e102e4a..796fee8bf2 100644 --- a/routing_common/vehicle_model.hpp +++ b/routing_common/vehicle_model.hpp @@ -57,8 +57,6 @@ enum class HighwayType : uint32_t HighwaySecondaryLink = 176, RouteFerry = 259, HighwayTertiaryLink = 272, - RouteFerryMotorcar = 988, - RouteFerryMotorVehicle = 993, RailwayRailMotorVehicle = 994, RouteShuttleTrain = 1054, }; @@ -323,6 +321,8 @@ protected: void SetAdditionalRoadTypes(Classificator const & c, std::vector const & additionalTags); + static uint32_t PrepareToMatchType(uint32_t type); + /// \returns true if |types| is a oneway feature. /// \note According to OSM, tag "oneway" could have value "-1". That means it's a oneway feature /// with reversed geometry. In that case at map generation the geometry of such features