fixed optimizer. works fine now
All checks were successful
Build and push docker image / Build (pull_request) Successful in 2m17s
Build and release APK / Build APK (pull_request) Successful in 5m56s
Build web / Build Web (pull_request) Successful in 1m15s

This commit is contained in:
2024-06-10 14:24:37 +02:00
parent c58c10b057
commit adbb6466d9
5 changed files with 20689 additions and 101 deletions

View File

@@ -12,13 +12,13 @@ app = FastAPI()
# Assuming frontend is calling like this :
#"http://127.0.0.1:8000/process?param1={param1}&param2={param2}"
# This should become main at some point
@app.post("/optimizer/{longitude}/{latitude}")
def main(longitude: float, latitude: float, preferences: Preferences = Body(...)) -> List[Landmark]:
@app.post("/optimizer_coords/{longitude}/{latitude}/{city_country}")
def main1(preferences: Preferences = Body(...), longitude: float = None, latitude: float = None, city_country: str = None) -> List[Landmark]:
# From frontend get longitude, latitude and prefence list
# Generate the landmark list
landmarks = generate_landmarks(tuple((longitude, latitude)), preferences)
landmarks = generate_landmarks(preferences=preferences, city_country=city_country, coordinates=tuple((longitude, latitude)))
# Set the max distance
max_steps = 90