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
- a similar utility from Edina Digimap: NGConf
- a collection of Shapefiles representing the tiles: OSGB Grids
Release files for os-grid-reference 0.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| os-grid-reference-0.4.0.tar.gz | 4.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| os_grid_reference-0.4.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 11.2 kB
Release files / os-grid-reference-0.4.0.tar.gz
| Download URL | os-grid-reference-0.4.0.tar.gz |
|---|---|
| Size | 4.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
21f391c8297db495d6fef433d73fe1dc84c4fec038684dc9173bc338e7a9e0af
|
|
BLAKE2b-256 checksum How to use checksums |
f8c39fbb27bcec420869f9af5baefec87bf924c863d86d16d1664a2a1e543106
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|
Release files / os_grid_reference-0.4.0-py3-none-any.whl
| Download URL | os_grid_reference-0.4.0-py3-none-any.whl |
|---|---|
| Size | 6.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2d6f6001072fcea9657ce82a9eaa9fe688c491c288876566bf64e51361b9c198
|
|
BLAKE2b-256 checksum How to use checksums |
fd258a7435b425c66b3d923f5025efc1a1c33dd4c636cc318ba3fd112e98a217
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|