Private
Public Access
1
0

change osm to arcgis

This commit is contained in:
2024-06-13 11:07:29 +02:00
parent 9db84cf16b
commit 5e1169fd2c
8 changed files with 118 additions and 38 deletions

View File

@@ -39,7 +39,10 @@ from rowers.models import VirtualRace
def howfaris(lat_lon, course):
coords = course.coord
distance = geo_distance(lat_lon[0], lat_lon[1], coords[0], coords[1])[0]
try:
distance = geo_distance(lat_lon[0], lat_lon[1], coords[0], coords[1])[0]
except TypeError:
return 10000000
return distance
@@ -398,7 +401,7 @@ def createcourse(
if i == 0 and j == 0:
latitude = point['latitude']
longitude = point['longitude']
g = geocoder.osm([latitude, longitude], method='reverse')
g = geocoder.arcgis([latitude, longitude], method='reverse')
if g.ok:
country = g.json['country']
else: # pragma: no cover