mirror of
https://codeberg.org/matkoniecz/list_how_openstreetmap_can_be_improved_with_alltheplaces_data.git
synced 2025-04-11 10:09:29 +02:00
better handle atpisms
This commit is contained in:
parent
a4da79bb16
commit
f7a43c539f
2 changed files with 19 additions and 9 deletions
24
0_config.py
24
0_config.py
|
@ -612,13 +612,18 @@ def link_status_requests_missing_from_cache():
|
|||
def opening_hours_key():
|
||||
return "opening_hours_in_atp_format"
|
||||
|
||||
def atpism_links():
|
||||
returned = [
|
||||
'website_may_be_broken', # marked by my qa
|
||||
|
||||
def keys_with_value_link():
|
||||
returned = ["website", 'website_may_be_broken', "operator:website", 'website:en', 'website:fr', 'website:de', 'website:kr', 'website:cn', 'website:menu', 'website:orders', 'website:orders:en', 'website:orders:ar', 'reservation:website',
|
||||
'contact:webcam', # should not be contact...
|
||||
'contact:tripadvisor', 'contact:yelp',
|
||||
'source:website', 'brand:website', # probably should be eliminated - TODO
|
||||
]
|
||||
# these may have some use in OSM but I would not advocate really increasing their use
|
||||
"operator:website", 'website:en', 'website:fr', 'website:de', 'website:kr', 'website:cn',
|
||||
'website:menu', 'website:orders', 'website:orders:en', 'website:orders:ar', 'reservation:website',
|
||||
'contact:tripadvisor', 'contact:yelp',
|
||||
'contact:webcam', # should not be contact...
|
||||
|
||||
'source:website', 'brand:website', # probably should be eliminated - TODO
|
||||
]
|
||||
for code in language_tag_knowledge.all_iso_639_1_language_codes():
|
||||
if "website:" + code not in returned:
|
||||
returned.append("website:" + code)
|
||||
|
@ -627,9 +632,9 @@ def keys_with_value_link():
|
|||
if "website:menu:" + code not in returned:
|
||||
returned.append("website:menu:" + code)
|
||||
return returned
|
||||
# TODO: should website:en be even kept at all?
|
||||
# TODO what about website:orders
|
||||
# TODO website:fr
|
||||
|
||||
def keys_with_value_link():
|
||||
return ["website"] + atpism_links()
|
||||
|
||||
|
||||
def keys_with_possible_link():
|
||||
|
@ -734,6 +739,7 @@ def atp_tags_very_likely_not_usable_for_osm_import(tags):
|
|||
'brand:hi', 'brand:pa', 'brand:pnb', 'brand:ko', 'brand:sr-Latn',
|
||||
'brand:hy', 'brand:tr', 'brand:uk'
|
||||
]
|
||||
returned += atpism_links()
|
||||
if tags.get("addr:country") not in ['US']:
|
||||
returned.append("addr:state")
|
||||
return returned
|
||||
|
|
|
@ -10,3 +10,7 @@ class ConfigTests(unittest.TestCase):
|
|||
# it was missing as it was using country code list, not language code list
|
||||
# so jp was present and ja missing
|
||||
self.assertTrue("website:ja" in config.keys_with_value_link())
|
||||
self.assertTrue("website:ja" in config.atp_tags_very_likely_not_usable_for_osm_import({}))
|
||||
|
||||
def test_charge_as_not_reccommeded_for_import(self):
|
||||
self.assertTrue("charge" in config.atp_tags_very_likely_not_usable_for_osm_import({}))
|
||||
|
|
Loading…
Add table
Reference in a new issue