In [69]:
import pandas as pd
import bs4 as bs

In [108]:
dfs=pd.read_html('https://en.wikipedia.org/wiki/Research_stations_in_Antarctica#List_of_research_stations')

In [109]:
dfr=pd.read_html('https://en.wikipedia.org/wiki/Antarctic_field_camps')

In [110]:
df=dfs[1][1:]

In [111]:
df.columns=dfs[1].loc[0].values

In [112]:
df.to_excel('bases.xlsx')

In [113]:
import requests

In [114]:
url='https://en.wikipedia.org/wiki/Research_stations_in_Antarctica'
f=requests.get(url).content
soup = bs.BeautifulSoup(f, 'lxml')
parsed_table = soup.find_all('table')[1] 
data = [[''.join(td.strings)+'#'+td.a['href'] if td.find('a') else 
         ''.join(td.strings)
         for td in row.find_all('td')]
        for row in parsed_table.find_all('tr')]
headers=[''.join(row.strings)
        for row in parsed_table.find_all('th')]
df = pd.DataFrame(data[1:], columns=headers)

In [279]:
stations=[]
for i in df.T.iteritems():
    helper={}
    dummy=i[1][0].split('#')
    dummy0=dummy[0].split('[')[0].replace('\n',' ').replace('\n',' ').replace('\n',' ')
    helper['name']=dummy0
    helper['link']='https://en.wikipedia.org'+dummy[1]
    dummy=i[1][2].replace('\n',' ').replace('\n',' ').replace('\n',' ')
    if 'ummer since' in dummy:dummy='Permanent'
    dummy=dummy.split('[')[0]
    if 'emporary summer' in dummy:dummy='Summer'
    if 'intermittently Summer' in dummy:dummy='Summer'
    helper['type']=dummy
    dummy=i[1][3].split('#')[0].replace('\n',' |').replace(']','').replace('| |','|')[1:]
    if '' == dummy:dummy='Greenpeace'
    helper['country']=dummy
    dummy=i[1][4].replace('\n',' ').replace('\n',' ').replace('\n',' ').split(' ')[0]
    if 'eteo' in dummy:dummy='1958'
    helper['opened']=dummy
    dummy=i[1][5].split('#')[0].replace('\n',' | ').replace('| and |','|').split('[')[0].replace('.','')
    helper['program']=dummy
    dummy=i[1][6].split('#')[0].replace('\n',', ').replace('| and |','|').split('[')[0].replace('.','')
    helper['location']=dummy
    dummy=i[1][7].replace('\n',' ')
    if ' ' in dummy:
        if 'Active' in dummy: dummy='Active'
        elif 'Relocated to Union Glacier' in dummy: dummy='2014'
        elif 'Unmanned activity' in dummy: dummy='Active'
        elif 'Abandoned and lost' in dummy: dummy='1999'
        elif 'Dismantled 1992' in dummy: dummy='1992'
        elif 'Temporary abandoned since March 2017' in dummy: dummy='Active'
        elif 'Reopened 23 November 2017' in dummy: dummy='Active'
        elif 'Abandoned and lost' in dummy: dummy='1999'
        else: dummy=dummy.split(' ')[1]
    if dummy=='Active':
        helper['active']=True
        helper['closed']='9999'
    else:
        helper['active']=False
        helper['closed']=dummy
        if dummy=='Closed': 
            helper['active']=True
            helper['closed']='9999'
    dummy=i[1][8].replace('\n',', ').split('/')[2].split('(')[0].split('#')[0].split(',')[0].split('Coor')[0].split(u'\ufeff')[0].split(';')
    helper['latitude']=dummy[0][1:]
    helper['longitude']=dummy[1][1:]#.replace(' 0',' 0.001')[1:]
    
    stations.append(helper)

In [280]:
dta=pd.DataFrame(stations)
dta.to_excel('stations.xlsx')

In [281]:
import cesiumpy

In [282]:
dta


Out[282]:
active closed country latitude link location longitude name opened program type
0 True 9999 Finland -73.042283 https://en.wikipedia.org/wiki/Aboa_(research_s... Queen Maud Land -13.407350 Aboa 1989 Finnish Antarctic Research Program Summer
1 False 1957 Chile -62.933704 https://en.wikipedia.org/w/index.php?title=Agu... Deception Island -60.5958931 Aguirre Cerda 1955 Instituto Antártico Chileno Summer
2 True 9999 United States -90 https://en.wikipedia.org/wiki/Amundsen%E2%80%9... Geographical South Pole 0 Amundsen–Scott South Pole 1957 United States Antarctic Program Permanent
3 True 9999 Poland -62.160140 https://en.wikipedia.org/wiki/Henryk_Arctowski... King George Island -58.473247 Arctowski 1977 Polish Academy of Sciences Permanent
4 True 9999 New Zealand -77.830577 https://en.wikipedia.org/w/index.php?title=Arr... Ross Island 166.661174 Arrival Heights Laboratory 1959 Antarctica New Zealand Permanent
5 True 9999 New Zealand -77.830016 https://en.wikipedia.org/w/index.php?title=Arr... Ross Island 166.661659 Arrival Heights Satellite Station 1959 Antarctica New Zealand Permanent
6 True 9999 Uruguay -62.184444 https://en.wikipedia.org/wiki/Artigas_Base King George Island -58.903889 Artigas 1984 Uruguayan Antarctic Institute Permanent
7 False 2014 Chile -80.304170 https://en.wikipedia.org/wiki/Teniente_Arturo_... Ellsworth Land -81.3870573 Arturo Parodi 1999 Instituto Antártico Chileno Summer
8 True 9999 Chile -62.478889 https://en.wikipedia.org/wiki/Captain_Arturo_P... Greenwich Island -59.664444 Arturo Prat 1947 Chilean Navy Permanent
9 True 9999 Japan -71.525950 https://en.wikipedia.org/wiki/Asuka_Station_(A... Queen Maud Land 24.111409 Asuka 1985 National Institute of Polar Research Summer
10 True 9999 Australia -70.795115 https://en.wikipedia.org/w/index.php?title=Bea... Beaver Lake 68.168909 Beaver Lake 1995 Australian Antarctic Division Summer
11 False 1980 Argentina -77.767 https://en.wikipedia.org/wiki/Belgrano_I_Base Filchner-Ronne Ice Shelf -38.183 Belgrano I 1955 Instituto Antártico Argentino Permanent
12 True 9999 Argentina -77.873696 https://en.wikipedia.org/wiki/Belgrano_II_Base Coats Land -34.627588 Belgrano II 1979 Instituto Antartico Argentino Permanent
13 False 1984 Argentina -77.900556 https://en.wikipedia.org/wiki/Belgrano_III_Base Berkner Island -45.783611 Belgrano III 1980 Instituto Antártico Argentino Permanent
14 True 9999 Russia -62.198591 https://en.wikipedia.org/wiki/Bellingshausen_S... King George Island -58.960547 Bellingshausen 1968 Russian Antarctic Expedition Permanent
15 True 9999 India -69.408030 https://en.wikipedia.org/wiki/Bharati_(researc... Larsemann Hills 76.187361 Bharati 2012 Indian Antarctic Program Permanent
16 False 1976 South Africa -72.966667 https://en.wikipedia.org/w/index.php?title=Bor... Borg Massif -3.8 Borga 1969 South African National Antarctic Programme Summer
17 False 1972 United States -80.033333 https://en.wikipedia.org/wiki/Brockton_Station Ross Ice Shelf -178.7 Brockton 1965 United States Navy Summer
18 True 9999 Argentina -64.895476 https://en.wikipedia.org/wiki/Brown_Station Paradise Harbor -62.870905 Brown 1951 Instituto Antártico Argentino Summer
19 False 2005 United States -80.01472 https://en.wikipedia.org/wiki/Byrd_Station Marie Byrd Land -119.56556 Byrd 1957 United States Antarctic Program Permanent
20 True 9999 Argentina -62.594847 https://en.wikipedia.org/wiki/C%C3%A1mara_Base Half Moon Island -59.918558 Cámara 1953 Instituto Antartico Argentino Summer
21 True 9999 Chile -67.761201 https://en.wikipedia.org/wiki/Teniente_Luis_Ca... Adelaide Island -68.914365 Carvajal (ex Station T) 1984 Instituto Antártico Chileno Summer
22 True 9999 Australia -66.282514 https://en.wikipedia.org/wiki/Casey_Station Vincennes Bay 110.526613 Casey 1957 Australian Antarctic Division Permanent
23 False 1959 France -69.375 https://en.wikipedia.org/w/index.php?title=Cha... Adélie Land 139.016667 Charcot 1957 French Polar Institute Permanent
24 True 9999 Chile -62.169250 https://en.wikipedia.org/wiki/Collins_Base Fildes Peninsula -58.851852 Collins 2006 Instituto Antártico Chileno Summer
25 True 9999 Brazil -62.085379 https://en.wikipedia.org/wiki/Comandante_Ferra... King George Island -58.391513 Comandante Ferraz 1984 Brazilian Antarctic Program Permanent
26 True 9999 Italy | France -75.099780 https://en.wikipedia.org/wiki/Concordia_Station Dome C, Antarctic Plateau 123.332196 Concordia 2005 National Antarctic Research Program | IPEV Permanent
27 False 1990 India -69.406752 https://en.wikipedia.org/wiki/Dakshin_Gangotri Dakshin Gangotri Glacier 76.193379 Dakshin Gangotri 1983 Indian Antarctic Program Permanent
28 True 9999 Germany -62.238251 https://en.wikipedia.org/wiki/Carlini_Base Carlini Station -58.667764 Dallmann 1994 Alfred Wegener Institute Summer
29 True 9999 Australia -68.576667 https://en.wikipedia.org/wiki/Davis_Station Princess Elizabeth Land 77.9675 Davis 1957 Australian Antarctic Division Permanent
... ... ... ... ... ... ... ... ... ... ... ...
132 False 1962 United Kingdom -64.825276 https://en.wikipedia.org/wiki/Port_Lockroy Goudier Island -63.493688 Station A 1944 British Antarctic Survey Summer
133 False 1969 United Kingdom -62.977231 https://en.wikipedia.org/wiki/Deception_Island Deception Island -60.563809 Station B 1944 Falkland Islands and Dependencies Aerial Surve... Permanent
134 False 1947 United Kingdom -60.687642 https://en.wikipedia.org/wiki/Cape_Geddes Cape Geddes -44.573196 Station C 1946 British Antarctic Survey Summer
135 False 1964 United Kingdom -63.402478 https://en.wikipedia.org/wiki/Hope_Bay Hope Bay -56.990707 Station D 1945 British Antarctic Survey Permanent
136 False 1975 United Kingdom -68.185678 https://en.wikipedia.org/wiki/Stonington_Island Stonington Island -66.994815 Station E 1946 British Antarctic Survey Permanent
137 False 1996 United Kingdom -65.245791 https://en.wikipedia.org/wiki/Vernadsky_Resear... Galindez Island -64.257786 Station F 1947 British Antarctic Survey Permanent
138 False 1961 United Kingdom -62.087217 https://en.wikipedia.org/wiki/Keller_Peninsula Admiralty Bay -58.394049 Station G 1947 British Antarctic Survey Permanent
139 False 1959 United Kingdom -65.998516 https://en.wikipedia.org/wiki/Prospect_Point_(... Prospect Point -65.318273 Station J 1957 British Antarctic Survey Permanent
140 False 1958 United Kingdom -64.760032 https://en.wikipedia.org/wiki/Arthur_Harbour Anvers Island -64.079991 Station N 1955 British Antarctic Survey Permanent
141 False 1959 United Kingdom -64.733333 https://en.wikipedia.org/wiki/Danco_Island Danco Island -62.600000 Station O 1956 British Antarctic Survey Permanent
142 False 1958 United Kingdom -62.649306 https://en.wikipedia.org/wiki/Station_P Mateev Cove -60.590278 Station P 1957 British Antarctic Survey Summer
143 False 1977 United Kingdom -67.761201 https://en.wikipedia.org/wiki/Teniente_Luis_Ca... Adelaide Island -68.914365 Station T 1961 British Antarctic Survey Permanent
144 False 1963 United Kingdom -63.554392 https://en.wikipedia.org/wiki/View_Point View Point -57.378279 Station V 1953 British Antarctic Survey Permanent
145 False 1959 United Kingdom -66.867006 https://en.wikipedia.org/wiki/Detaille_Island Detaille Island -66.797971 Station W 1956 British Antarctic Survey Permanent
146 False 1960 United Kingdom -67.808285 https://en.wikipedia.org/wiki/Horseshoe_Island... Horseshoe Island -67.294266 Station Y 1955 British Antarctic Survey Permanent
147 True 9999 Sweden -74.583333 https://en.wikipedia.org/wiki/Svea_Research_St... Queen Maud Land -11.216667 Svea 1988 Swedish Polar Research Secretariat Summer
148 True 9999 China -73.863883 https://en.wikipedia.org/wiki/Antarctic_Taisha... Princess Elizabeth Land 76.974717 Taishan 2014 Polar Research Institute of China Summer
149 True 9999 Norway -71.889477 https://en.wikipedia.org/wiki/Tor_(research_st... Queen Maud Land 5.159545 Tor 1993 Norwegian Polar Institute Summer
150 True 9999 Norway -72.011662 https://en.wikipedia.org/wiki/Troll_(research_... Queen Maud Land 2.535138 Troll 1990 Norwegian Polar Institute Permanent
151 True 9999 Chile -79.76944 https://en.wikipedia.org/wiki/Estaci%C3%B3n_Po... Union Glacier -82.90722 Union Glacier 2014 Chilean Army | Chilean Navy | Chilean Air Forc... Summer
152 True 9999 New Zealand -77.516667 https://en.wikipedia.org/wiki/Vanda_Station Victoria Land 161.666667 Vanda 1969 Antarctica New Zealand Permanent
153 True 9999 Belarus -67.659123 https://en.wikipedia.org/w/index.php?title=Vec... Mount Vechernyaya, Thala Hills 46.158125 Vechernyaya 2007 National Academy of Sciences of Belarus Summer
154 True 9999 Ukraine | United Kingdom -65.245791 https://en.wikipedia.org/wiki/Vernadsky_Resear... Galindez Island -64.257786 Vernadsky (ex Station F) 1994 National Antarctic Scientific Center of Ukraine Permanent
155 True 9999 Soviet Union | Russia -78.463889 https://en.wikipedia.org/wiki/Vostok_Station Antarctic Ice Sheet 106.83757 Vostok 1957 Russian Antarctic Expedition Permanent
156 False 1957 Soviet Union -72.133333 https://en.wikipedia.org/w/index.php?title=Vos... East Antarctica 96.583333 Vostok I 1957 Russian Academy of Sciences Permanent
157 True 9999 Sweden -73.039901 https://en.wikipedia.org/wiki/Wasa_Research_St... Queen Maud Land -13.398584 Wasa 1989 Swedish Polar Research Secretariat Summer
158 False 1992 Russia | United States -71.8 https://en.wikipedia.org/w/index.php?title=Wed... Weddell Sea -51.716667 Weddell 1 1992 Russian Antarctic Expedition | National Scienc... Summer
159 False 1992 Greenpeace -77.6389 https://en.wikipedia.org/wiki/World_Park_Base Cape Evans -166.4139 World Park 1987 Greenpeace Permanent
160 True 9999 Chile -64.87591 https://en.wikipedia.org/wiki/Doumer_Island South Bay, Doumer Island -63.583721 Yelcho 1962 Instituto Antártico Chileno Summer
161 True 9999 China -69.373587 https://en.wikipedia.org/wiki/Antarctic_Zhongs... Larsemann Hills, Prydz Bay 76.371652 Zhongshan 1989 Polar Research Institute of China Permanent

162 rows × 11 columns


In [283]:
iso2=pd.read_html('https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2')[2]

In [284]:
iso22=iso2[1:].set_index(1)[[0]]

In [285]:
def cc(c):
    d=c.split('|')[0].strip()
    if d=='Czech Republic': return 'CZ'
    elif d=='Greenpeace': return 'AQ'
    elif d=='Soviet Union': return 'RU'
    elif d=='Russia': return 'RU'
    elif d=='United States': return 'US'
    elif d=='East Germany': return 'DE'
    elif d=='United Kingdom': return 'GB'
    elif d=='South Korea': return 'KR'
    else: return iso22.loc[d][0]
flags=[]
for i in dta['country']:
    flags.append('flags/glass2/'+cc(i).lower()+'.png')

In [286]:
dta['flag']=flags

In [287]:
dta[['name','link','active','type']].to_excel('links.xlsx')

Manually filled pop.xlsx


In [292]:
pop=pd.read_excel('pop.xlsx')

In [293]:
dta['summer']=pop['summer']
dta['winter']=pop['winter']

In [294]:
dta.to_excel('alldata.xlsx')

In [430]:
dta.set_index('name').T.to_json('antarctica.json')

In [431]:
v = cesiumpy.Viewer(animation=False, baseLayerPicker=True, fullscreenButton=True,
               geocoder=False, homeButton=False, infoBox=True, sceneModePicker=True,
               selectionIndicator=True, navigationHelpButton=False,
               timeline=False, navigationInstructionsInitiallyVisible=True)
x=dta[dta['active']]
for i, row in x.iterrows():
    r=0.7
    t=10000
    lon=float(row['longitude'])
    lat=float(row['latitude'])
    l0 = float(1**r)*t
    cyl = cesiumpy.Cylinder(position=[lon, lat, l0/2.], length=l0,
                            topRadius=2.5e4, bottomRadius=2.5e4, material='grey',\
                            name=row['name'])
    v.entities.add(cyl)
    l1 = (float(row['summer'])**r)*t
    cyl = cesiumpy.Cylinder(position=[lon, lat, l1/2.], length=l1*1.1,
                            topRadius=3e4, bottomRadius=3e4, material='crimson',\
                            name=row['name'])
    v.entities.add(cyl)
    
    l2 = float(row['winter']**r)*t
    cyl = cesiumpy.Cylinder(position=[lon, lat, l2/2.], length=l2*1.2,
                            topRadius=6e4, bottomRadius=6e4, material='royalBlue',\
                            name=row['name'])
    v.entities.add(cyl)
    
    pin = cesiumpy.Pin.fromText(row['name'], color=cesiumpy.color.GREEN)
    b = cesiumpy.Billboard(position=[float(row['longitude']), float(row['latitude']), l1*1.1+70000], \
                           image = row['flag'], scale=0.6,\
                           name=row['name'], pixelOffset = (0,0))
    v.entities.add(b)
    label = cesiumpy.Label(position=[float(row['longitude']), float(row['latitude']), l1*1.1+70000],\
                           text=row['name'], scale=0.6, name=row['name'],
                           pixelOffset = (0,22))
    v.entities.add(label)
    
with codecs.open("index.html", "w", encoding="utf-8") as f:
    f.write(v.to_html())
v


Out[431]: