Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
EBEC 2021
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Léna Aix
EBEC 2021
Commits
6068f925
Commit
6068f925
authored
4 years ago
by
Alexandre Pradeilles
Browse files
Options
Downloads
Plain Diff
ajout exceptions
parents
5e2b4543
813f0fa0
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
coord_to_intersections.py
+6
-1
6 additions, 1 deletion
coord_to_intersections.py
main.py
+7
-2
7 additions, 2 deletions
main.py
request.py
+1
-4
1 addition, 4 deletions
request.py
with
14 additions
and
7 deletions
coord_to_intersections.py
+
6
−
1
View file @
6068f925
...
@@ -33,12 +33,17 @@ def coord_to_inter(liste_coord,lat,long,main_street):
...
@@ -33,12 +33,17 @@ def coord_to_inter(liste_coord,lat,long,main_street):
indice
=
dist
.
index
(
min
(
dist
))
indice
=
dist
.
index
(
min
(
dist
))
dist
.
pop
(
indice
)
dist
.
pop
(
indice
)
liste_coord
.
pop
(
indice
)
liste_coord
.
pop
(
indice
)
elif
nom_de_rue
==
inter_street
[
0
]:
indice
=
dist
.
index
(
min
(
dist
))
dist
.
pop
(
indice
)
liste_coord
.
pop
(
indice
)
else
:
else
:
inter_street
.
append
(
nom_de_rue
)
inter_street
.
append
(
nom_de_rue
)
inter_street_coord
.
append
(
candidat
)
indice
=
dist
.
index
(
min
(
dist
))
indice
=
dist
.
index
(
min
(
dist
))
dist
.
pop
(
indice
)
dist
.
pop
(
indice
)
liste_coord
.
pop
(
indice
)
liste_coord
.
pop
(
indice
)
return
inter_street
return
inter_street
+
inter_street_coord
...
...
This diff is collapsed.
Click to expand it.
main.py
+
7
−
2
View file @
6068f925
...
@@ -6,10 +6,15 @@ def tree_position(lat, lon):
...
@@ -6,10 +6,15 @@ def tree_position(lat, lon):
main_street
=
req
[
'
address
'
][
'
road
'
]
main_street
=
req
[
'
address
'
][
'
road
'
]
city
=
req
[
'
address
'
][
'
town
'
]
city
=
req
[
'
address
'
][
'
town
'
]
intersections
=
req
[
'
geojson
'
][
'
coordinates
'
]
intersections
=
req
[
'
geojson
'
][
'
coordinates
'
]
[
begin
,
end
]
=
coord_to_inter
(
intersections
,
lat
,
lon
,
main_street
)
[
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
}
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__
"
:
if
__name__
==
"
__main__
"
:
<<<<<<<
HEAD
lat
=
48.89394122
lat
=
48.89394122
lon
=
2.247959188
lon
=
2.247959188
=======
lat
=
48.89227652
lon
=
2.253773690
>>>>>>>
813
f0fa0998be24636500d74894a86f50c568431
print
(
tree_position
(
lat
,
lon
))
print
(
tree_position
(
lat
,
lon
))
\ No newline at end of file
This diff is collapsed.
Click to expand it.
request.py
+
1
−
4
View file @
6068f925
import
geocoder
import
requests
import
requests
def
geocode
(
city
):
g
=
geocoder
.
osm
(
city
)
return
(
g
.
y
,
g
.
x
)
def
requete_osm
(
lat
,
lon
):
def
requete_osm
(
lat
,
lon
):
params
=
{
params
=
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment