In [1]:
import numpy as np
from pyproj import Proj, transform
from convertbng.cutil import convert_bng
In [2]:
wgs84 = Proj(init='epsg:4326')
# only works if you can put the ntv2 file somewhere
osgb36_ostn02 = Proj('+init=EPSG:27700 +nadgrids=OSTN02_NTv2.gsb')
# Specifying the Helmert params manually, and specifying the shift file
osgb36_b = Proj('+proj=tmerc +lat_0=49 +lon_0=-2 +k=0.9996012717 +x_0=400000 +y_0=-100000 +ellps=airy +units=m +no_defs +nadgrids=OSTN02_NTv2.gsb')
osgb36 = Proj(init='epsg:27700')
In [3]:
lon = np.array([1.716073973])
lat = np.array([52.65800783])
In [4]:
convert_bng(lon, lat)
Out[4]:
In [5]:
transform(wgs84, osgb36_ostn02, lon, lat)
Out[5]:
In [6]:
transform(wgs84, osgb36, lon, lat)
Out[6]:
In [7]:
transform(wgs84, osgb36_b, lon, lat)
Out[7]:
In [ ]: