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 details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

Details for the file os-grid-reference-0.4.0.tar.gz.

File metadata

  • Download URL: os-grid-reference-0.4.0.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.1

File hashes

Hashes for os-grid-reference-0.4.0.tar.gz
Algorithm Hash digest
SHA256 21f391c8297db495d6fef433d73fe1dc84c4fec038684dc9173bc338e7a9e0af
MD5 944182e15c0a06fffc22b655ad9bd9bc
BLAKE2b-256 f8c39fbb27bcec420869f9af5baefec87bf924c863d86d16d1664a2a1e543106

See more details on using hashes here.

File details

Details for the file os_grid_reference-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: os_grid_reference-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 6.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.1

File hashes

Hashes for os_grid_reference-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2d6f6001072fcea9657ce82a9eaa9fe688c491c288876566bf64e51361b9c198
MD5 30e38e5e7a85eeb03d98953cfddc702a
BLAKE2b-256 fd258a7435b425c66b3d923f5025efc1a1c33dd4c636cc318ba3fd112e98a217

See more details on using hashes here.

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