1

How can I convert Ordnance Survey six-digit codes to the latlng bounding box of the related 1km grid square?

For example, NH0325: according to Wikipedia this means a 1km square whose south-west corner is 3 km east and 25 km north from the south-west corner of square NH.

Could anyone point me at some code for converting this code to its 1km grid square, ideally in Python?

I already have Paul Agapow's OSGB library - I think this returns the south-west corner of the grid square, in OSGB36 coordinates. I could potentially use this to find the north-east corner, but I don't know how.

I'm displaying the results on an WGS84 map, so it would be better to have the results in WGS84, if possible.

This is all far beyond my knowledge of map projections. Any suggestions very much appreciated.

1

If you know the SE corner then the NE corner is just those coordinates + 1000 since OSGB coordinates are in meters (and 1000m is 1km). Given the corners of a bounding box in OSGB(EPGS:27700) there are many ways to do the reprojection.

You don't say if you have any preferred GIS software but they should all be able to handle the transform. If you don't have a package already installed then you might want to look at proj.4's cs2cs.

0

I'm not quite sure what you are trying to do, but if you wish to convert OS grid references (like 'NH0325') to WGS84 lat/lon coordinates this will be a two-stage process.

Firstly convert the OS grid references to OS coordinates using NGConv, which you can download from here: http://digimap.edina.ac.uk/webhelp/os/data_information/os_data_issues/ng_converter.htm.

Once you have the OS coordinates you can then transform these to WGS84 lat/lon (I'm assuming that you know how to do this).

N.

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.