added image and website urls
This commit is contained in:
		| @@ -290,7 +290,10 @@ class LandmarkManager: | ||||
|                 elem_type = landmarktype            # Add the landmark type as 'sightseeing,  | ||||
|                 n_tags = len(elem.tags().keys())    # Add number of tags | ||||
|                 score = n_tags**self.tag_exponent   # Add score | ||||
|  | ||||
|                 website_url = None | ||||
|                 wikpedia_url = None | ||||
|                 image_url = None | ||||
|                 name_en = None | ||||
|  | ||||
|                 # remove specific tags | ||||
|                 skip = False | ||||
| @@ -304,7 +307,7 @@ class LandmarkManager: | ||||
|  | ||||
|                     if "wiki" in tag: | ||||
|                         score += self.wikipedia_bonus             # wikipedia entries count more | ||||
|  | ||||
|                          | ||||
|                     # if tag == "wikidata": | ||||
|                     #     Q = elem.tag('wikidata') | ||||
|                     #     site = Site("wikidata", "wikidata") | ||||
| @@ -331,6 +334,18 @@ class LandmarkManager: | ||||
|                         if tag == "building" and elem.tag('building') in ['retail', 'supermarket', 'parking']: | ||||
|                             skip = True | ||||
|                             break | ||||
|  | ||||
|                      | ||||
|                     # Get additional information | ||||
|                     # if tag == 'wikipedia' : | ||||
|                     #     wikpedia_url = elem.tag('wikipedia') | ||||
|                     if tag in ['website', 'contact:website'] : | ||||
|                         website_url = elem.tag(tag) | ||||
|                     if tag == 'image' : | ||||
|                         image_url = elem.tag('image') | ||||
|                     if tag =='name:en' : | ||||
|                         name_en = elem.tag('name:en') | ||||
|  | ||||
|                 if skip: | ||||
|                     continue | ||||
|  | ||||
| @@ -356,7 +371,11 @@ class LandmarkManager: | ||||
|                     attractiveness=score, | ||||
|                     must_do=False, | ||||
|                     n_tags=int(n_tags), | ||||
|                     duration = duration | ||||
|                     duration = duration,  | ||||
|                     name_en=name_en, | ||||
|                     image_url=image_url, | ||||
|                     # wikipedia_url=wikpedia_url, | ||||
|                     website_url=website_url | ||||
|                 ) | ||||
|                 return_list.append(landmark) | ||||
|          | ||||
|   | ||||
		Reference in New Issue
	
	Block a user