-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnearestairport.py
52 lines (46 loc) · 1.31 KB
/
nearestairport.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
from GeoBases import GeoBase
import plotly.plotly as py
import pandas as pd
import plotly.plotly as py
nyc_london = [ dict(
type = 'scattergeo',
lat = [ 39.0392, 41.8781],
lon = [ 125.7625, -87.6298],
mode = 'lines',
line = dict(
width = 1,
color = 'purple',
),
) ]
layout = dict(
title = 'Pyongyang to Chicago',
showlegend = False,
geo = dict(
resolution = 100,
showland = True,
showlakes = True,
landcolor = 'rgb(204, 204, 204)',
countrycolor = 'rgb(204, 204, 204)',
lakecolor = 'rgb(255, 255, 255)',
projection = dict( type="equirectangular" ),
coastlinewidth = 2,
lataxis = dict(
range = [ -100, 100 ],
showgrid = False,
tickmode = "linear",
dtick = 20
),
lonaxis = dict(
range = [-100, 100],
showgrid = False,
tickmode = "linear",
dtick = 20
),
)
)
fig = dict( data=nyc_london, layout=layout )
py.iplot( fig, validate=False, filename='d3-great-circle' )
point = (40,-75)
geo_a = GeoBase(data='airports',verbose=False)
print(list(geo_a.findClosestFromPoint(point)))
print()