Skip to content

Instantly share code, notes, and snippets.

import pyproj
""" This function will take Ordnance Survey (British National Grid) positional data and
return latitude, longitude in wgs84 used by google maps and others. """
def bng_to_wgs84(Easting, Northing):
# Define two projections, one for the British National Grid and one for WGS84 (Lat/Lon)
# You can use the full PROJ4 definition or the EPSG identifier (PROJ4 uses a file that matches the two)
#bng = Proj("+proj=tmerc +lat_0=49 +lon_0=-2 +k=0.9996012717 +x_0=400000 +y_0=-100000 +ellps=airy +datum=OSGB36 +units=m +no_defs towgs84='446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894'")