somewhat better durations
All checks were successful
Build and deploy the backend to staging / Build and push image (pull_request) Successful in 1m39s
Build and deploy the backend to staging / Deploy to staging (pull_request) Successful in 14s

This commit is contained in:
KILIAN-PC 2024-11-04 19:59:52 +01:00
parent 9e595ad933
commit d94c69c545
2 changed files with 9 additions and 6 deletions

View File

@ -45,7 +45,6 @@ sightseeing:
- gallery - gallery
- artwork - artwork
- aquarium - aquarium
historic: '' historic: ''
amenity: amenity:
- planetarium - planetarium

View File

@ -94,6 +94,8 @@ class LandmarkManager:
if preferences.shopping.score != 0: if preferences.shopping.score != 0:
score_function = lambda score: score * 10 * preferences.shopping.score / 5 score_function = lambda score: score * 10 * preferences.shopping.score / 5
current_landmarks = self.fetch_landmarks(bbox, self.amenity_selectors['shopping'], preferences.shopping.type, score_function) current_landmarks = self.fetch_landmarks(bbox, self.amenity_selectors['shopping'], preferences.shopping.type, score_function)
# set time for all shopping activites :
for landmark in current_landmarks : landmark.duration = 45
all_landmarks.update(current_landmarks) all_landmarks.update(current_landmarks)
@ -246,11 +248,11 @@ class LandmarkManager:
image_url = None image_url = None
name_en = None name_en = None
# remove specific tags # Adjust scoring
skip = False skip = False
for tag in elem.tags().keys(): for tag in elem.tags().keys():
if "pay" in tag: if "pay" in tag:
# payment options are a good sign # payment options are misleading and should not count for the scoring.
score += self.pay_bonus score += self.pay_bonus
if "disused" in tag: if "disused" in tag:
@ -263,10 +265,12 @@ class LandmarkManager:
score += self.wikipedia_bonus score += self.wikipedia_bonus
if "viewpoint" in tag: if "viewpoint" in tag:
# viewpoints must count more
score += self.viewpoint_bonus score += self.viewpoint_bonus
duration = 10 duration = 10
if "image" in tag: if "image" in tag:
# images must count more
score += self.image_bonus score += self.image_bonus
if elem_type != "nature": if elem_type != "nature":
@ -282,6 +286,7 @@ class LandmarkManager:
skip = True skip = True
break break
# Extract image, website and english name
if tag in ['website', 'contact:website']: if tag in ['website', 'contact:website']:
website_url = elem.tag(tag) website_url = elem.tag(tag)
if tag == 'image': if tag == 'image':
@ -295,10 +300,9 @@ class LandmarkManager:
score = score_function(score) score = score_function(score)
if "place_of_worship" in elem.tags().values(): if "place_of_worship" in elem.tags().values():
score = score * self.church_coeff score = score * self.church_coeff
duration = 15 duration = 10
elif "museum" in elem.tags().values(): elif "museum" in elem.tags().values() or "aquarium" in elem.tags().values() or "planetarium" in elem.tags().values():
score = score * self.church_coeff
duration = 60 duration = 60
else: else: