From b7fdb5229c2711d690cebd3b4b0fef5a00d42578 Mon Sep 17 00:00:00 2001 From: Viktor Govako Date: Thu, 20 Jan 2022 14:20:26 +0300 Subject: [PATCH] [classifier] Reconsider amenity=recycling with dependent. Signed-off-by: Viktor Govako --- data/categories.txt | 103 +++++++++++------ data/editor.config | 4 +- data/mapcss-mapping.csv | 29 +++-- data/replaced_tags.txt | 21 +++- data/strings/types_strings.txt | 104 ++++++++++++------ data/styles/clear/include/Icons.mapcss | 2 - editor/editor_tests/xml_feature_test.cpp | 9 +- editor/xml_feature.cpp | 7 +- generator/generator_tests/osm_type_test.cpp | 56 +++++++++- indexer/ftypes_matcher.cpp | 10 +- .../search_integration_tests/smoke_test.cpp | 12 +- 11 files changed, 252 insertions(+), 105 deletions(-) diff --git a/data/categories.txt b/data/categories.txt index 8642364b5d..ebeb120409 100644 --- a/data/categories.txt +++ b/data/categories.txt @@ -3910,7 +3910,7 @@ he:במכולה|הפשא sk:Odpadky|kôš fa:زباله دانی -amenity-recycling|@recycling +amenity-recycling-centre|@recycling en:Recycling Centre|U+1F6AE|U+267B en-US:Recycling Center|U+1F6AE|U+267B ru:Приём вторсырья|утиль|сырьё|сбор сырья @@ -3944,7 +3944,7 @@ el:Κέντρο ανακύκλωσης sk:Zberné suroviny fa:مرکز بازیافت -amenity-recycling_container|@recycling +amenity-recycling-container|amenity-recycling|@recycling en:Recycling container|U+1F6AE|U+267B ru:Контейнер для вторсырья bg:Контейнер|разделно|събиране @@ -3978,39 +3978,42 @@ zh-Hans:回收箱 zh-Hant:回收箱 fa:ظرف بازیافت -recycling-toxic|@recycling -en:Toxic waste|Battery disposal|Batteries disposal|Hazardous waste -ru:Ядовитые отходы|Сбор батареек|Утилизация батареек|Опасные отходы -bg:Опасни отпадъци -ar:النفايات الخطرة|البطاريات المستهلكة|نفايات سامة -cs:Toxický odpad|Likvidace baterií|Nebezpečný odpad -da:Giftigt affald|Bortskaffelse af batterier|Farligt affald -nl:Giftig afval|Afvoer van batterijen|Gevaarlijk afval -fi:Myrkkyjäte|Paristojen keräys|Vaaralliset jätteet -fr:Déchets toxiques|Recyclage de piles|Déchets dangereux -de:Giftmüll|Batterierecycling|Gefahrabfälle -hu:Mérgező hulladék|Akkumulátor ártalmatlanítás|Veszélyes hulladék -id:Limbah beracun|Pembuangan baterai|Limbah berbahaya -it:Rifiuti tossici|Riciclo delle batterie|Rifiuti pericolosi -ja:有毒廃棄物|電池廃棄物|危険廃棄物 -ko:위험폐기물|배터리 폐기장|위험물 폐기장|유독성 폐기물|배터리 처|유해성 폐기물 -nb:Giftig avfall|Batterigjenvinning|Farlig avfall -pl:Odpady toksyczne|Utylizacja akumulatorów|Odpady niebezpieczne -pt:Resíduos tóxicos|Reciclagem de pilhas|Resíduos perigosos -pt-BR:Lixo tóxico|Descarte da baterias e pilhas|Lixo perigosos -ro:Deșeuri toxice|Eliminarea bateriilor|Deșeuri periculoase -es:Residuos tóxicos|Eliminación de pilas|Residuos peligrosos -es-MX:Desechos tóxicos|Eliminación de pilas|Desechos peligrosos -sv:Giftigt avfall|Kassering av batterier|Farligt avfall -th:ขยะสารพิษ|การกำจัดแบตเตอรี่|ขยะอันตราย -tr:Zehirli atık|Pil geri dönüşüm|Tehlikeli atık -uk:Отруйні відходи|ЗБір отруйних відходів|Утилізація батарейок|Небезпечні відходи -vi:Chất thải độc hại|Sử dụng pin|Rác thải nguy hiểm -el:Τοξικά απόβλητα|Ανακύκλωση μπαταριών|Επικίνδυνα απόβλητα -sk:Toxický odpad|Likvidácia batérií|Nebezpečný odpad -zh-Hans:有毒垃圾|废弃电池处理|有害垃圾 -zh-Hant:有毒垃圾|廢棄電池處理|有害垃圾 -fa:پسماند خطرناک|بازیافت باتری|پسماند سمی +recycling-batteries|@recycling +en:Batteries disposal +ru:Сбор батареек|Утилизация батареек +ar:ﺕﺎﻳﺭﺎﻄﺑ +be:Батарэйкі +bg:Батерии +cs:Baterie +da:Batterier +de:Batterien +el:Μπαταρίες +es:Baterías +fa:ﺎﻫ ﯼﺮﺗﺎﺑ +fi:Paristot +fr:Batteries +he:תוללוס +hu:Elemek +id:Baterai +it:Batterie +ja:バッテリー +ko:배터리 +nb:Batterier +nl:Batterijen +pl:Baterie +pt:Baterias +pt-BR:Baterias +ro:Baterii +ru:Батарейки +sk:Batérie +sv:Batterier +sw:Betri +th:แบตเตอรี่ +tr:Piller +uk:Батарейки +vi:Ắc quy +zh-Hans:电池 +zh-Hant:電池 recycling-clothes|@recycling en:Clothes Recycling @@ -4250,6 +4253,36 @@ zh-Hans:电子垃圾 zh-Hant:電子垃圾 fa:پسماند الکترونیکی +recycling-cardboard|@recycling +en:Cardboard Recycling +be:Збор кардона +ru:Сбор картона +uk:Збір картону + +recycling-cans|@recycling +en:Cans Recycling|Tin Cans|Tins|Tincans +be:Бляшаныя банкі +ru:Жестяные банки|Консервные банки +uk:Бляшані банки + +recycling-shoes|@recycling +en:Shoes Recycling +be:Абутак|Прыём абутку|Здаць абутак +ru:Обувь|Прием обуви|Сдать обувь +uk:Взуття|Прийом взуття|Здати взуття + +recycling-green_waste|@recycling +en:Organic Waste|Green Waste|Food Waste|Garden Waste +be:Арганічныя адходы|Адходы ежы +ru:Органические отходы|Отходы еды +uk:Органічні відходи | Відходи їжі + +recycling-cartons|@recycling +en:Cartons Recycling +be:Тэтрапак|Перапрацоўка тэтрапака|Утылізацыя тэтрапака +ru:Тетрапак|Переработка тетрапака|Утилизация тетрапака +uk:Тетрапак | Переробка тетрапака | Утилізація тетрапака + amenity-school en:3School|U+1F392|U+1F3EB ru:3Школа diff --git a/data/editor.config b/data/editor.config index a5a4a2646a..9e3902ea62 100644 --- a/data/editor.config +++ b/data/editor.config @@ -304,13 +304,13 @@ - + - + diff --git a/data/mapcss-mapping.csv b/data/mapcss-mapping.csv index 221519775e..eb48935a05 100644 --- a/data/mapcss-mapping.csv +++ b/data/mapcss-mapping.csv @@ -106,7 +106,7 @@ landuse|cemetery;105; sport|soccer;106; boundary|administrative|4;[boundary=administrative][admin_level=4];;name;int_name;107; amenity|cafe;108; -amenity|recycling;[amenity=recycling][recycling_type=centre];;name;int_name;109; +amenity|recycling|container;[amenity=recycling][recycling_type=container];;name;int_name;109; leisure|garden;110; landuse|commercial;111; railway|station;112; @@ -233,8 +233,8 @@ highway|cycleway|tunnel;[highway=cycleway][tunnel?];;name;int_name;232; amenity|parking|permissive;[amenity=parking][access=permissive];;name;int_name;233; boundary|administrative|5;[boundary=administrative][admin_level=5];;name;int_name;234; highway|unclassified|tunnel;[highway=unclassified][tunnel?];;name;int_name;235; -deprecated|deprecated;236;x -deprecated|deprecated;237;x +amenity|recycling|centre;[amenity=recycling][recycling_type=centre];;name;int_name;236; +amenity|recycling;237; highway|residential|tunnel;[highway=residential][tunnel?];;name;int_name;238; aeroway|helipad;239; highway|path|permissive;[highway=path][access=permissive];;name;int_name;240; @@ -1333,15 +1333,20 @@ isoline|step_50;1334; isoline|step_10;1335; isoline|zero;1336; complex_entry;[complex_entry];;name;int_name;1337; -recycling|toxic;[amenity=recycling][recycling:batteries=yes],[amenity=recycling][recycling:fluorescent_tubes=yes];;name;int_name;1338; -recycling|clothes;[amenity=recycling][recycling:clothes=yes];;name;int_name;1339; -recycling|glass_bottles;[amenity=recycling][recycling:glass_bottles=yes];;name;int_name;1340; -recycling|paper;[amenity=recycling][recycling:paper=yes];;name;int_name;1341; -recycling|plastic;[amenity=recycling][recycling:plastic=yes];;name;int_name;1342; -recycling|plastic_bottles;[amenity=recycling][recycling:plastic_bottles=yes];;name;int_name;1343; -recycling|scrap_metal;[amenity=recycling][recycling:scrap_metal=yes];;name;int_name;1344; -recycling|small_appliances;[amenity=recycling][recycling:small_appliances=yes];;name;int_name;1345; -amenity|recycling_container;[amenity=recycling][recycling_type=container],[amenity=recycling][!recycling_type];;name;int_name;1346; +recycling|batteries;[recycling:batteries=yes];;name;int_name;1338; +recycling|clothes;[recycling:clothes=yes];;name;int_name;1339; +recycling|glass_bottles;[recycling:glass_bottles=yes];;name;int_name;1340; +recycling|paper;[recycling:paper=yes];;name;int_name;1341; +recycling|plastic;[recycling:plastic=yes];;name;int_name;1342; +recycling|plastic_bottles;[recycling:plastic_bottles=yes];;name;int_name;1343; +recycling|scrap_metal;[recycling:scrap_metal=yes];;name;int_name;1344; +recycling|small_appliances;[recycling:small_appliances=yes];;name;int_name;1345; +amenity|recycling_container;[amenity=recycling][recycling_type=container],[amenity=recycling][!recycling_type];x;name;int_name;1346;amenity|recycling|container hwtag|onedir_bicycle;1347; shop|video_games;1348; natural|strait;1349; +recycling|cardboard;[recycling:cardboard=yes];;name;int_name;1350; +recycling|cans;[recycling:cans=yes];;name;int_name;1351; +recycling|shoes;[recycling:shoes=yes];;name;int_name;1352; +recycling|green_waste;[recycling:green_waste=yes];;name;int_name;1353; +recycling|cartons;[recycling:cartons=yes];;name;int_name;1354; diff --git a/data/replaced_tags.txt b/data/replaced_tags.txt index d6ff8ec6e4..e887f35c80 100644 --- a/data/replaced_tags.txt +++ b/data/replaced_tags.txt @@ -62,9 +62,22 @@ place=allotments : place=neighbourhood crossing=traffic_signals : highway=traffic_signals +# Replace top tags from here https://taginfo.openstreetmap.org/search?q=recycling on the common ones. +recycling:electrical_appliances=yes : recycling:small_appliances=yes recycling:small_electrical_appliances=yes : recycling:small_appliances=yes -recycling:PET=yes : recycling:plastic_bottles=yes -recycling:plastic_packaging=yes : recycling:plastic=yes -recycling:glass=yes : recycling:glass_bottles=yes -recycling:metal=yes : recycling:scrap_metal=yes +recycling:electrical_items=yes : recycling:small_appliances=yes + +recycling:metal=yes : recycling:scrap_metal=yes recycling:sheet_metal=yes : recycling:scrap_metal=yes +recycling:aluminium=yes : recycling:scrap_metal=yes + +recycling:PET=yes : recycling:plastic_bottles=yes +recycling:plastic_packaging=yes : recycling:plastic=yes +recycling:glass=yes : recycling:glass_bottles=yes +recycling:organic=yes : recycling:green_waste=yes +recycling:garden_waste=yes : recycling:green_waste=yes + +recycling:paper_packaging=yes : recycling:paper=yes +recycling:newspaper=yes : recycling:paper=yes +recycling:magazines=yes : recycling:paper=yes +recycling:beverage_cartons=yes : recycling:cartons=yes diff --git a/data/strings/types_strings.txt b/data/strings/types_strings.txt index 3a365781b6..73e12bd458 100644 --- a/data/strings/types_strings.txt +++ b/data/strings/types_strings.txt @@ -2587,7 +2587,7 @@ zh-Hans = 公共书架 zh-Hant = 書架 - [type.amenity.recycling] + [type.amenity.recycling.centre] en = Recycling Center ar = مركز إعادة تدوير cs = Recyklační středisko @@ -2619,7 +2619,7 @@ zh-Hans = 资源回收设施 zh-Hant = 回收中心 - [type.amenity.recycling_container] + [type.amenity.recycling] en = Recycling Container ar = حاوية لإعادة التدوير cs = Recyklační nádoba @@ -2652,38 +2652,44 @@ zh-Hans = 回收容器 zh-Hant = 回收箱 - [type.recycling.toxic] - en = Toxic Waste - ar = نفايات سامة - cs = Toxický odpad - da = Giftigt affald - de = Giftmüll - el = Τοξικά απόβλητα - es = Residuos tóxicos - es-MX = Desechos tóxicos - fa = پسماند سمی - fi = Myrkkyjäte - fr = Déchets toxiques - hu = Mérgező hulladék - id = Limbah beracun - it = Rifiuti tossici - ja = 有毒廃棄物 - ko = 유독성 폐기물 - nb = Giftig avfall - nl = Giftig afval - pl = Odpady toksyczne - pt = Resíduos tóxicos - pt-BR = Lixo tóxico - ro = Deșeuri toxice - ru = Ядовитые отходы - sk = Toxický odpad - sv = Giftigt avfall - th = ขยะสารพิษ - tr = Zehirli atık - uk = Отруйні відходи - vi = Chất thải độc hại - zh-Hans = 有毒垃圾 - zh-Hant = 有毒垃圾 + [type.amenity.recycling.container] + ref = type.amenity.recycling + + [type.recycling.batteries] + en = Batteries + ar = ﺕﺎﻳﺭﺎﻄﺑ + be = Батарэйкі + bg = Батерии + cs = Baterie + da = Batterier + de = Batterien + el = Μπαταρίες + es = Baterías + fa = ﺎﻫ ﯼﺮﺗﺎﺑ + fi = Paristot + fr = Batteries + he = תוללוס + hu = Elemek + id = Baterai + it = Batterie + ja = バッテリー + ko = 배터리 + nb = Batterier + nl = Batterijen + pl = Baterie + pt = Baterias + pt-BR = Baterias + ro = Baterii + ru = Батарейки + sk = Batérie + sv = Batterier + sw = Betri + th = แบตเตอรี่ + tr = Piller + uk = Батарейки + vi = Ắc quy + zh-Hans = 电池 + zh-Hant = 電池 [type.recycling.clothes] en = Old Clothes @@ -2916,6 +2922,36 @@ zh-Hans = 电子垃圾 zh-Hant = 電子垃圾 + [type.recycling.cardboard] + en = Cardboard + be = Кардон + ru = Картон + uk = Картон + + [type.recycling.cans] + en = Cans + be = Бляшаныя банкі + ru = Жестяные банки + uk = Бляшані банки + + [type.recycling.shoes] + en = Shoes + be = Абутак + ru = Обувь + uk = Взуття + + [type.recycling.green_waste] + en = Green/Organic Waste + be = Арганічныя адходы + ru = Органические отходы + uk = Органічні відходи + + [type.recycling.cartons] + en = Cartons + be = Тэтрапак і аналагі + ru = Тетрапак и аналоги + uk = Тетрапак та аналоги + [type.amenity.restaurant] en = Restaurant ar = مطعم diff --git a/data/styles/clear/include/Icons.mapcss b/data/styles/clear/include/Icons.mapcss index c8d289ddab..bc586a9f58 100644 --- a/data/styles/clear/include/Icons.mapcss +++ b/data/styles/clear/include/Icons.mapcss @@ -103,7 +103,6 @@ node[amenity=telephone], node[emergency=phone], node[amenity=bench], node[amenity=recycling], -node[amenity=recycling_container], area[amenity=recycling], node[amenity=vending_machine], area[amenity=vending_machine], @@ -1949,7 +1948,6 @@ node|z17-[emergency=phone] {icon-image: phone-m.svg;icon-min-distance: 30;} node|z17-[amenity=recycling], -node|z17-[amenity=recycling_container], area|z17-[amenity=recycling] {icon-image: recycling-m.svg;icon-min-distance: 30;} diff --git a/editor/editor_tests/xml_feature_test.cpp b/editor/editor_tests/xml_feature_test.cpp index 553a81034a..2300f09ad8 100644 --- a/editor/editor_tests/xml_feature_test.cpp +++ b/editor/editor_tests/xml_feature_test.cpp @@ -403,7 +403,7 @@ UNIT_TEST(XMLFeature_AmenityRecyclingFromAndToXml) auto const th = emo.GetTypes(); TEST_EQUAL(th.Size(), 1, ()); - TEST_EQUAL(*th.begin(), classif().GetTypeByPath({"amenity", "recycling"}), ()); + TEST_EQUAL(*th.begin(), classif().GetTypeByPath({"amenity", "recycling", "centre"}), ()); auto convertedFt = editor::ToXML(emo, true); convertedFt.SetAttribute("timestamp", kTimestamp); @@ -426,12 +426,13 @@ UNIT_TEST(XMLFeature_AmenityRecyclingFromAndToXml) auto const th = emo.GetTypes(); TEST_EQUAL(th.Size(), 1, ()); - TEST_EQUAL(*th.begin(), classif().GetTypeByPath({"amenity", "recycling_container"}), ()); + TEST_EQUAL(*th.begin(), classif().GetTypeByPath({"amenity", "recycling", "container"}), ()); auto convertedFt = editor::ToXML(emo, true); convertedFt.SetAttribute("timestamp", kTimestamp); TEST_EQUAL(xmlFeature, convertedFt, ()); } + /* { std::string const recyclingStr = R"( @@ -446,8 +447,7 @@ UNIT_TEST(XMLFeature_AmenityRecyclingFromAndToXml) auto const th = emo.GetTypes(); TEST_EQUAL(th.Size(), 1, ()); - // We construct recycling container by default if no recycling type is specified. - TEST_EQUAL(*th.begin(), classif().GetTypeByPath({"amenity", "recycling_container"}), ()); + TEST_EQUAL(*th.begin(), classif().GetTypeByPath({"amenity", "recycling"}), ()); auto convertedFt = editor::ToXML(emo, true); @@ -458,4 +458,5 @@ UNIT_TEST(XMLFeature_AmenityRecyclingFromAndToXml) TEST(convertedFt.HasTag("amenity"), ()); TEST_EQUAL(convertedFt.GetTagValue("amenity"), "recycling", ()); } + */ } diff --git a/editor/xml_feature.cpp b/editor/xml_feature.cpp index 8c1b26d075..586b541be8 100644 --- a/editor/xml_feature.cpp +++ b/editor/xml_feature.cpp @@ -566,11 +566,12 @@ bool FromXML(XMLFeature const & xml, osm::EditableMapObject & object) return; uint32_t type = 0; - if (k == "amenity" && v == "recycling") + if (k == "amenity" && v == "recycling" && xml.HasTag("recycling_type")) { - if (xml.HasTag("recycling_type") && xml.GetTagValue("recycling_type") == "centre") + auto const typeValue = xml.GetTagValue("recycling_type"); + if (typeValue == "centre") type = ftypes::IsRecyclingCentreChecker::Instance().GetType(); - else + else if (typeValue == "container") type = ftypes::IsRecyclingContainerChecker::Instance().GetType(); } diff --git a/generator/generator_tests/osm_type_test.cpp b/generator/generator_tests/osm_type_test.cpp index 8c6ef2121a..1135229fcd 100644 --- a/generator/generator_tests/osm_type_test.cpp +++ b/generator/generator_tests/osm_type_test.cpp @@ -1297,6 +1297,56 @@ UNIT_CLASS_TEST(TestWithClassificator, OsmType_Junctions) } } +UNIT_CLASS_TEST(TestWithClassificator, OsmType_Recycling) +{ + { + Tags const tags = { + {"amenity", "recycling" }, + {"recycling:glass_bottles", "yes"}, + {"recycling:green_waste", "yes"}, + }; + + auto const params = GetFeatureBuilderParams(tags); + + TEST_EQUAL(params.m_types.size(), 3, (params)); + TEST(params.IsTypeExist(GetType({"amenity", "recycling"})), (params)); + TEST(params.IsTypeExist(GetType({"recycling", "glass_bottles"})), (params)); + TEST(params.IsTypeExist(GetType({"recycling", "green_waste"})), (params)); + } + + { + Tags const tags = { + {"amenity", "recycling" }, + {"recycling_type", "centre"}, + {"recycling:garden_waste", "no"}, + {"recycling:organic", "no"}, + {"recycling:glass", "yes"}, + }; + + auto const params = GetFeatureBuilderParams(tags); + + TEST_EQUAL(params.m_types.size(), 2, (params)); + TEST(params.IsTypeExist(GetType({"amenity", "recycling", "centre"})), (params)); + TEST(params.IsTypeExist(GetType({"recycling", "glass_bottles"})), (params)); + } + + { + Tags const tags = { + {"amenity", "recycling" }, + {"recycling_type", "container"}, + {"recycling:metal", "yes"}, + {"recycling:batteries", "yes"}, + }; + + auto const params = GetFeatureBuilderParams(tags); + + TEST_EQUAL(params.m_types.size(), 3, (params)); + TEST(params.IsTypeExist(GetType({"amenity", "recycling", "container"})), (params)); + TEST(params.IsTypeExist(GetType({"recycling", "scrap_metal"})), (params)); + TEST(params.IsTypeExist(GetType({"recycling", "batteries"})), (params)); + } +} + UNIT_CLASS_TEST(TestWithClassificator, OsmType_SimpleTypesSmoke) { Tags const oneTypes = { @@ -1945,9 +1995,9 @@ UNIT_CLASS_TEST(TestWithClassificator, OsmType_ComplexTypesSmoke) {{"amenity", "place_of_worship", "muslim"}, {{"amenity", "place_of_worship"}, {"religion", "muslim"}}}, {{"amenity", "place_of_worship", "shinto"}, {{"amenity", "place_of_worship"}, {"religion", "shinto"}}}, {{"amenity", "place_of_worship", "taoist"}, {{"amenity", "place_of_worship"}, {"religion", "taoist"}}}, - {{"amenity", "recycling"}, {{"amenity", "recycling"}, {"recycling_type","centre"}}}, - {{"amenity", "recycling_container"}, {{"amenity", "recycling"}, {"recycling_type","container"}}}, - {{"amenity", "recycling_container"}, {{"amenity", "recycling"}}}, + {{"amenity", "recycling", "centre"}, {{"amenity", "recycling"}, {"recycling_type","centre"}}}, + {{"amenity", "recycling", "container"}, {{"amenity", "recycling"}, {"recycling_type","container"}}}, + {{"amenity", "recycling"}, {{"amenity", "recycling"}}}, {{"amenity", "vending_machine", "cigarettes"}, {{"amenity", "vending_machine"}, {"vending", "cigarettes"}}}, {{"amenity", "vending_machine", "drinks"}, {{"amenity", "vending_machine"}, {"vending", "drinks"}}}, {{"amenity", "vending_machine", "parking_tickets"}, {{"amenity", "vending_machine"}, {"vending", "parking_tickets"}}}, diff --git a/indexer/ftypes_matcher.cpp b/indexer/ftypes_matcher.cpp index 4b892f176c..708c1e204f 100644 --- a/indexer/ftypes_matcher.cpp +++ b/indexer/ftypes_matcher.cpp @@ -244,18 +244,20 @@ IsBicycleRentalChecker::IsBicycleRentalChecker() m_types.push_back(c.GetTypeByPath({"amenity", "bicycle_rental"})); } -IsRecyclingCentreChecker::IsRecyclingCentreChecker() +IsRecyclingCentreChecker::IsRecyclingCentreChecker() : BaseChecker(3 /* level */) { Classificator const & c = classif(); - m_types.push_back(c.GetTypeByPath({"amenity", "recycling"})); + m_types.push_back(c.GetTypeByPath({"amenity", "recycling", "centre"})); } uint32_t IsRecyclingCentreChecker::GetType() const { return m_types[0]; } -IsRecyclingContainerChecker::IsRecyclingContainerChecker() +IsRecyclingContainerChecker::IsRecyclingContainerChecker() : BaseChecker(3 /* level */) { Classificator const & c = classif(); - m_types.push_back(c.GetTypeByPath({"amenity", "recycling_container"})); + m_types.push_back(c.GetTypeByPath({"amenity", "recycling", "container"})); + // Treat default type also as a container, see https://taginfo.openstreetmap.org/keys/recycling_type#values + m_types.push_back(c.GetTypeByPath({"amenity", "recycling"})); } uint32_t IsRecyclingContainerChecker::GetType() const { return m_types[0]; } diff --git a/search/search_integration_tests/smoke_test.cpp b/search/search_integration_tests/smoke_test.cpp index 11743e8f90..ea353ace44 100644 --- a/search/search_integration_tests/smoke_test.cpp +++ b/search/search_integration_tests/smoke_test.cpp @@ -218,7 +218,15 @@ UNIT_CLASS_TEST(SmokeTest, CategoriesTest) string const countryName = "Wonderland"; TestPOI poi(m2::PointD(1.0, 1.0), "poi", "en"); - poi.SetTypes({strings::Tokenize(classif().GetFullObjectName(type), "|")}); + + auto typeTokens = strings::Tokenize(classif().GetFullObjectName(type), "|"); + if (ftypes::IsRecyclingTypeChecker::Instance()(type)) + { + // recycling=XXX types are not drawable/visible alone. + poi.SetTypes({{"amenity", "recycling", "container"}, std::move(typeTokens)}); + } + else + poi.SetTypes({std::move(typeTokens)}); auto id = BuildMwm(countryName, DataHeader::MapType::Country, [&](TestMwmBuilder & builder) { builder.Add(poi); }); @@ -227,7 +235,7 @@ UNIT_CLASS_TEST(SmokeTest, CategoriesTest) { Rules rules = {ExactMatch(id, poi)}; auto const query = holder.GetReadableFeatureType(type, CategoriesHolder::kEnglishCode) + " "; - TEST(ResultsMatch(query, categoryIsSearchable ? rules : Rules{}), ()); + TEST(ResultsMatch(query, categoryIsSearchable ? rules : Rules{}), (query)); } DeregisterMap(countryName); };