2

I'm using pyproj to convert some coordinates from WGS84 to OSGB36. When mapped out the converted and unconverted don't map to the same places on a map. The OSGB36 coordinates are mapped about 100 meters north west of where they ought to be.

Does anyone know what might be wrong here?

Here's an example of what I'm doing in code

import pyproy
wgs84=pyproj.Proj("+init=EPSG:4326")
osgb36=pyproj.Proj("+init=EPSG:27700")
row = pyproj.transform(wgs84, osgb36, lng, lat)
0

I would recommend upgrading to pyproj 2.2.0 as it should take into account the datum shifts.

https://pyproj4.github.io/pyproj/v2.2.0rel/examples.html

>>> import pyproj
>>> pyproj.__version__
'2.2.0'
>>> pyproj.CRS("EPSG:27700")
<Projected CRS: EPSG:27700>
Name: OSGB 1936 / British National Grid
Axis Info [cartesian]:
- E[east]: Easting (metre)
- N[north]: Northing (metre)
Area of Use:
- name: UK - Britain and UKCS 49°46'N to 61°01'N, 7°33'W to 3°33'E
- bounds: (-9.2, 49.75, 2.88, 61.14)
Coordinate Operation:
- name: British National Grid
- method: Transverse Mercator
Datum: OSGB 1936
- Ellipsoid: Airy 1830
- Prime Meridian: Greenwich

>>> transformer = pyproj.Transformer.from_crs("EPSG:4326", "EPSG:27700")
>>> transformer.transform(2, 50)
(7200256.173104358, -5167123.170735249)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.