osbng.bng_reference.BNGReference#

class osbng.bng_reference.BNGReference(bng_ref_string: str)[source]#

Initialises a BNGReference from a BNG reference string.

__init__(bng_ref_string: str)[source]#

Initialises a BNGReference from a BNG reference string.

Methods

__init__(bng_ref_string)

Initialises a BNGReference from a BNG reference string.

bng_distance(bng_ref2, *[, edge_to_edge])

Returns the euclidean distance between bng_ref2 and this BNGReference.

bng_dwithin(d)

Returns all BNGReference objects within distance d of this BNGReference.

bng_is_neighbour(bng_ref2)

Tests whether bng_ref2 is a neighbour of this BNGReference.

bng_kdisc(k, *[, return_relations])

Returns a filled disc of BNGReference objects around this BNGReference.

bng_kring(k, *[, return_relations])

Returns a hollow ring of BNGReference objects around this BNGReference.

bng_neighbours()

Returns the four BNGReference object neighbours to this BNGReference.

bng_to_bbox()

Returns grid square bounding box coordinates of this BNGReference.

bng_to_children(*[, resolution])

Returns a list of child BNGReference objects of this BNGReference.

bng_to_grid_geom()

Returns a grid square as a Shapely Polygon of this BNGReference.

bng_to_parent(*[, resolution])

Returns the BNGReference that is the parent of this BNGReference.

bng_to_xy(*[, position])

Returns easting and northing coordinates of this BNGReference.

Attributes

bng_ref_compact

The BNG reference string of this BNGReference with whitespace removed.

bng_ref_formatted

The BNG reference string of this BNGReference in pretty format.

resolution_label

The resolution of this BNGReference expressed as a string label.

resolution_metres

The resolution of this BNGReference in meters.