diff --git a/data/brands/amenity/bar.json b/data/brands/amenity/bar.json index 140d226e1f4..b2b5defea0c 100644 --- a/data/brands/amenity/bar.json +++ b/data/brands/amenity/bar.json @@ -2,6 +2,7 @@ "properties": { "path": "brands/amenity/bar", "skipCollection": true, + "preserveTags": ["^name"], "exclude": { "generic": ["^(pool|snack)?\\s?bar$"], "named": ["^уют$"] diff --git a/data/brands/amenity/cinema.json b/data/brands/amenity/cinema.json index 4fd6ff5a733..d7cf0610698 100644 --- a/data/brands/amenity/cinema.json +++ b/data/brands/amenity/cinema.json @@ -1,6 +1,7 @@ { "properties": { "path": "brands/amenity/cinema", + "preserveTags": ["^name"], "exclude": { "generic": ["^cine(ma)?$"], "named": ["^октябрь$"] diff --git a/data/brands/amenity/fuel.json b/data/brands/amenity/fuel.json index 4441fa9d322..16344c55874 100644 --- a/data/brands/amenity/fuel.json +++ b/data/brands/amenity/fuel.json @@ -1,6 +1,7 @@ { "properties": { "path": "brands/amenity/fuel", + "preserveTags": ["^name"], "exclude": { "generic": [ "^((drummed|independent|جایگاه) )?(cng|filling|fuel|gas|gpl|gnv|lpg|petrol)( (station|pump))?$", diff --git a/data/brands/amenity/pharmacy.json b/data/brands/amenity/pharmacy.json index 3717a8ba00e..fa5b9ddc0fd 100644 --- a/data/brands/amenity/pharmacy.json +++ b/data/brands/amenity/pharmacy.json @@ -4,9 +4,8 @@ "exclude": { "generic": [ "^(alte )?apotheke( am markt)?$", + "^(apotek(a|et)|apteka?)$", "^(centro naturista|eczane|botica|gyógyszertár|lékárna|ljekarna|parafarmacia)$", - "^apotek(a|et)$", - "^aptek(a)?$", "^droguer[ií]a$", "^farm[aàá]ci[aàáe]?$", "^pharmac(ie|y)$", diff --git a/data/brands/amenity/pub.json b/data/brands/amenity/pub.json index 45f77d819b2..b4e70d45ec0 100644 --- a/data/brands/amenity/pub.json +++ b/data/brands/amenity/pub.json @@ -1,6 +1,7 @@ { "properties": { "path": "brands/amenity/pub", + "preserveTags": ["^name"], "exclude": { "generic": [ "^(bar|bistro|pub)$", diff --git a/data/brands/amenity/social_centre.json b/data/brands/amenity/social_centre.json index 2abca4fdb8e..67cba78d414 100644 --- a/data/brands/amenity/social_centre.json +++ b/data/brands/amenity/social_centre.json @@ -1,6 +1,7 @@ { "properties": { "path": "brands/amenity/social_centre", + "preserveTags": ["^name"], "exclude": {"generic": ["^social centre$"]} }, "items": [ diff --git a/data/brands/amenity/vending_machine.json b/data/brands/amenity/vending_machine.json index 0514c403caa..6bea878e27c 100644 --- a/data/brands/amenity/vending_machine.json +++ b/data/brands/amenity/vending_machine.json @@ -43,6 +43,7 @@ "amazon ロッカー", "アマゾン・ハブ・ロッカー" ], + "preserveTags": ["^name"], "tags": { "amenity": "vending_machine", "brand": "Amazon Hub ロッカー", @@ -62,6 +63,7 @@ "locationSet": { "include": ["de", "gb", "us"] }, + "preserveTags": ["^name"], "tags": { "amenity": "vending_machine", "brand": "Amazon Locker", diff --git a/data/brands/landuse/residential.json b/data/brands/landuse/residential.json index 6720dd58eff..66b4b89335d 100644 --- a/data/brands/landuse/residential.json +++ b/data/brands/landuse/residential.json @@ -1,6 +1,7 @@ { "properties": { "path": "brands/landuse/residential", + "preserveTags": ["^name"], "exclude": {"generic": ["^residential$"]} }, "items": [ diff --git a/data/brands/office/insurance.json b/data/brands/office/insurance.json index 9b870f029c3..5dfe7adfd40 100644 --- a/data/brands/office/insurance.json +++ b/data/brands/office/insurance.json @@ -1,6 +1,7 @@ { "properties": { "path": "brands/office/insurance", + "preserveTags": ["^name"], "exclude": {"generic": ["^insurance$"]} }, "items": [ diff --git a/data/brands/shop/car.json b/data/brands/shop/car.json index c8ac20ae692..c4da432c513 100644 --- a/data/brands/shop/car.json +++ b/data/brands/shop/car.json @@ -1,6 +1,7 @@ { "properties": { "path": "brands/shop/car", + "preserveTags": ["^name"], "exclude": { "generic": [ "^(car|mécanique)$", diff --git a/data/brands/shop/car_repair.json b/data/brands/shop/car_repair.json index 8b31550af1a..68a48221c52 100644 --- a/data/brands/shop/car_repair.json +++ b/data/brands/shop/car_repair.json @@ -1,6 +1,7 @@ { "properties": { "path": "brands/shop/car_repair", + "preserveTags": ["^name"], "exclude": { "generic": [ "^(auto serwis|car repair)$", diff --git a/data/brands/shop/electronics.json b/data/brands/shop/electronics.json index 2f1aa392e52..dd12a0a4ea6 100644 --- a/data/brands/shop/electronics.json +++ b/data/brands/shop/electronics.json @@ -48,6 +48,7 @@ "displayName": "Apple Store", "id": "applestore-9377b7", "locationSet": {"include": ["001"]}, + "preserveTags": ["^name"], "tags": { "brand": "Apple Store", "brand:wikidata": "Q421253", diff --git a/data/brands/shop/motorcycle.json b/data/brands/shop/motorcycle.json index e6ec97f8c10..a28083099f2 100644 --- a/data/brands/shop/motorcycle.json +++ b/data/brands/shop/motorcycle.json @@ -1,6 +1,7 @@ { "properties": { "path": "brands/shop/motorcycle", + "preserveTags": ["^name"], "exclude": { "generic": ["^motorcycle$"], "named": ["^independent$"] diff --git a/data/brands/tourism/hotel.json b/data/brands/tourism/hotel.json index 1d51c33fa29..be988a866dd 100644 --- a/data/brands/tourism/hotel.json +++ b/data/brands/tourism/hotel.json @@ -8,9 +8,9 @@ "^гостиница$" ], "named": [ - "^(h(o|ô)tel\\s)?((zur\\s)?post|de france|de la gare|строитель)$", - "^(h(o|ô)tel\\s)?(astoria|belvedere|central|city|colonial|continental|europa)\\s?(h(o|ô)tel)?$", - "^(h(o|ô)tel\\s)?(grand|imperial|krone|palace|panorama|park|plaza|royal|victoria)\\s?(h(o|ô)tel)?$", + "^(h[oô]tel )?((zur )?post|de france|de la gare|строитель)$", + "^(h[oô]tel )?(astoria|belvedere|central|city|colonial|continental|europa)\\s?(h[oô]tel)?$", + "^(h[oô]tel )?(grand|imperial|krone|palace|panorama|park|plaza|royal|victoria)\\s?(h[oô]tel)?$", "^budget inn$" ] } diff --git a/data/flags/man_made/flagpole.json b/data/flags/man_made/flagpole.json index 0c5fc1c2496..d98c6079c0b 100644 --- a/data/flags/man_made/flagpole.json +++ b/data/flags/man_made/flagpole.json @@ -1,6 +1,7 @@ { "properties": { "path": "flags/man_made/flagpole", + "preserveTags": ["^flag:name"], "exclude": {"generic": ["^flagpole$"]} }, "items": [ diff --git a/data/operators/amenity/hospital.json b/data/operators/amenity/hospital.json index 1be33e143e3..a55023c1ad0 100644 --- a/data/operators/amenity/hospital.json +++ b/data/operators/amenity/hospital.json @@ -1,6 +1,7 @@ { "properties": { "path": "operators/amenity/hospital", + "preserveTags": ["^emergency$", "^name"], "exclude": { "generic": [ "^(govern?ment( authorities)?|govt( hospital)?|municipal|private|public|private not for profit|village)$", diff --git a/data/operators/amenity/parking.json b/data/operators/amenity/parking.json index 966a8b76eb7..6a05e8b85cf 100644 --- a/data/operators/amenity/parking.json +++ b/data/operators/amenity/parking.json @@ -2,6 +2,7 @@ "properties": { "path": "operators/amenity/parking", "skipCollection": true, + "preserveTags": ["^name"], "exclude": { "generic": [ "^parking( lot)?$", diff --git a/data/operators/amenity/post_depot.json b/data/operators/amenity/post_depot.json index 759fe30665f..d90bcca92e0 100644 --- a/data/operators/amenity/post_depot.json +++ b/data/operators/amenity/post_depot.json @@ -1,6 +1,7 @@ { "properties": { "path": "operators/amenity/post_depot", + "preserveTags": ["^name"], "exclude": {"generic": ["^post depot$"]} }, "items": [ diff --git a/data/operators/amenity/post_office.json b/data/operators/amenity/post_office.json index a12a20d8495..5a5d80bd4da 100644 --- a/data/operators/amenity/post_office.json +++ b/data/operators/amenity/post_office.json @@ -1,6 +1,7 @@ { "properties": { "path": "operators/amenity/post_office", + "preserveTags": ["^name"], "exclude": { "generic": [ "^(agencja pocztowa|ufficio postale|urząd pocztowy)$", diff --git a/dist/index.js b/dist/index.js index 74020d50ad1..9b07ccdf023 100644 --- a/dist/index.js +++ b/dist/index.js @@ -345,7 +345,7 @@ matchGroups: matchGroups }; - var trees = {brands:{emoji:"🍔",mainTag:"brand:wikidata",nameTags:{primary:["^(name|name:\\w+)$"],alternate:["^(brand|brand:\\w+|operator|operator:\\w+|\\w+_name|\\w+_name:\\w+)$"]},keepKV:["^amenity/bank$","^amenity/bicycle_rental$","^amenity/bureau_de_change$","^amenity/cafe$","^amenity/car_rental$","^amenity/cinema$","^amenity/dentist$","^amenity/fast_food$","^amenity/fuel$","^amenity/ice_cream$","^amenity/money_transfer$","^amenity/payment_(centre|terminal)$","^amenity/pharmacy$","^amenity/public_bookcase$","^amenity/restaurant$","^amenity/social_(centre|facility)$","^amenity/vending_machine$","^amenity/veterinary$","^healthcare/audiologist$","^healthcare/blood_donation$","^healthcare/counselling$","^healthcare/laboratory$","^healthcare/physiotherapist$","^leisure/adult_gaming_centre$","^leisure/amusement_arcade$","^leisure/bowling_alley$","^leisure/escape_game$","^leisure/fitness_centre$","^office/accountant$","^office/employment_agency$","^office/estate_agent$","^office/financial(_advisor)?$","^office/insurance$","^office/tax_advisor$","^office/telecommunication$","^shop/(?!(yes|no|banner_shop|gas|convenience;gas|lottery|mall|vacant))","^tourism/(h|m)otel$"],discardKVN:["^amenity/bank\\|(atm|bank spółdzielczy|lbs|pko)$","^amenity/bank\\|(bank zachodni|bz) wbk$","^amenity/bank\\|(landesbau|bau|kreis|stadt)?sparkasse.*$","^amenity/bank\\|volks- und raiffeisenbank$","^amenity/bank\\|volksbank$","^amenity/bank\\|volksbank( |-)raiffeisenbank$","^amenity/bank\\|vr( |-)bank$","^amenity/bicycle_rental\\|nextbike( gmbh)?$","^amenity/bar\\|уют$","^amenity/cafe\\|((eiscaf(e|é)\\s)?(dolomiti|venezia)|kiosque(\\sà)?\\scafé|caf(e|é)\\sexpress|встреча|рандеву|чайхана|жемчужина|виктория|бер(е|ё)зка|лакомка|мечта|оазис|парус|сказка||||||)$","^amenity/cinema\\|октябрь$","^amenity/dentist\\|дантист$","^amenity/fast_food\\|(ali\\sbaba|antalya|asia(\\s|-)(bistro|imbiss|wok)|(berlin|city)\\sdöner|city\\s(grill|pizza)|kebabai|kfc/taco\\sbell)$","^amenity/fast_food\\|(marmaris|pizza\\s(house|time))$","^amenity/fuel\\|independent|gnv|gpl|posto|spbu|جایگاه\\scng$","^amenity/ice_cream\\|gelateria|venezia$","^amenity/pharmacy\\|(adler|bahnhof|brunnen|burg|bären|einhorn|engel|hirsch|hubertus|kur|linden|löwen)(-| )?apotheke$","^amenity/pharmacy\\|(centrum|farm(a|á)cia\\s(central(e)?|comunale))$","^amenity/pharmacy\\|(marien|markt|mohren|neue|park|rathaus|rats|rosen|schloss|sonnen|stadt|stern)(-| )?apotheke$","^amenity/pharmacy\\|(айболит|арніка|фармация|фармація)$","^amenity/pharmacy\\|pharmacie\\s(centrale|comunale|de\\s(l'hôtel\\sde\\sville|la\\s(gare|mairie|poste))|du\\s(centre|marché|parc))$","^amenity/restaurant\\|((gasthaus|gasthof|schwarzer)?\\s?(adler|löwen))$","^amenity/restaurant\\|(ali\\sbaba|adria|akropolis|amici|aroma|asia|athen|athos|bahnhof|bamboo|bären|bella\\s(vista|napoli))","^amenity/restaurant\\|(belvedere|brasserie|canteen|cantina|capri|carpe\\sdiem|casa\\s?(blanca|mia)|casino)","^amenity/restaurant\\|(china\\s(buffet|city|garden|house|king|palace|star|town|wok)|(da|la|las|el)\\s)","^amenity/restaurant\\|(delphi|deutsches\\shaus|dhaba|dionysos|dolce\\svita|dorfkrug|europa|frohsinn)","^amenity/restaurant\\|(golden\\sdragon|great\\swall)$","^amenity/restaurant\\|(grüner\\sbaum|hellas|hirsch(en)?|hong\\skong|happy garden)","^amenity/restaurant\\|(indian\\spalace|ichiban|il\\sgiardino|italia|jade\\sgarden|jägerhof)","^amenity/restaurant\\|(kirchenwirt|koliba|kreta|kreuz|krone|lamm|le\\s(bistrot|patio))","^amenity/restaurant\\|(l'escale|lemongrass|linde|lindenhof|little\\s(italy|india)|los\\s(amigos|arcos))","^amenity/restaurant\\|(lotus|löwen|maharaja|mamma\\smia|mandarin|marco\\spolo|marmaris|mediterraneo|mensa|milano|mykonos|mythos)","^amenity/restaurant\\|(namaste|napoli|new\\schina|oasis|ochsen|olympia|osaka|paradise|parrilla|peking|pho|pinocchio)","^amenity/restaurant\\|(pizza\\shouse|pizz(a|e)ria|pizza\\sking|pomodoro|portofino|poseidon|ratskeller|rhodos|ristorante\\s)","^amenity/restaurant\\|(roma|rose|rössl[ei]|saffron|saigon|sakura|san\\smarco|santorini|schützenhaus|shalimar|shanghai|sonne|sphinx)","^amenity/restaurant\\|(sportheim|sternen|syrtaki|taj\\smahal|taste\\sof\\sindia|the\\skitchen|toscana|tokyo|traube)","^amenity/restaurant\\|(venezia|waldschänke|wok|zorbas|(zum|zur)\\s)","^amenity/restaurant\\|don camillo","^amenity/restaurant\\|永和豆漿$","^amenity/social_facility\\|dom pomocy społecznej$","^amenity/social_facility\\|maison de retraite$","^amenity/social_facility\\|safe haven$","^amenity/vending_machine\\|(schlauchomat|tobaccoland)$","^shop/(convenience|kiosk)\\|(777|bp|esso|exxon|independent|mobil|shell)$","^shop/bakery\\|(backshop|schneider|schäfer|каравай)$","^shop/bakery\\|(bäckerei\\s)?müller","^shop/clothes\\|трикотаж$","^shop/convenience\\|(24 часа|августина|альянс|апельсин|ассорти|бер(е|ё)зка|бриз|валентина|весна|визит|ветеран|водолей|гастроном|гермес|гурман|диана|добрый|дружба|домашний|елена)$","^shop/convenience\\|(almac[eé]n|despensa)$","^shop/convenience\\|(boutique d'alimentation|sup[eé]rette)$","^shop/convenience\\|(milk bar|юлия)$","^shop/convenience\\|(калинка|каштан|квартал|колобок|колос(ок)?|каравай|кооператор|корзинка|кулинария|лакомка|ласточка|лидер|луч|любава|любимый|людмила|люкс)$","^shop/convenience\\|(меркурий|мечта|мини маркет|мираж|белорусские продукты|продукты 24|натали|надежда|ника)$","^shop/convenience\\|(оазис|околица|олимп|парус|пеликан|престиж|подсолнух|радуга|росинка|ромашка|родник|рассвет|русь)$","^shop/convenience\\|(сельпо|семейный|сказка|солнышко|спутник|солнечный|светлана|удача|ивушка)$","^shop/convenience\\|(юбилейный|южный|эконом|шанс|чайка|центральный|хороший|хуторок|фаворит|фортуна|татьяна|тройка|эдем|уют)$","^shop/copyshop\\|xerox$","^shop/cosmetics\\|(vente de )?cosm[eé]tiques?$","^shop/fishing\\|рыболов$","^shop/florist\\|(мир цветов|орхидея)$","^shop/frame\\|rumah\\spenduduk$","^shop/hairdresser\\|(figaro|haarwerk|стиль|локон|шарм|fodrászat)$","^shop/hardware\\|(всё для дома|1000 мелочей|хозяюшка)$","^shop/jewelry\\|(585|jubiler)$","^shop/money_transfer|mobil(e)?\\smoney$","^shop/motorcycle\\|independent$","^shop/optician\\|(die brille|vision plus|оптика|[oó]ptica)$","^shop/supermarket\\|(famiglia cooperativa|семейный)$","^shop/tailor\\|couture\\s?(dame|homme|mixte)?$","^tourism/(h|m)otel\\|budget inn$","^tourism/hotel\\|(h(o|ô)tel\\s)?((zur\\s)?post|de france|de la gare|строитель)$","^tourism/hotel\\|(h(o|ô)tel\\s)?(astoria|belvedere|central|city|continental|europa)\\s?(h(o|ô)tel)?$","^tourism/hotel\\|(h(o|ô)tel\\s)?(grand|imperial|krone|palace|panorama|park|plaza|royal|victoria)\\s?(h(o|ô)tel)?$"]},flags:{emoji:"🚩",mainTag:"flag:wikidata",nameTags:{primary:["^(flag:name|flag:name:\\w+)$"],alternate:["^(country|country:\\w+|flag|flag:\\w+|subject|subject:\\w+)$"]},keepKV:["^man_made/flagpole$"],discardKVN:[]},operators:{emoji:"💼",mainTag:"operator:wikidata",nameTags:{primary:["^(name|name:\\w+|operator|operator:\\w+)$"],alternate:["^(brand|brand:\\w+|\\w+_name|\\w+_name:\\w+)$"]},discardKVN:["^amenity/clinic\\|(consultorio|municipal|private(_profit)?|priv(e|é){0,2}|public)$","^amenity/hospital\\|(govern?ment( authorities)?|govt( hospital)?|municipal|private|public|private not for profit|village)$","^amenity/hospital\\|(центральна районна лікарня|црб)$","^amenity/hospital\\|(центральная районная )?больница$","^amenity/post_office\\|(costcutter|londis|mccoll'?s|one stop|premier( stores)?|whsmith)$","^amenity/post_office\\|(co-?op( food)?|(the )?co-?operative( food)?)$"],keepKV:["^amenity/car_sharing$","^amenity/charging_station$","^amenity/clinic$","^amenity/fire_station$","^amenity/hospital$","^amenity/police$","^amenity/post_(depot|office)$","^emergency/ambulance_station$","^emergency/lifeboat_station$","^emergency/phone$"]},transit:{emoji:"🚇",mainTag:"network:wikidata",nameTags:{primary:["^network$"],alternate:["^(operator|operator:\\w+|network:\\w+|\\w+_name|\\w+_name:\\w+)$"]},keepKV:["^route/(aerialway|bus|light_rail|subway|train|tram|trolleybus|walking_bus)$"],discardKVN:["\\|[ilnr][chimsw][nm]$","\\|city$","\\|international$","\\|local$","\\|mtb$","\\|municipal$","\\|national$","\\|rail$","\\|regional$","\\|urban$"]}}; + var trees = {brands:{emoji:"🍔",mainTag:"brand:wikidata",nameTags:{primary:["^(name|name:\\w+)$"],alternate:["^(brand|brand:\\w+|operator|operator:\\w+|\\w+_name|\\w+_name:\\w+)$"]},keepKV:["^amenity/bank$","^amenity/bicycle_rental$","^amenity/bureau_de_change$","^amenity/cafe$","^amenity/car_rental$","^amenity/cinema$","^amenity/dentist$","^amenity/fast_food$","^amenity/fuel$","^amenity/ice_cream$","^amenity/money_transfer$","^amenity/payment_(centre|terminal)$","^amenity/pharmacy$","^amenity/public_bookcase$","^amenity/restaurant$","^amenity/social_(centre|facility)$","^amenity/vending_machine$","^amenity/veterinary$","^healthcare/audiologist$","^healthcare/blood_donation$","^healthcare/counselling$","^healthcare/laboratory$","^healthcare/physiotherapist$","^leisure/adult_gaming_centre$","^leisure/amusement_arcade$","^leisure/bowling_alley$","^leisure/escape_game$","^leisure/fitness_centre$","^office/accountant$","^office/employment_agency$","^office/estate_agent$","^office/financial(_advisor)?$","^office/insurance$","^office/tax_advisor$","^office/telecommunication$","^shop/(?!(yes|no|banner_shop|gas|convenience;gas|lottery|mall|vacant))","^tourism/(h|m)otel$"],discardKVN:["^amenity/bank\\|(atm|bank spółdzielczy|lbs|pko)$","^amenity/bank\\|(bank zachodni|bz) wbk$","^amenity/bank\\|(landesbau|bau|kreis|stadt)?sparkasse.*$","^amenity/bank\\|volks- und raiffeisenbank$","^amenity/bank\\|volksbank$","^amenity/bank\\|volksbank( |-)raiffeisenbank$","^amenity/bank\\|vr( |-)bank$","^amenity/bicycle_rental\\|nextbike( gmbh)?$","^amenity/bar\\|уют$","^amenity/cafe\\|((eiscaf(e|é)\\s)?(dolomiti|venezia)|kiosque(\\sà)?\\scafé|caf(e|é)\\sexpress|встреча|рандеву|чайхана|жемчужина|виктория|бер(е|ё)зка|лакомка|мечта|оазис|парус|сказка||||||)$","^amenity/cinema\\|октябрь$","^amenity/dentist\\|дантист$","^amenity/fast_food\\|(ali\\sbaba|antalya|asia(\\s|-)(bistro|imbiss|wok)|(berlin|city)\\sdöner|city\\s(grill|pizza)|kebabai|kfc/taco\\sbell)$","^amenity/fast_food\\|(marmaris|pizza\\s(house|time))$","^amenity/fuel\\|independent|gnv|gpl|posto|spbu|جایگاه\\scng$","^amenity/ice_cream\\|gelateria|venezia$","^amenity/pharmacy\\|(adler|bahnhof|brunnen|burg|bären|einhorn|engel|hirsch|hubertus|kur|linden|löwen)(-| )?apotheke$","^amenity/pharmacy\\|(centrum|farm(a|á)cia\\s(central(e)?|comunale))$","^amenity/pharmacy\\|(marien|markt|mohren|neue|park|rathaus|rats|rosen|schloss|sonnen|stadt|stern)(-| )?apotheke$","^amenity/pharmacy\\|(айболит|арніка|фармация|фармація)$","^amenity/pharmacy\\|pharmacie\\s(centrale|comunale|de\\s(l'hôtel\\sde\\sville|la\\s(gare|mairie|poste))|du\\s(centre|marché|parc))$","^amenity/restaurant\\|((gasthaus|gasthof|schwarzer)?\\s?(adler|löwen))$","^amenity/restaurant\\|(ali\\sbaba|adria|akropolis|amici|aroma|asia|athen|athos|bahnhof|bamboo|bären|bella\\s(vista|napoli))","^amenity/restaurant\\|(belvedere|brasserie|canteen|cantina|capri|carpe\\sdiem|casa\\s?(blanca|mia)|casino)","^amenity/restaurant\\|(china\\s(buffet|city|garden|house|king|palace|star|town|wok)|(da|la|las|el)\\s)","^amenity/restaurant\\|(delphi|deutsches\\shaus|dhaba|dionysos|dolce\\svita|dorfkrug|europa|frohsinn)","^amenity/restaurant\\|(golden\\sdragon|great\\swall)$","^amenity/restaurant\\|(grüner\\sbaum|hellas|hirsch(en)?|hong\\skong|happy garden)","^amenity/restaurant\\|(indian\\spalace|ichiban|il\\sgiardino|italia|jade\\sgarden|jägerhof)","^amenity/restaurant\\|(kirchenwirt|koliba|kreta|kreuz|krone|lamm|le\\s(bistrot|patio))","^amenity/restaurant\\|(l'escale|lemongrass|linde|lindenhof|little\\s(italy|india)|los\\s(amigos|arcos))","^amenity/restaurant\\|(lotus|löwen|maharaja|mamma\\smia|mandarin|marco\\spolo|marmaris|mediterraneo|mensa|milano|mykonos|mythos)","^amenity/restaurant\\|(namaste|napoli|new\\schina|oasis|ochsen|olympia|osaka|paradise|parrilla|peking|pho|pinocchio)","^amenity/restaurant\\|(pizza\\shouse|pizz(a|e)ria|pizza\\sking|pomodoro|portofino|poseidon|ratskeller|rhodos|ristorante\\s)","^amenity/restaurant\\|(roma|rose|rössl[ei]|saffron|saigon|sakura|san\\smarco|santorini|schützenhaus|shalimar|shanghai|sonne|sphinx)","^amenity/restaurant\\|(sportheim|sternen|syrtaki|taj\\smahal|taste\\sof\\sindia|the\\skitchen|toscana|tokyo|traube)","^amenity/restaurant\\|(venezia|waldschänke|wok|zorbas|(zum|zur)\\s)","^amenity/restaurant\\|don camillo","^amenity/restaurant\\|永和豆漿$","^amenity/social_facility\\|dom pomocy społecznej$","^amenity/social_facility\\|maison de retraite$","^amenity/social_facility\\|safe haven$","^amenity/vending_machine\\|(schlauchomat|tobaccoland)$","^shop/(convenience|kiosk)\\|(777|bp|esso|exxon|independent|mobil|shell)$","^shop/bakery\\|(backshop|schneider|schäfer|каравай)$","^shop/bakery\\|(bäckerei\\s)?müller","^shop/clothes\\|трикотаж$","^shop/convenience\\|(24 часа|августина|альянс|апельсин|ассорти|бер(е|ё)зка|бриз|валентина|весна|визит|ветеран|водолей|гастроном|гермес|гурман|диана|добрый|дружба|домашний|елена)$","^shop/convenience\\|(almac[eé]n|despensa)$","^shop/convenience\\|(boutique d'alimentation|sup[eé]rette)$","^shop/convenience\\|(milk bar|юлия)$","^shop/convenience\\|(калинка|каштан|квартал|колобок|колос(ок)?|каравай|кооператор|корзинка|кулинария|лакомка|ласточка|лидер|луч|любава|любимый|людмила|люкс)$","^shop/convenience\\|(меркурий|мечта|мини маркет|мираж|белорусские продукты|продукты 24|натали|надежда|ника)$","^shop/convenience\\|(оазис|околица|олимп|парус|пеликан|престиж|подсолнух|радуга|росинка|ромашка|родник|рассвет|русь)$","^shop/convenience\\|(сельпо|семейный|сказка|солнышко|спутник|солнечный|светлана|удача|ивушка)$","^shop/convenience\\|(юбилейный|южный|эконом|шанс|чайка|центральный|хороший|хуторок|фаворит|фортуна|татьяна|тройка|эдем|уют)$","^shop/copyshop\\|xerox$","^shop/cosmetics\\|(vente de )?cosm[eé]tiques?$","^shop/fishing\\|рыболов$","^shop/florist\\|(мир цветов|орхидея)$","^shop/frame\\|rumah\\spenduduk$","^shop/hairdresser\\|(figaro|haarwerk|стиль|локон|шарм|fodrászat)$","^shop/hardware\\|(всё для дома|1000 мелочей|хозяюшка)$","^shop/jewelry\\|(585|jubiler)$","^shop/money_transfer|mobil(e)?\\smoney$","^shop/motorcycle\\|independent$","^shop/optician\\|(die brille|vision plus|оптика|[oó]ptica)$","^shop/supermarket\\|(famiglia cooperativa|семейный)$","^shop/tailor\\|couture\\s?(dame|homme|mixte)?$","^tourism/(h|m)otel\\|budget inn$","^tourism/hotel\\|(h[oô]tel\\s)?((zur\\s)?post|de france|de la gare|строитель)$","^tourism/hotel\\|(h[oô]tel\\s)?(astoria|belvedere|central|city|continental|europa)\\s?(h[oô]tel)?$","^tourism/hotel\\|(h[oô]tel\\s)?(grand|imperial|krone|palace|panorama|park|plaza|royal|victoria)\\s?(h[oô]tel)?$"]},flags:{emoji:"🚩",mainTag:"flag:wikidata",nameTags:{primary:["^(flag:name|flag:name:\\w+)$"],alternate:["^(country|country:\\w+|flag|flag:\\w+|subject|subject:\\w+)$"]},keepKV:["^man_made/flagpole$"],discardKVN:[]},operators:{emoji:"💼",mainTag:"operator:wikidata",nameTags:{primary:["^(name|name:\\w+|operator|operator:\\w+)$"],alternate:["^(brand|brand:\\w+|\\w+_name|\\w+_name:\\w+)$"]},discardKVN:["^amenity/clinic\\|(consultorio|municipal|private(_profit)?|priv(e|é){0,2}|public)$","^amenity/hospital\\|(govern?ment( authorities)?|govt( hospital)?|municipal|private|public|private not for profit|village)$","^amenity/hospital\\|(центральна районна лікарня|црб)$","^amenity/hospital\\|(центральная районная )?больница$","^amenity/post_office\\|(costcutter|londis|mccoll'?s|one stop|premier( stores)?|whsmith)$","^amenity/post_office\\|(co-?op( food)?|(the )?co-?operative( food)?)$"],keepKV:["^amenity/car_sharing$","^amenity/charging_station$","^amenity/clinic$","^amenity/fire_station$","^amenity/hospital$","^amenity/police$","^amenity/post_(depot|office)$","^emergency/ambulance_station$","^emergency/lifeboat_station$","^emergency/phone$"]},transit:{emoji:"🚇",mainTag:"network:wikidata",nameTags:{primary:["^network$"],alternate:["^(operator|operator:\\w+|network:\\w+|\\w+_name|\\w+_name:\\w+)$"]},keepKV:["^route/(aerialway|bus|light_rail|subway|train|tram|trolleybus|walking_bus)$"],discardKVN:["\\|[ilnr][chimsw][nm]$","\\|city$","\\|international$","\\|local$","\\|mtb$","\\|municipal$","\\|national$","\\|rail$","\\|regional$","\\|urban$"]}}; var require$$1 = { trees: trees }; diff --git a/dist/trees.json b/dist/trees.json index 45806e0a951..4ec2f916f70 100644 --- a/dist/trees.json +++ b/dist/trees.json @@ -125,9 +125,9 @@ "^shop/supermarket\\|(famiglia cooperativa|семейный)$", "^shop/tailor\\|couture\\s?(dame|homme|mixte)?$", "^tourism/(h|m)otel\\|budget inn$", - "^tourism/hotel\\|(h(o|ô)tel\\s)?((zur\\s)?post|de france|de la gare|строитель)$", - "^tourism/hotel\\|(h(o|ô)tel\\s)?(astoria|belvedere|central|city|continental|europa)\\s?(h(o|ô)tel)?$", - "^tourism/hotel\\|(h(o|ô)tel\\s)?(grand|imperial|krone|palace|panorama|park|plaza|royal|victoria)\\s?(h(o|ô)tel)?$" + "^tourism/hotel\\|(h[oô]tel\\s)?((zur\\s)?post|de france|de la gare|строитель)$", + "^tourism/hotel\\|(h[oô]tel\\s)?(astoria|belvedere|central|city|continental|europa)\\s?(h[oô]tel)?$", + "^tourism/hotel\\|(h[oô]tel\\s)?(grand|imperial|krone|palace|panorama|park|plaza|royal|victoria)\\s?(h[oô]tel)?$" ] }, "flags": { diff --git a/lib/file_tree.js b/lib/file_tree.js index 5b4ac58cc5d..2ce0c65f20b 100644 --- a/lib/file_tree.js +++ b/lib/file_tree.js @@ -220,12 +220,12 @@ exports.write = (cache) => { // clean locationSet let cleaned = {}; - if (item.locationSet.include) { + if (Array.isArray(item.locationSet.include)) { cleaned.include = item.locationSet.include.map(_cleanLower).sort(withLocale); } else { cleaned.include = ['001']; // default to world } - if (item.locationSet.exclude) { + if (Array.isArray(item.locationSet.exclude)) { cleaned.exclude = item.locationSet.exclude.map(_cleanLower).sort(withLocale); } item.locationSet = cleaned; @@ -257,21 +257,21 @@ exports.write = (cache) => { let cleanedProps = {}; cleanedProps.path = tkv; - if (properties.nameTag) { - cleanedProps.nameTag = properties.nameTag; - } if (properties.skipCollection) { cleanedProps.skipCollection = properties.skipCollection; } + if (Array.isArray(properties.preserveTags)) { + cleanedProps.preserveTags = properties.preserveTags.map(_cleanLower).sort(withLocale) + } cleanedProps.exclude = {}; - if (properties.exclude.generic) { + if (Array.isArray(properties.exclude.generic)) { cleanedProps.exclude.generic = properties.exclude.generic.map(_cleanLower).sort(withLocale); } else { const v2 = v.replace(/_/g, ' '); // add the value as a generic name exclude (e.g. 'restaurant') cleanedProps.exclude.generic = [`^${v2}$`]; } - if (properties.exclude.named) { + if (Array.isArray(properties.exclude.named)) { cleanedProps.exclude.named = properties.exclude.named.map(_cleanLower).sort(withLocale); } diff --git a/schema/categories.json b/schema/categories.json index f3ffff051fc..67dc8cdbb95 100644 --- a/schema/categories.json +++ b/schema/categories.json @@ -19,45 +19,9 @@ "pattern": "^\\S+/\\S+/\\S+$" }, - "mergeStrategy": { - "$comment": "Values here should be patterns that match OSM tag keys", - "description": "(optional) Strategy to take when merging tag values from name-suggestion-index into OpenStreetMap", - "type": "object", - "required": [], - "additionalProperties": false, - - "properties": { - "add": { - "description": "(optional) Values in OSM can be added, but existing values should not be modified", - "examples": ["^building$", "^flag:name$", "^takeaway$"], - "type": "array", - "uniqueItems": true, - "items": { - "type": "string", - "format": "regex" - } - }, - "replace": { - "description": "(optional) Values in OSM are always replaced with values in NSI", - "default": [".*"], - "type": "array", - "uniqueItems": true, - "items": { - "type": "string", - "format": "regex" - } - }, - "ignore": { - "description": "(optional) Values in NSI are never used to update OSM", - "examples": ["^payment:"], - "type": "array", - "uniqueItems": true, - "items": { - "type": "string", - "format": "regex" - } - } - } + "preserveTags": { + "description": "(optional) For tags matching these patterns, NSI should not replace an existing value in OSM", + "$ref": "#/definitions/preserveTags" }, "skipCollection": { @@ -169,6 +133,17 @@ "pattern": "^.*\\.geojson$" }, + "preserveTags": { + "description": "(optional) For tags matching these patterns, NSI should not replace an existing value in OSM", + "examples": ["^name"], + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "pattern": "^\\S+$" + } + }, + "notTags": { "description": "A list of properties that we never want as tags, this is to prevent common mistakes", "type": "object", @@ -178,10 +153,10 @@ "id": { "not" : {} }, "include": { "not" : {} }, "locationSet": { "not" : {} }, - "mergeStrategy": { "not" : {} }, "matchNames": { "not" : {} }, "matchTags": { "not" : {} }, "path": { "not" : {} }, + "preserveTags": { "not" : {} }, "note": { "not" : {} }, "skipCollection": { "not" : {} }, "tags": { "not" : {} }, @@ -232,6 +207,11 @@ } }, + "preserveTags": { + "description": "(optional) For tags matching these patterns, NSI should not replace an existing value in OSM", + "$ref": "#/definitions/preserveTags" + }, + "note": { "description": "(optional) An optional note - can contain anything about the item.", "type": "string" @@ -302,9 +282,8 @@ { "$ref": "#/definitions/notTags" } ] } - } } - } + } }