Skip to content

Instantly share code, notes, and snippets.

@samuelleach
Created November 14, 2015 18:32
Show Gist options
  • Save samuelleach/69cdb9c6493f8900ca09 to your computer and use it in GitHub Desktop.
Save samuelleach/69cdb9c6493f8900ca09 to your computer and use it in GitHub Desktop.
Convert Eastings/Northings to lon lat
import pyproj as pyproj
import pandas as pd
import numpy as np
df = pd.read_csv('SCOOT_Detectors.csv')
osgb36 = pyproj.Proj("+init=EPSG:27700")
eastnorth = np.apply_along_axis(func1d=lambda x: osgb36(x[0],x[1], inverse=True), arr=df[['EASTING', 'NORTHING']].values, axis=1)
df['lon'] = eastnorth[:,0]
df['lat'] = eastnorth[:,1]
df.to_csv('SCOOT_Detectors_lonlat.csv')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment