Skip to content

Commit 1c78da9

Browse files
authored
Create Airport_identification.py
1 parent 6345f85 commit 1c78da9

File tree

1 file changed

+64
-0
lines changed

1 file changed

+64
-0
lines changed

Phase1/Airport_identification.py

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# Define our main tools:
2+
from FlightRadar24.api import FlightRadar24API
3+
fr_api = FlightRadar24API()
4+
5+
# Definition of tools used in reading images
6+
from PIL import Image
7+
import requests
8+
from io import BytesIO
9+
10+
# This library will be used to display images
11+
from matplotlib import pyplot as plt
12+
13+
# Map tool
14+
import folium
15+
16+
# Put ICAO of your airport in function:
17+
airport = fr_api.get_airport(code = "")
18+
airport_details = fr_api.get_airport_details(airport.icao)
19+
20+
# Set values:
21+
details = airport_details['airport']['pluginData']['details']
22+
position = airport_details['airport']['pluginData']['details']['position']
23+
airportImages = airport_details['airport']['pluginData']['details']['airportImages']
24+
25+
'''
26+
Step1:
27+
28+
name = ...
29+
country = ...
30+
city = ...
31+
32+
print("{} in: {} / {}".format(name, city, country))
33+
'''
34+
35+
36+
'''
37+
Step2:
38+
latitude = ...
39+
longitude = ...
40+
elevation = ...
41+
'''
42+
43+
'''
44+
Step3:
45+
response = ...
46+
response = requests.get(response)
47+
img = Image.open(BytesIO(response.content))
48+
49+
plt.imshow(img,cmap='gray')
50+
plt.show()
51+
'''
52+
53+
'''
54+
Step4:
55+
zone = folium.Map(location=[latitude, longitude], zoom_start=10)
56+
folium.Marker(location=[latitude, longitude], popup='Airport', icon=folium.Icon(icon='plane', prefix='fa')).add_to(zone)
57+
58+
# Display map
59+
zone
60+
'''
61+
62+
63+
64+

0 commit comments

Comments
 (0)