Skip to main content

Encode and decode British National Grid References

Project description

Encode and decode British National Grid References

The Ordnance Survey encodes the coordinate of map tiles with names such as HU396753 (see the British National Gird page on Wikipedia).

This Python package has to encode and decode such references:

  • decoding: given a tile name, get the coordinates of the tile in the EPSG 27700 coordinate system;
  • encoding: given the coordinates of a point, get the name of the tiles that contain it;

Examples

To decode a tile name:

$ python -m os_grid_reference.ngr_decode HU396753 
{
    "sw_easting": 439600.0,
    "sw_northing": 1175300.0,
    "ne_easting": 439700.0,
    "ne_northing": 1175400.0,
    "size": 100.0
}

To find the 100m tile containing a point:

$ python -m os_grid_reference.ngr_encode --easting 439600.0 --northing 1175300.0 --size 100m
HU396753

See also

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

os-grid-reference-0.4.0.tar.gz (4.5 kB view hashes)

Uploaded Source

Built Distribution

os_grid_reference-0.4.0-py3-none-any.whl (6.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page