In [38]:
import pandas as pd
import sqlite3
from mpl_toolkits.basemap import Basemap
import matplotlib.pyplot as plt
import numpy as np
from scipy import *
%matplotlib inline

In [2]:
def read_sqllite(sqllite_db, tablename):
    """ To read data from sqllite table.
    ---------------
    Parameters
    
    sqllite_db - String. Name of sqllite database
    
    tablename - String. Name of table in database to extract data from
    
    --------------
    Returns
    
    df - Dataframe. Data frame of data extracted from database table.
    """
    con=sqlite3.connect(sqllite_db)
    df=pd.read_sql_query("select * from " + tablename + ";", con)
    
    return df
    
train_times = read_sqllite(sqllite, 'TIMES')
station_locations = read_sqllite(sqllite, 'LOCATIONS')


---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-2-88dfedfed9cb> in <module>()
     18     return df
     19 
---> 20 train_times = read_sqllite(sqllite, 'TIMES')
     21 station_locations = read_sqllite(sqllite, 'LOCATIONS')

NameError: name 'sqllite' is not defined

In [ ]:
# To extract all stations within an area
d2=d[(d['Easting']>123374) & (d['Easting'] < 340361) & (d['Northing']>6974) & (d['Northing']<152168)]

In [7]:
map2 = Basemap(projection='merc',
    resolution = 'l', area_thresh = 0.1,
    llcrnrlon=-5.8535212, llcrnrlat=49.898888,
    urcrnrlon=-2.856179, urcrnrlat=51.265534)
map2.drawmapboundary(fill_color='aqua')
map2.fillcontinents(color='green', lake_color='aqua')
parallels = np.arange(0.,81,10.)
map2.drawparallels(parallels)

meridians = np.arange(10.,351.,20.)
map2.drawmeridians(meridians


Out[7]:
{}

In [132]:
stations=pd.read_csv('stations.csv')
stations['Easting']=stations['Easting']-80
#stations['Northing']=stations['Northing']-80

In [ ]:


In [133]:
map2 = Basemap(projection='merc',
    resolution = 'l', area_thresh = 0.1,
    llcrnrlon=-5.8535212, llcrnrlat=49.898888,
    urcrnrlon=-2.856179, urcrnrlat=51.265534)
map2.drawmapboundary(fill_color='aqua')
map2.fillcontinents(color='green', lake_color='aqua')
parallels = np.arange(0.,81,10.)
map2.drawparallels(parallels)

meridians = np.arange(10.,351.,20.)
map2.drawmeridians(meridians)

#stations=stations[time==time]

Easting = stations['Easting']
Northing = stations['Northing']
#x,y = map(list(Easting), list(Northing))  # To convert lat/long to projection 
#map2.plot(x,y, 'rs', markersize=18)

map2.plot(Easting, Northing, 'rs', markersize=5)
#labels = ['The Needles','Brighton']
#label_style=['rs','bo']
#for label, xpt, ypt, style in zip(labels, x, y, label_style):
#    print label, xpt, ypt, style
#    map2.plot(xpt,ypt,style, markersize=12)
#    plt.text(xpt,ypt, label)
    
#plt.show


Out[133]:
[<matplotlib.lines.Line2D at 0xb6180d0>]

In [100]:
def OSGB36toWGS84(df):
    lats=[]
    longs=[]
    for station in range(1,len(df), 1):
        E = df['Easting'][station]
        N = df['Northing'][station]
        
        #E, N are the British national grid coordinates - eastings and northings
        a, b = 6377563.396, 6356256.909 #The Airy 180 semi-major and semi-minor axes used for OSGB36 (m)
        F0 = 0.9996012717 #scale factor on the central meridian
        lat0 = 49*pi/180#Latitude of true origin (radians)
        lon0 = -2*pi/180#Longtitude of true origin and central meridian (radians)
        N0, E0 = -100000, 400000#Northing & easting of true origin (m)
        e2 = 1 - (b*b)/(a*a)#eccentricity squared
        n = (a-b)/(a+b)

        #Initialise the iterative variables
        lat,M = lat0, 0

        while N-N0-M >= 0.00001: #Accurate to 0.01mm
            lat = (N-N0-M)/(a*F0) + lat;
            M1 = (1 + n + (5/4)*n**2 + (5/4)*n**3) * (lat-lat0)
            M2 = (3*n + 3*n**2 + (21/8)*n**3) * sin(lat-lat0) * cos(lat+lat0)
            M3 = ((15/8)*n**2 + (15/8)*n**3) * sin(2*(lat-lat0)) * cos(2*(lat+lat0))
            M4 = (35/24)*n**3 * sin(3*(lat-lat0)) * cos(3*(lat+lat0))
            #meridional arc
            M = b * F0 * (M1 - M2 + M3 - M4)

            #transverse radius of curvature
            nu = a*F0/sqrt(1-e2*sin(lat)**2)
            #meridional radius of curvature
            rho = a*F0*(1-e2)*(1-e2*sin(lat)**2)**(-1.5)
            eta2 = nu/rho-1

            secLat = 1./cos(lat)
            VII = tan(lat)/(2*rho*nu)
            VIII = tan(lat)/(24*rho*nu**3)*(5+3*tan(lat)**2+eta2-9*tan(lat)**2*eta2)
            IX = tan(lat)/(720*rho*nu**5)*(61+90*tan(lat)**2+45*tan(lat)**4)
            X = secLat/nu
            XI = secLat/(6*nu**3)*(nu/rho+2*tan(lat)**2)
            XII = secLat/(120*nu**5)*(5+28*tan(lat)**2+24*tan(lat)**4)
            XIIA = secLat/(5040*nu**7)*(61+662*tan(lat)**2+1320*tan(lat)**4+720*tan(lat)**6)
            dE = E-E0

            lat = lat - VII*dE**2 + VIII*dE**4 - IX*dE**6
            lon = lon0 + X*dE - XI*dE**3 + XII*dE**5 - XIIA*dE**7

            #Convert to degrees
            lat = lat*180/pi
            lon = lon*180/pi
            
        #print lat
        #print long
        lats.append(lat)
        longs.append(long)
        
    return lat, long

In [72]:
#stations['Latitude'] = [OSGB36toWGS84(e,n) for e, n in stations[['Easting', 'Northing']]]
#stations['Longitude'] = OSGB36toWGS84(stations[['Easting', 'Northing']])[1]

#[OSGB36toWGS84(e,n) for e, n in stations[['Easting', 'Northing']]]

OSGB36toWGS84(stations[['Easting', 'Northing']])
#stations[['Easting', 'Northing']]


2892.50198982
<type 'long'>
2890.53764664
<type 'long'>
2890.22549047
<type 'long'>
2929.28118698
<type 'long'>
2926.18372356
<type 'long'>
2925.08423586
<type 'long'>
2887.61984427
<type 'long'>
2893.20051855
<type 'long'>
2875.98337936
<type 'long'>
2887.92705621
<type 'long'>
2876.74978604
<type 'long'>
2907.64839755
<type 'long'>
2922.89678076
<type 'long'>
2890.22967801
<type 'long'>
2911.33191974
<type 'long'>
2909.54851229
<type 'long'>
2897.95661736
<type 'long'>
2898.98097541
<type 'long'>
2886.37355
<type 'long'>
2905.58110284
<type 'long'>
2886.58166099
<type 'long'>
2915.52550645
<type 'long'>
2906.29617455
<type 'long'>
2906.45588496
<type 'long'>
2905.76158505
<type 'long'>
2900.29361258
<type 'long'>
2902.96550314
<type 'long'>
2873.3323728
<type 'long'>
2873.19692819
<type 'long'>
2909.74382423
<type 'long'>
2894.24717795
<type 'long'>
2875.32626383
<type 'long'>
2934.45192006
<type 'long'>
2910.3113938
<type 'long'>
2887.2259853
<type 'long'>
2887.02304933
<type 'long'>
2918.2923528
<type 'long'>
2913.76662256
<type 'long'>
2875.2439226
<type 'long'>
2874.93793867
<type 'long'>
2890.28382395
<type 'long'>
2885.26749314
<type 'long'>
2888.011315
<type 'long'>
2887.02979332
<type 'long'>
2902.61819988
<type 'long'>
2901.81985457
<type 'long'>
2889.10290712
<type 'long'>
2912.32971313
<type 'long'>
2895.02279101
<type 'long'>
2888.46217235
<type 'long'>
2909.29841811
<type 'long'>
2905.06882116
<type 'long'>
2906.63070426
<type 'long'>
2889.59153366
<type 'long'>
2885.04345837
<type 'long'>
2873.31079974
<type 'long'>
2871.67069757
<type 'long'>
2877.10176666
<type 'long'>
2906.94352993
<type 'long'>
2886.33321589
<type 'long'>
2906.57095976
<type 'long'>
2919.48986618
<type 'long'>
2874.47708929
<type 'long'>
2887.83064342
<type 'long'>
2888.66090916
<type 'long'>
2878.05559711
<type 'long'>
2908.79043917
<type 'long'>
2888.02338239
<type 'long'>
2886.84311935
<type 'long'>
2884.13829477
<type 'long'>
2887.68202313
<type 'long'>
2887.71742605
<type 'long'>
2887.52508521
<type 'long'>
2874.46387055
<type 'long'>
2887.27420228
<type 'long'>
2876.66963865
<type 'long'>
2906.56369381
<type 'long'>
2888.92015582
<type 'long'>
2900.64633678
<type 'long'>
2923.2936549
<type 'long'>
2896.08096572
<type 'long'>
2917.21539398
<type 'long'>
2903.99101065
<type 'long'>
2891.10391442
<type 'long'>
2891.79407772
<type 'long'>
2889.65688884
<type 'long'>
2879.80644586
<type 'long'>
2921.76469005
<type 'long'>
2908.67570287
<type 'long'>
2909.18277606
<type 'long'>
Out[72]:
([2892.5019898215692,
  2890.5376466373846,
  2890.2254904709107,
  2929.2811869836451,
  2926.1837235554799,
  2925.0842358553,
  2887.6198442689088,
  2893.2005185548605,
  2875.9833793564512,
  2887.9270562144943,
  2876.7497860419371,
  2907.6483975472497,
  2922.8967807565941,
  2890.2296780073498,
  2911.3319197371111,
  2909.5485122933892,
  2897.9566173622879,
  2898.9809754136222,
  2886.3735500037069,
  2905.5811028407393,
  2886.5816609937197,
  2915.525506454293,
  2906.2961745521065,
  2906.4558849601394,
  2905.7615850484776,
  2900.2936125845017,
  2902.9655031423731,
  2873.332372799659,
  2873.1969281893539,
  2909.7438242287012,
  2894.2471779453526,
  2875.3262638295464,
  2934.4519200561062,
  2910.3113938048477,
  2887.2259853004675,
  2887.0230493312783,
  2918.292352803508,
  2913.7666225574076,
  2875.2439225962844,
  2874.9379386699702,
  2890.283823949098,
  2885.2674931386691,
  2888.0113149979006,
  2887.0297933208722,
  2902.6181998822631,
  2901.8198545718624,
  2889.1029071246621,
  2912.3297131256772,
  2895.0227910103226,
  2888.4621723514665,
  2909.2984181099077,
  2905.0688211630286,
  2906.6307042563963,
  2889.5915336575808,
  2885.0434583700699,
  2873.3107997428724,
  2871.6706975720722,
  2877.1017666608859,
  2906.9435299345778,
  2886.3332158905628,
  2906.5709597629939,
  2919.4898661829784,
  2874.4770892885767,
  2887.8306434152469,
  2888.6609091555092,
  2878.0555971102181,
  2908.7904391741363,
  2888.0233823914946,
  2886.8431193498936,
  2884.1382947747111,
  2887.6820231334518,
  2887.7174260532261,
  2887.5250852098916,
  2874.4638705499838,
  2887.274202278732,
  2876.6696386525191,
  2906.5636938066323,
  2888.9201558240898,
  2900.6463367837368,
  2923.2936548956222,
  2896.0809657168829,
  2917.2153939798354,
  2903.9910106466232,
  2891.1039144208935,
  2891.7940777166941,
  2889.6568888371589,
  2879.8064458639637,
  2921.7646900471173,
  2908.6757028662705,
  2909.1827760620954],
 [long,
  long,
  long,
  long,
  long,
  long,
  long,
  long,
  long,
  long,
  long,
  long,
  long,
  long,
  long,
  long,
  long,
  long,
  long,
  long,
  long,
  long,
  long,
  long,
  long,
  long,
  long,
  long,
  long,
  long,
  long,
  long,
  long,
  long,
  long,
  long,
  long,
  long,
  long,
  long,
  long,
  long,
  long,
  long,
  long,
  long,
  long,
  long,
  long,
  long,
  long,
  long,
  long,
  long,
  long,
  long,
  long,
  long,
  long,
  long,
  long,
  long,
  long,
  long,
  long,
  long,
  long,
  long,
  long,
  long,
  long,
  long,
  long,
  long,
  long,
  long,
  long,
  long,
  long,
  long,
  long,
  long,
  long,
  long,
  long,
  long,
  long,
  long,
  long,
  long])

In [33]:
len(stations)


Out[33]:
91

In [104]:
from scipy import *
import csv

def OSGB36toWGS84(E,N):

    #E, N are the British national grid coordinates - eastings and northings
    a, b = 6377563.396, 6356256.909 #The Airy 180 semi-major and semi-minor axes used for OSGB36 (m)
    F0 = 0.9996012717 #scale factor on the central meridian
    lat0 = 49*pi/180#Latitude of true origin (radians)
    lon0 = -2*pi/180#Longtitude of true origin and central meridian (radians)
    N0, E0 = -100000, 400000#Northing & easting of true origin (m)
    e2 = 1 - (b*b)/(a*a)#eccentricity squared
    n = (a-b)/(a+b)

    #Initialise the iterative variables
    lat,M = lat0, 0

    while N-N0-M >= 0.00001: #Accurate to 0.01mm
        lat = (N-N0-M)/(a*F0) + lat;
        M1 = (1 + n + (5/4)*n**2 + (5/4)*n**3) * (lat-lat0)
        M2 = (3*n + 3*n**2 + (21/8)*n**3) * sin(lat-lat0) * cos(lat+lat0)
        M3 = ((15/8)*n**2 + (15/8)*n**3) * sin(2*(lat-lat0)) * cos(2*(lat+lat0))
        M4 = (35/24)*n**3 * sin(3*(lat-lat0)) * cos(3*(lat+lat0))
        #meridional arc
        M = b * F0 * (M1 - M2 + M3 - M4)

        #transverse radius of curvature
        nu = a*F0/sqrt(1-e2*sin(lat)**2)
        #meridional radius of curvature
        rho = a*F0*(1-e2)*(1-e2*sin(lat)**2)**(-1.5)
        eta2 = nu/rho-1

        secLat = 1./cos(lat)
        VII = tan(lat)/(2*rho*nu)
        VIII = tan(lat)/(24*rho*nu**3)*(5+3*tan(lat)**2+eta2-9*tan(lat)**2*eta2)
        IX = tan(lat)/(720*rho*nu**5)*(61+90*tan(lat)**2+45*tan(lat)**4)
        X = secLat/nu
        XI = secLat/(6*nu**3)*(nu/rho+2*tan(lat)**2)
        XII = secLat/(120*nu**5)*(5+28*tan(lat)**2+24*tan(lat)**4)
        XIIA = secLat/(5040*nu**7)*(61+662*tan(lat)**2+1320*tan(lat)**4+720*tan(lat)**6)
        dE = E-E0

        lat = lat - VII*dE**2 + VIII*dE**4 - IX*dE**6
        lon = lon0 + X*dE - XI*dE**3 + XII*dE**5 - XIIA*dE**7
               
        #Convert to degrees
        lat = (lat*180)/pi
        lon = (lon*180)/pi

    return lat, lon

In [107]:
OSGB36toWGS84(340361.0,152168.0)
#OSGB36toWGS84(34.0361, 15.2168)
#   - E = 340361
#   - N = 152168


Out[107]:
(2937.1657722135997, -2.9862509524799017)

In [101]:
#stations[['Latitude', 'Longitude']] = stations[['Easting', 'Northing']].apply(OSGB36toWGS84())
stations['Latitude'] = stations[['Easting', 'Northing']].apply(OSGB36toWGS84)[0]

#stations['Longitude'] = stations[['Easting', 'Northing']].apply(OSGB36toWGS84)[1]


---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
<ipython-input-101-768c2087f745> in <module>()
      1 #stations[['Latitude', 'Longitude']] = stations[['Easting', 'Northing']].apply(OSGB36toWGS84())
----> 2 stations['Latitude'] = stations[['Easting', 'Northing']].apply(OSGB36toWGS84)[0]
      3 
      4 #stations['Longitude'] = stations[['Easting', 'Northing']].apply(OSGB36toWGS84)[1]

C:\Users\olihit\AppData\Local\Continuum\Anaconda\lib\site-packages\pandas\core\frame.pyc in apply(self, func, axis, broadcast, raw, reduce, args, **kwds)
   3716                     if reduce is None:
   3717                         reduce = True
-> 3718                     return self._apply_standard(f, axis, reduce=reduce)
   3719             else:
   3720                 return self._apply_broadcast(f, axis)

C:\Users\olihit\AppData\Local\Continuum\Anaconda\lib\site-packages\pandas\core\frame.pyc in _apply_standard(self, func, axis, ignore_failures, reduce)
   3806             try:
   3807                 for i, v in enumerate(series_gen):
-> 3808                     results[i] = func(v)
   3809                     keys.append(v.name)
   3810             except Exception as e:

<ipython-input-100-abc7e01590fa> in OSGB36toWGS84(df)
      3     longs=[]
      4     for station in range(1,len(df), 1):
----> 5         E = df['Easting'][station]
      6         N = df['Northing'][station]
      7 

C:\Users\olihit\AppData\Local\Continuum\Anaconda\lib\site-packages\pandas\core\series.pyc in __getitem__(self, key)
    519     def __getitem__(self, key):
    520         try:
--> 521             result = self.index.get_value(self, key)
    522 
    523             if not np.isscalar(result):

C:\Users\olihit\AppData\Local\Continuum\Anaconda\lib\site-packages\pandas\core\index.pyc in get_value(self, series, key)
   1593 
   1594         try:
-> 1595             return self._engine.get_value(s, k)
   1596         except KeyError as e1:
   1597             if len(self) > 0 and self.inferred_type in ['integer','boolean']:

pandas\index.pyx in pandas.index.IndexEngine.get_value (pandas\index.c:3113)()

pandas\index.pyx in pandas.index.IndexEngine.get_value (pandas\index.c:2844)()

pandas\index.pyx in pandas.index.IndexEngine.get_loc (pandas\index.c:3761)()

KeyError: ('Easting', u'occurred at index Easting')

In [95]:
stations['Latitude'] = stations.apply(lambda row: OSGB36toWGS84(row['Easting'], row['Northing'])[0], axis=1)


0.886230021758
<type 'long'>
50.77723086
<type 'long'>
0.881107438704
<type 'long'>
50.4836930133
<type 'long'>
0.880508864502
<type 'long'>
50.4494084301
<type 'long'>
0.880414404384
<type 'long'>
50.4439717267
<type 'long'>
0.892310761019
<type 'long'>
51.1256017496
<type 'long'>
0.891370829381
<type 'long'>
51.0715481276
<type 'long'>
0.8910326328
<type 'long'>
51.0523517659
<type 'long'>
0.879620511378
<type 'long'>
50.3984990555
<type 'long'>
0.881320301878
<type 'long'>
50.4958849513
<type 'long'>
0.876074422838
<type 'long'>
50.1954389611
<type 'long'>
0.879713706979
<type 'long'>
50.4038510083
<type 'long'>
0.876307944057
<type 'long'>
50.2088046757
<type 'long'>
0.885721068781
<type 'long'>
50.7480395701
<type 'long'>
0.890368921462
<type 'long'>
51.0141794743
<type 'long'>
0.880415408906
<type 'long'>
50.4440396887
<type 'long'>
0.886844025147
<type 'long'>
50.8123316508
<type 'long'>
0.886300408381
<type 'long'>
50.78120438
<type 'long'>
0.88276844339
<type 'long'>
50.5788863791
<type 'long'>
0.883080499543
<type 'long'>
50.5967648024
<type 'long'>
0.879240035023
<type 'long'>
50.3767311816
<type 'long'>
0.88509133093
<type 'long'>
50.711958774
<type 'long'>
0.879303450126
<type 'long'>
50.3803634062
<type 'long'>
0.888122140881
<type 'long'>
50.8855245091
<type 'long'>
0.8853092873
<type 'long'>
50.7244394396
<type 'long'>
0.885357967666
<type 'long'>
50.7272272206
<type 'long'>
0.885146429611
<type 'long'>
50.7151093987
<type 'long'>
0.883480366124
<type 'long'>
50.6196743408
<type 'long'>
0.884294418337
<type 'long'>
50.6663079405
<type 'long'>
0.875266206172
<type 'long'>
50.149146659
<type 'long'>
0.875224920964
<type 'long'>
50.1467829927
<type 'long'>
0.886359236785
<type 'long'>
50.7846113602
<type 'long'>
0.881639242824
<type 'long'>
50.5141526179
<type 'long'>
0.875874078571
<type 'long'>
50.1839671217
<type 'long'>
0.893886024475
<type 'long'>
51.2158480706
<type 'long'>
0.886531991472
<type 'long'>
50.7945170094
<type 'long'>
0.879499558345
<type 'long'>
50.3916050932
<type 'long'>
0.879437945366
<type 'long'>
50.3880670914
<type 'long'>
0.888965338348
<type 'long'>
50.9338154236
<type 'long'>
0.887586015763
<type 'long'>
50.8548255576
<type 'long'>
0.875848987592
<type 'long'>
50.1825311727
<type 'long'>
0.875755712404
<type 'long'>
50.1771910177
<type 'long'>
0.88043189179
<type 'long'>
50.4449844134
<type 'long'>
0.87890324618
<type 'long'>
50.3574325223
<type 'long'>
0.879739639184
<type 'long'>
50.4053273136
<type 'long'>
0.879440625703
<type 'long'>
50.3881992028
<type 'long'>
0.884188605067
<type 'long'>
50.6602463543
<type 'long'>
0.883945370258
<type 'long'>
50.646312598
<type 'long'>
0.880071950937
<type 'long'>
50.4243719975
<type 'long'>
0.887148103032
<type 'long'>
50.8297464367
<type 'long'>
0.881874767612
<type 'long'>
50.5276823519
<type 'long'>
0.879877696267
<type 'long'>
50.4132122142
<type 'long'>
0.886224093143
<type 'long'>
50.7768391027
<type 'long'>
0.884935256716
<type 'long'>
50.7030177707
<type 'long'>
0.885412160603
<type 'long'>
50.7302823995
<type 'long'>
0.880220034182
<type 'long'>
50.4328887076
<type 'long'>
0.878835224177
<type 'long'>
50.3535295581
<type 'long'>
0.875259629634
<type 'long'>
50.1487713164
<type 'long'>
0.874759719119
<type 'long'>
50.1201734187
<type 'long'>
0.876415122372
<type 'long'>
50.214937546
<type 'long'>
0.885506405716
<type 'long'>
50.7357376162
<type 'long'>
0.879227720376
<type 'long'>
50.3760266184
<type 'long'>
0.885392954501
<type 'long'>
50.7292353471
<type 'long'>
0.889330409986
<type 'long'>
50.9547166141
<type 'long'>
0.875615121376
<type 'long'>
50.169128444
<type 'long'>
0.87968512853
<type 'long'>
50.4021878196
<type 'long'>
0.879937847396
<type 'long'>
50.4166703039
<type 'long'>
0.876705931786
<type 'long'>
50.231591309
<type 'long'>
0.886070126417
<type 'long'>
50.7679762867
<type 'long'>
0.879742782308
<type 'long'>
50.4055268103
<type 'long'>
0.879383396617
<type 'long'>
50.384932719
<type 'long'>
0.878559460583
<type 'long'>
50.3377344369
<type 'long'>
0.879638747911
<type 'long'>
50.3995686625
<type 'long'>
0.879649535767
<type 'long'>
50.4001865605
<type 'long'>
0.87959185392
<type 'long'>
50.3968509027
<type 'long'>
0.875611197778
<type 'long'>
50.1689172267
<type 'long'>
0.879514594838
<type 'long'>
50.3924529418
<type 'long'>
0.876283635553
<type 'long'>
50.2074173889
<type 'long'>
0.885390773278
<type 'long'>
50.7291085322
<type 'long'>
0.880016333108
<type 'long'>
50.4211838867
<type 'long'>
0.883587868978
<type 'long'>
50.6258308457
<type 'long'>
0.890486893219
<type 'long'>
51.0210999131
<type 'long'>
0.88219704528
<type 'long'>
50.5461503812
<type 'long'>
0.888635667226
<type 'long'>
50.91501518
<type 'long'>
0.884606877106
<type 'long'>
50.6842064256
<type 'long'>
0.880680783714
<type 'long'>
50.4592847364
<type 'long'>
0.880891051199
<type 'long'>
50.4713303605
<type 'long'>
0.880240035385
<type 'long'>
50.434030274
<type 'long'>
0.877239469242
<type 'long'>
50.2621408639
<type 'long'>
0.890023749018
<type 'long'>
50.9944201191
<type 'long'>
0.88603393631
<type 'long'>
50.7659691237
<type 'long'>
0.886189148817
<type 'long'>
50.7748216955
<type 'long'>

In [99]:
stations


Out[99]:
Unnamed: 0 AtcoCode TiplocCode CrsCode StationName StationNameLang GridType Easting Northing CreationDateTime ModificationDateTime RevisionNumber Modification Latitude
0 123 9100AXMNSTR AXMNSTR AXM Axminster Rail Station NaN U 329260 98225 2003-11-04T00:00:00 2010-10-06T16:42:54 2 rev 2909.321024
1 191 9100BEREALS BEREALS BAS Bere Alston Rail Station NaN U 244000 67400 2003-11-04T00:00:00 2006-09-18T18:24:34 1 rev 2892.502544
2 192 9100BEREFRS BEREFRS BFE Bere Ferrers Rail Station NaN U 245230 63545 2003-11-04T00:00:00 2010-10-06T16:42:54 2 rev 2890.538182
3 276 9100BODMNPW BODMNPW BOD Bodmin Parkway Rail Station NaN U 211030 64058 2003-11-04T00:00:00 2006-09-18T18:24:34 1 rev 2890.226682
4 310 9100BRDGWTR BRDGWTR BWT Bridgwater Rail Station NaN U 330790 136975 2003-11-04T00:00:00 2010-07-26T14:38:35 3 rev 2929.281205
5 352 9100BRNSTPL BRNSTPL BNP Barnstaple Rail Station NaN U 255561 132541 2003-11-04T00:00:00 2007-02-13T17:06:21 3 rev 2926.184161
6 389 9100BSPSLYD BSPSLYD BIB Bishop's Lydeard NaN U 316388 129039 2007-11-07T00:00:00 2010-10-13T15:31:21 1 rev 2925.084290
7 401 9100BUGLE BUGLE BGL Bugle Rail Station NaN U 201670 59335 2003-11-04T00:00:00 2011-09-30T14:47:28 2 rev 2887.621290
8 422 9100CALSTCK CALSTCK CSK Calstock Rail Station NaN U 243428 68775 2003-11-04T00:00:00 2011-09-30T14:47:28 2 rev 2893.201090
9 428 9100CARBISB CARBISB CBB Carbis Bay Rail Station NaN U 152930 38745 2003-11-04T00:00:00 2011-09-30T14:47:28 5 rev 2875.986803
10 443 9100CAUSLND CAUSLND CAU Causeland Rail Station NaN U 224830 59110 2003-11-04T00:00:00 2006-09-18T18:24:34 1 rev 2887.927934
11 448 9100CBORNE CBORNE CBN Camborne Rail Station NaN U 164830 39696 2003-11-04T00:00:00 2006-09-18T18:24:34 2 rev 2876.752602
12 449 9100CBRK CBRK CBK Cranbrook Rail Station NaN U 299891 95461 2015-01-29T14:41:00 2015-01-29T14:41:00 1 rev 2907.648486
13 461 9100CHAPLTN CHAPLTN CPN Chapelton (Devon) Rail Station NaN U 258075 126080 2003-11-04T00:00:00 2010-10-06T16:42:54 2 rev 2922.897179
14 579 9100COOMBE COOMBE COE Coombe Junction Halt (Rail Station) NaN U 223885 63619 2005-04-04T00:00:00 2009-07-22T15:04:16 2 rev 2890.230576
15 580 9100COPLSTN COPLSTN COP Copplestone Rail Station NaN U 276700 103120 2003-11-04T00:00:00 2006-09-18T18:24:34 1 rev 2911.332151
16 599 9100CREDITN CREDITN CDI Crediton Rail Station NaN U 284005 99485 2003-11-04T00:00:00 2010-10-06T16:42:54 2 rev 2909.548690
17 672 9100DAWLISH DAWLISH DWL Dawlish Rail Station NaN U 296400 76700 2003-11-04T00:00:00 2006-09-18T18:24:34 2 rev 2897.956722
18 673 9100DAWLSHW DAWLSHW DWW Dawlish Warren Rail Station NaN U 297930 78660 2003-11-04T00:00:00 2010-10-06T16:42:54 2 rev 2898.981080
19 687 9100DEVNPRT DEVNPRT DPT Devonport Rail Station NaN U 245755 55435 2003-11-04T00:00:00 2010-10-06T16:42:54 2 rev 2886.374082
20 691 9100DIGBY DIGBY DIG Digby & Sowton Rail Station NaN U 296062 91520 2003-11-04T00:00:00 2010-10-06T16:42:54 2 rev 2905.581209
21 715 9100DOCKYDP DOCKYDP DOC Dockyard (Plymouth) Rail Station NaN U 245398 55850 2005-04-04T00:00:00 2010-10-06T16:42:54 2 rev 2886.582194
22 791 9100EGGESFD EGGESFD EGG Eggesford Rail Station NaN U 268230 111480 2003-11-04T00:00:00 2006-09-18T18:24:34 1 rev 2915.525793
23 844 9100EXETERC EXETERC EXC Exeter Central Rail Station NaN U 291875 92995 2003-11-04T00:00:00 2009-01-19T13:00:36 2 rev 2906.296298
24 845 9100EXETRSD EXETRSD EXD Exeter St Davids Rail Station NaN U 291175 93320 2003-11-04T00:00:00 2009-07-22T15:06:57 3 rev 2906.456026
25 846 9100EXETRST EXETRST EXT Exeter St Thomas Rail Station NaN U 291461 91965 2003-11-04T00:00:00 2009-06-19T14:22:45 2 rev 2905.761726
26 848 9100EXMOUTH EXMOUTH EXM Exmouth Rail Station NaN U 300002 81170 2003-11-04T00:00:00 2006-09-18T18:24:34 1 rev 2900.293700
27 849 9100EXTON EXTON EXN Exton Rail Station NaN U 298043 86399 2003-11-04T00:00:00 2006-09-18T18:24:34 1 rev 2902.965609
28 855 9100FALMTHD FALMTHD FAL Falmouth Docks Rail Station NaN U 181777 32322 2005-03-17T00:00:00 2006-09-18T18:24:34 1 rev 2873.334450
29 856 9100FALMTHT FALMTHT FMT Falmouth Town Rail Station NaN U 181130 32085 2003-11-04T00:00:00 2011-09-30T14:47:28 4 rev 2873.199022
... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
61 1828 9100POLSBDG POLSBDG POL Polsloe Bridge Rail Station NaN U 294097 93483 2005-04-04T00:00:00 2009-01-19T13:00:36 2 rev 2906.571083
62 1848 9100PRTSMTA PRTSMTA PMA Portsmouth Arms Rail Station NaN U 263100 119320 2005-03-18T00:00:00 2006-09-18T18:24:34 1 rev 2919.490208
63 1851 9100PRYN PRYN PYN Penryn Rail Station NaN U 177900 34710 2005-04-04T00:00:00 2011-09-30T14:47:28 2 rev 2874.479322
64 1885 9100QNTRLDW QNTRLDW QUI Quintrell Downs Rail Station NaN U 184890 60405 2003-11-04T00:00:00 2011-09-30T14:47:28 3 rev 2887.832640
65 1904 9100RCHE RCHE ROC Roche Rail Station NaN U 199040 61460 2005-04-04T00:00:00 2011-09-30T14:47:28 2 rev 2888.662426
66 1924 9100REDRUTH REDRUTH RED Redruth Rail Station NaN U 170040 42009 2003-11-04T00:00:00 2007-02-13T17:06:21 3 rev 2878.058180
67 1994 9100SAMPCRT SAMPCRT SMC Sampford Courtenay Rail Station NaN U 262670 98535 2009-06-18T15:01:50 2010-10-06T16:42:54 1 rev 2908.790776
68 1999 9100SASH SASH STS Saltash Rail Station NaN U 243120 58720 2003-11-04T00:00:00 2007-02-13T17:06:21 3 rev 2888.023950
69 2019 9100SDPLACE SDPLACE SDP Sandplace Rail Station NaN U 224900 57000 2003-11-04T00:00:00 2006-09-18T18:24:34 1 rev 2886.843996
70 2158 9100STAUSTL STAUSTL SAU St Austell Rail Station NaN U 201611 52565 2003-11-04T00:00:00 2007-02-13T17:06:21 3 rev 2884.139733
71 2160 9100STBDXFR STBDXFR SBF St Budeaux Ferry Road Rail Station NaN U 244685 58010 2003-11-04T00:00:00 2010-10-06T16:42:54 2 rev 2887.682574
72 2161 9100STBDXVR STBDXVR SBV St Budeaux Victoria Road Rail Station NaN U 244645 58080 2003-11-04T00:00:00 2010-10-06T16:42:54 2 rev 2887.717977
73 2164 9100STCLMBR STCLMBR SCR St Columb Road Rail Station NaN U 191100 59560 2003-11-04T00:00:00 2011-09-30T14:47:28 2 rev 2887.526857
74 2171 9100STERTH STERTH SER St Erth Rail Station NaN U 154150 35730 2003-11-04T00:00:00 2007-02-13T17:06:21 3 rev 2874.467220
75 2176 9100STGRMNS STGRMNS SGM St Germans Rail Station NaN U 236020 57480 2003-11-04T00:00:00 2006-09-18T18:24:34 1 rev 2887.274873
76 2189 9100STIVES STIVES SIV St Ives (Cornwall) Rail Station NaN U 151947 40127 2005-04-04T00:00:00 2011-09-30T14:47:28 4 rev 2876.673117
77 2190 9100STJAMSP STJAMSP SJP St James Park (Devon) Rail Station NaN U 292682 93498 2005-04-04T00:00:00 2009-01-19T13:00:36 2 rev 2906.563817
78 2193 9100STKEYNE STKEYNE SKN St Keyne Wishing Well Halt (Rail Station) NaN U 225102 61032 2005-04-04T00:00:00 2009-07-22T15:02:21 2 rev 2888.921035
79 2221 9100STRCROS STRCROS SCS Starcross Rail Station NaN U 297700 81900 2003-11-04T00:00:00 2007-02-13T17:06:21 3 rev 2900.646442
80 2281 9100TAUNTON TAUNTON TAU Taunton Rail Station NaN U 322755 125460 2003-11-04T00:00:00 2010-07-26T14:38:49 2 rev 2923.293691
81 2286 9100TEINMTH TEINMTH TGM Teignmouth Rail Station NaN U 294200 73100 2003-11-04T00:00:00 2007-02-13T17:06:21 3 rev 2896.081087
82 2316 9100TIVIPW TIVIPW TVP Tiverton Parkway Rail Station NaN U 304520 113960 2003-11-04T00:00:00 2010-10-06T16:42:54 2 rev 2917.215484
83 2330 9100TOPSHAM TOPSHAM TOP Topsham Rail Station NaN U 296646 88419 2003-11-04T00:00:00 2009-01-19T13:00:36 2 rev 2903.991116
84 2331 9100TORQUAY TORQUAY TQY Torquay Rail Station NaN U 290555 63505 2003-11-04T00:00:00 2010-10-06T16:42:54 2 rev 2891.104053
85 2332 9100TORRE TORRE TRR Torre Rail Station NaN U 290360 64850 2003-11-04T00:00:00 2006-09-18T18:24:34 1 rev 2891.794216
86 2333 9100TOTNES TOTNES TOT Totnes Rail Station NaN U 280170 60920 2003-11-04T00:00:00 2007-02-13T17:06:21 3 rev 2889.657079
87 2347 9100TRURO TRURO TRU Truro Rail Station NaN U 181667 44924 2003-11-04T00:00:00 2007-02-13T17:06:21 3 rev 2879.808541
88 2372 9100UMBRLGH UMBRLGH UMB Umberleigh Rail Station NaN U 260950 123800 2003-11-04T00:00:00 2006-09-18T18:24:34 1 rev 2921.765052
89 2474 9100WHIMPLE WHIMPLE WHM Whimple Rail Station NaN U 304590 97368 2003-11-04T00:00:00 2006-09-18T18:24:34 1 rev 2908.675774
90 2606 9100YEOFORD YEOFORD YEO Yeoford Rail Station NaN U 278325 98905 2003-11-04T00:00:00 2010-10-06T16:42:54 2 rev 2909.182989

91 rows × 14 columns


In [ ]: