Skip to content

Instantly share code, notes, and snippets.

@faph
Last active November 17, 2015 08:36
Show Gist options
  • Save faph/3c18ef0b562efcb40889 to your computer and use it in GitHub Desktop.
Save faph/3c18ef0b562efcb40889 to your computer and use it in GitHub Desktop.
UK CRSs to WGS84 transformation
import pyproj
COORDS = {
# OSGB_1936_To_WGS_1984_Petroleum transformation
'gb': pyproj.Proj('+proj=tmerc +lat_0=49 +lon_0=-2 +k=0.9996012717 +x_0=400000 +y_0=-100000 +ellps=airy ' +
'+towgs84=446.448000,-125.157000,542.060000,0.150000,0.247000,0.842000,-20.489000 ' +
'+units=m +no_defs'),
# TM75_To_WGS_1984_2 transformation
'ni': pyproj.Proj('+proj=tmerc +lat_0=53.5 +lon_0=-8 +k=1.000035 +x_0=200000 +y_0=250000 +ellps=mod_airy ' +
'+towgs84=482.530000,-130.596000,564.557000,-1.042000,-0.214000,-0.631000,8.150000 ' +
'+units=m +no_defs'),
'wgs84': pyproj.Proj(init='epsg:4326')
}
E = 123456
N = 789012
lon, lat = pyproj.transform(COORDS['gb'], COORDS['wgs84'], E, N)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment