stage changes as reference implementation
All checks were successful
Build and push docker image / Build (pull_request) Successful in 2m50s
Build and release APK / Build APK (pull_request) Successful in 4m11s
Build web / Build Web (pull_request) Successful in 1m28s

This commit is contained in:
Remy Moll 2024-07-17 12:33:53 +02:00
parent 8d71cab8d5
commit 7d7a25e2f3
6 changed files with 7 additions and 10 deletions

View File

@ -1,8 +1,6 @@
import yaml import yaml
import logging import logging
import osmnx as ox from OSMPythonTools import cachingStrategy, overpass
from shapely.geometry import Point, Polygon, LineString, MultiPolygon
from structs.landmarks import Landmark, LandmarkType from structs.landmarks import Landmark, LandmarkType
from structs.preferences import Preferences, Preference from structs.preferences import Preferences, Preference
import constants import constants
@ -16,9 +14,8 @@ class LandmarkManager:
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
def __init__(self) -> None: def __init__(self) -> None:
ox.settings.cache_folder = constants.OSM_CACHE_DIR strategy = cachingStrategy.JSON(cacheDir=constants.OSM_CACHE_DIR)
ox.settings.use_cache = True self.query_builder = overpass.Overpass()
ox.config(use_cache=True, cache_folder=constants.OSM_CACHE_DIR)
with constants.AMENITY_SELECTORS_PATH.open('r') as f: with constants.AMENITY_SELECTORS_PATH.open('r') as f:
self.amenity_selectors = yaml.safe_load(f) self.amenity_selectors = yaml.safe_load(f)
with constants.LANDMARK_PARAMETERS_PATH.open('r') as f: with constants.LANDMARK_PARAMETERS_PATH.open('r') as f:

View File

@ -10,7 +10,7 @@ from math import pi
from structs.landmarks import Landmark from structs.landmarks import Landmark
from landmarks_manager import take_most_important from landmarks_manager import take_most_important
from optimizer import solve_optimization, link_list_simple, print_res, get_distance from backend.src.example_optimizer import solve_optimization, link_list_simple, print_res, get_distance
import constants import constants

View File

@ -1,4 +1,4 @@
from optimizer import solve_optimization from backend.src.example_optimizer import solve_optimization
# from refiner import refine_optimization # from refiner import refine_optimization
from landmarks_manager import LandmarkManager from landmarks_manager import LandmarkManager
from structs.landmarks import Landmark from structs.landmarks import Landmark

View File

@ -1,4 +1,4 @@
city_bbox_side: 1500 #m city_bbox_side: 5000 #m
radius_close_to: 30 radius_close_to: 30
church_coeff: 0.6 church_coeff: 0.6
park_coeff: 1.5 park_coeff: 1.5

View File

@ -4,7 +4,7 @@ from typing import List
from landmarks_manager import LandmarkManager from landmarks_manager import LandmarkManager
from fastapi.encoders import jsonable_encoder from fastapi.encoders import jsonable_encoder
from optimizer import solve_optimization from backend.src.example_optimizer import solve_optimization
# from refiner import refine_optimization # from refiner import refine_optimization
from structs.landmarks import Landmark from structs.landmarks import Landmark
from structs.landmarktype import LandmarkType from structs.landmarktype import LandmarkType