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

maj

parent 3090a937
Branches
No related tags found
No related merge requests found
......@@ -2,6 +2,7 @@ from research import circular_research
def coord_to_inter(liste_coord,lat,long,main_street):
dist=[]
inter_street=[]
inter_street_coord=[]
for inter in liste_coord:
d=(inter[0]-long)**2 + (inter[1]-lat)**2
dist.append(d)
......@@ -14,12 +15,13 @@ 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)
while len(inter_street)<2 :
candidat=liste_coord[dist.index(min(dist))]
dist_1_2= (candidat[0]-inter_street[0][0])**2 + (candidat[1]-inter_street[0][1])**2
dist_1_2= (candidat[0]-inter_street_coord[0][0])**2 + (candidat[1]-inter_street_coord[0][1])**2
dist_main_2= min(dist)
if dist_1_2<dist_main_2 :
indice=dist.index(min(dist))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment