diff --git a/backend/src/parameters/amenity_selectors.yaml b/backend/src/parameters/amenity_selectors.yaml index 87b4b42..7d0fabc 100644 --- a/backend/src/parameters/amenity_selectors.yaml +++ b/backend/src/parameters/amenity_selectors.yaml @@ -45,7 +45,6 @@ sightseeing: - gallery - artwork - aquarium - historic: '' amenity: - planetarium diff --git a/backend/src/utils/landmarks_manager.py b/backend/src/utils/landmarks_manager.py index 68dcb2e..f205132 100644 --- a/backend/src/utils/landmarks_manager.py +++ b/backend/src/utils/landmarks_manager.py @@ -94,6 +94,8 @@ class LandmarkManager: if preferences.shopping.score != 0: 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) + # set time for all shopping activites : + for landmark in current_landmarks : landmark.duration = 45 all_landmarks.update(current_landmarks) @@ -246,11 +248,11 @@ class LandmarkManager: image_url = None name_en = None - # remove specific tags + # Adjust scoring skip = False for tag in elem.tags().keys(): 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 if "disused" in tag: @@ -263,10 +265,12 @@ class LandmarkManager: score += self.wikipedia_bonus if "viewpoint" in tag: + # viewpoints must count more score += self.viewpoint_bonus duration = 10 if "image" in tag: + # images must count more score += self.image_bonus if elem_type != "nature": @@ -282,6 +286,7 @@ class LandmarkManager: skip = True break + # Extract image, website and english name if tag in ['website', 'contact:website']: website_url = elem.tag(tag) if tag == 'image': @@ -295,10 +300,9 @@ class LandmarkManager: score = score_function(score) if "place_of_worship" in elem.tags().values(): score = score * self.church_coeff - duration = 15 + duration = 10 - elif "museum" in elem.tags().values(): - score = score * self.church_coeff + elif "museum" in elem.tags().values() or "aquarium" in elem.tags().values() or "planetarium" in elem.tags().values(): duration = 60 else: