Private
Public Access
1
0

improving course compare

This commit is contained in:
2024-11-11 11:43:18 +01:00
parent 29749a9306
commit de16a237fc
6 changed files with 65 additions and 9 deletions

View File

@@ -36,6 +36,21 @@ from rowers.models import VirtualRace
# distance of course from lat_lon in km
def pass_start(df, course):
if df.empty:
return False
def f(x):
return coordinate_in_path(x[' latitude'], x[' longitude'], p)
polygons = course.polygons.all()
p = polygon_to_path(polygons[0])
inpolygon = df.apply(lambda row:f(row), axis=1).copy()
return inpolygon.any()
def howfaris(lat_lon, course):
coords = course.coord