stage changes as reference implementation
This commit is contained in:
parent
8d71cab8d5
commit
7d7a25e2f3
@ -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:
|
@ -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
|
||||||
|
|
||||||
|
|
@ -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
|
||||||
|
@ -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
|
||||||
|
@ -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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user