background task later
Some checks failed
Build and deploy the backend to staging / Build and push image (pull_request) Failing after 53s
Build and deploy the backend to staging / Deploy to staging (pull_request) Has been skipped
Run linting on the backend code / Build (pull_request) Successful in 28s
Run testing on the backend code / Build (pull_request) Failing after 3m15s
Some checks failed
Build and deploy the backend to staging / Build and push image (pull_request) Failing after 53s
Build and deploy the backend to staging / Deploy to staging (pull_request) Has been skipped
Run linting on the backend code / Build (pull_request) Successful in 28s
Run testing on the backend code / Build (pull_request) Failing after 3m15s
This commit is contained in:
@@ -1,10 +1,7 @@
|
||||
"""Module used to import data from OSM and arrange them in categories."""
|
||||
import logging
|
||||
import math as m
|
||||
import xml.etree.ElementTree as ET
|
||||
import yaml
|
||||
|
||||
|
||||
from ..structs.preferences import Preferences
|
||||
from ..structs.landmark import Landmark
|
||||
from .take_most_important import take_most_important
|
||||
@@ -204,18 +201,18 @@ class LandmarkManager:
|
||||
self.logger.error(f"Error fetching landmarks: {e}")
|
||||
continue
|
||||
|
||||
return_list += self.json_to_landmarks(result, landmarktype, preference_level)
|
||||
return_list += self._to_landmarks(result, landmarktype, preference_level)
|
||||
|
||||
self.logger.debug(f"Fetched {len(return_list)} landmarks of type {landmarktype} in {bbox}")
|
||||
|
||||
return return_list
|
||||
|
||||
|
||||
def json_to_landmarks(self, elements: list, landmarktype, preference_level) -> list[Landmark]:
|
||||
def _to_landmarks(self, elements: list, landmarktype, preference_level) -> list[Landmark]:
|
||||
"""
|
||||
Parse the Overpass API result and extract landmarks.
|
||||
|
||||
This method processes the XML root element returned by the Overpass API and
|
||||
This method processes the JSON elements returned by the Overpass API and
|
||||
extracts landmarks of types 'node', 'way', and 'relation'. It retrieves
|
||||
relevant information such as name, coordinates, and tags, and converts them
|
||||
into Landmark objects.
|
||||
@@ -225,9 +222,8 @@ class LandmarkManager:
|
||||
elem_type (str): The type of landmark (e.g., node, way, relation).
|
||||
|
||||
Returns:
|
||||
list[Landmark]: A list of Landmark objects extracted from the XML data.
|
||||
list[Landmark]: A list of Landmark objects extracted from the JSON data.
|
||||
"""
|
||||
print(f'in landmarks manager : {type(elements)}')
|
||||
if elements is None :
|
||||
return []
|
||||
|
||||
|
@@ -1,6 +1,5 @@
|
||||
"""Module for finding public toilets around given coordinates."""
|
||||
import logging
|
||||
import xml.etree.ElementTree as ET
|
||||
|
||||
from ..overpass.overpass import Overpass, get_base_info
|
||||
from ..structs.landmark import Toilets
|
||||
@@ -88,7 +87,7 @@ class ToiletsManager:
|
||||
elem_type (str): The type of landmark (e.g., node, way, relation).
|
||||
|
||||
Returns:
|
||||
list[Landmark]: A list of Landmark objects extracted from the XML data.
|
||||
list[Landmark]: A list of Landmark objects extracted from the JSON data.
|
||||
"""
|
||||
if elements is None :
|
||||
return []
|
||||
|
Reference in New Issue
Block a user