change osm to arcgis
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user