Skip to content
Snippets Groups Projects
Commit 813f0fa0 authored by Léna Aix's avatar Léna Aix
Browse files

maj

parent a0fab3fc
No related branches found
No related tags found
No related merge requests found
......@@ -39,10 +39,11 @@ def coord_to_inter(liste_coord,lat,long,main_street):
liste_coord.pop(indice)
else :
inter_street.append(nom_de_rue)
inter_street_coord.append(candidat)
indice=dist.index(min(dist))
dist.pop(indice)
liste_coord.pop(indice)
return inter_street
return inter_street+inter_street_coord
......
......@@ -6,8 +6,8 @@ def tree_position(lat, lon):
main_street = req['address']['road']
city = req['address']['town']
intersections = req['geojson']['coordinates']
[begin,end] = coord_to_inter(intersections, lat, lon, main_street)
return {'lat':lat, 'lon':lon, 'ville':city, 'rue':main_street, 'début tronçon': begin, 'fin tronçon':end}
[begin,end,coord_begin, coord_end] = coord_to_inter(intersections, lat, lon, main_street)
return {'lat':lat, 'lon':lon, 'ville':city, 'rue':main_street, 'début tronçon': begin, 'fin tronçon':end, 'coordonées début tronçon': coord_begin, 'coordonnées fin tronçon': coord_end}
if __name__=="__main__":
lat = 48.89227652
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment