Permafix-optimization-refiner #9

Merged
kscheidecker merged 9 commits from Permafix-optimization-refiner into main 2024-07-17 10:32:33 +00:00
3 changed files with 4 additions and 5 deletions
Showing only changes of commit b09ec2b083 - Show all commits

View File

@ -182,14 +182,14 @@ def count_elements_within_radius(coordinates: Tuple[float, float], radius: int)
return 0 return 0
# Creates a bounding box around given coordinates # Creates a bounding box around given coordinates, side_length in meters
def create_bbox(coordinates: Tuple[float, float], side_length: int) -> Tuple[float, float, float, float]: def create_bbox(coordinates: Tuple[float, float], side_length: int) -> Tuple[float, float, float, float]:
lat = coordinates[0] lat = coordinates[0]
lon = coordinates[1] lon = coordinates[1]
# Half the side length in km (since it's a square bbox) # Half the side length in km (since it's a square bbox)
half_side_length_km = side_length / 2.0 half_side_length_km = side_length / 2 / 1000
# Convert distance to degrees # Convert distance to degrees
lat_diff = half_side_length_km / 111 # 1 degree latitude is approximately 111 km lat_diff = half_side_length_km / 111 # 1 degree latitude is approximately 111 km

View File

@ -5,7 +5,6 @@ from typing import List, Tuple
from scipy.optimize import linprog from scipy.optimize import linprog
from collections import defaultdict, deque from collections import defaultdict, deque
from geopy.distance import geodesic from geopy.distance import geodesic
from shapely import Polygon
from structs.landmarks import Landmark from structs.landmarks import Landmark

View File

@ -1,5 +1,5 @@
{ {
"city bbox side" : 5, "city bbox side" : 5000,
"radius close to" : 50, "radius close to" : 50,
"church coeff" : 0.8, "church coeff" : 0.8,
"park coeff" : 1.2, "park coeff" : 1.2,