Skip to content

Instantly share code, notes, and snippets.

@phil8192
Created April 12, 2017 14:16
Show Gist options
  • Save phil8192/9c4906897e9d21a5cb10e74b63ec9cd7 to your computer and use it in GitHub Desktop.
Save phil8192/9c4906897e9d21a5cb10e74b63ec9cd7 to your computer and use it in GitHub Desktop.
BNG to WGS84
# http://www.bgs.ac.uk/data/webservices/convertForm.cfm#convertToLatLng
import pyproj
x, y = (383772, 800512)
p1 = pyproj.Proj(init='EPSG:27700')
p2 = pyproj.Proj(init='EPSG:4326')
lng, lat = pyproj.transform(p1, p2, x, y)
assert(abs(float(lng) - -2.26944714111) <= 10**-6 and abs(float(lat) - 57.0953024029) <= 10**-6)
print((lat, lng))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment