osbng.bng_reference.BNGReference.bng_neighbours#

BNGReference.bng_neighbours() list[BNGReference][source]#

Returns the four BNGReference object neighbours to this BNGReference.

The neighbours are defined as the grid squares immediately North, East, South and West of the input grid square sharing an edge with the input BNGReference object.

Returns:

The grid squares immediately North, South, East and West of this BNGReference object.

Return type:

list[BNGReference]

Examples

>>> BNGReference("SU1234").bng_neighbours()
[BNGReference('SU1235'), BNGReference('SU1334'),
BNGReference('SU1233'), BNGReference('SU1134')]

See also

The equivalent osbng.traversal.bng_neighbours() function.