improving course compare
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user