British National Grid utilities¶
This page lists methods for working with British National Grid (bng) coordinates.
Alphabetical list:
Coordinates¶
- class nevis.Coords(gridx=None, gridy=None, normx=None, normy=None)[source]¶
Coordinates, either normalised (so that 0, 0 is the bottom left of the grid and 1, 1 is the top right) or as OS36GB grid points in meters.
Examples:
p = nevis.Coords(gridx=123456, gridy=123456) print(p.grid) print(p.normalised) p = nevis.Coords(normx=0.5, normy=0.2) print(p.grid) print(p.normalised) b = nevis.ben() print(b.square) print(b.geograph)
- static from_square(square)[source]¶
Creates coordinates corresponding to the lower-left corner of a grid square indicated by letters and numbers, e.g.
NN166712
orNN 166 712
.
- static from_square_with_size(square)[source]¶
Like
from_square()
but returns a tuple(coords, size)
wheresize
is the length of the square’s sides.
- nevis.macdui()[source]¶
Returns a tuple
(hill, boundaries)
containing theHill
object for Ben Macdui and boundaries(x_lower, x_upper, y_lower, y_upper)
defining its neighbourhood, Cairngorms Mountains.This can be used as an easier test problem for local methods.
Hills¶
- class nevis.Hill(x, y, rank, height, hill_id, name)[source]¶
Known hill tops.
Examples:
print(Hill.by_name('Ben Nevis')) print(Hill.by_rank(1)) print(Hill.by_rank(2)) print(Hill.by_rank(3)) h, d = Hill.nearest(Coords(gridx=216600, gridy=771300)) print(h)
- static by_rank(rank)[source]¶
Return the hill with the given
rank
(rank 1 is heighest, then 2, etc.).