osbng.bng_reference.BNGReference.bng_to_children#

BNGReference.bng_to_children(*, resolution: int | str | None = None) list[BNGReference][source]#

Returns a list of child BNGReference objects of this BNGReference.

By default, the children of the BNGReference object is defined as the BNGReference objects in the next resolution down from the current BNGReference resolution. For example, 100km -> 50km.

Notes

Any valid resolution can be provided as the child resolution, provided it is less than the resolution of the current BNGReference object.

Keyword Arguments:

resolution (int | str | None, optional) – The resolution of the children BNGReference objects expressed either as a metre-based integer or as a string label. Defaults to None.

Returns:

A list of BNGReference objects that are children of the

current BNGReference object.

Return type:

list[BNGReference]

Raises:

Examples

>>> BNGReference("SU").bng_to_children()
[BNGReference(bng_ref_formatted=SU SW, resolution_label=50km),
BNGReference(bng_ref_formatted=SU SE, resolution_label=50km),
BNGReference(bng_ref_formatted=SU NW, resolution_label=50km),
BNGReference(bng_ref_formatted=SU NE, resolution_label=50km)]
>>> BNGReference("SU36").bng_to_children()
[BNGReference(bng_ref_formatted=SU 3 6 SW, resolution_label=5km),
BNGReference(bng_ref_formatted=SU 3 6 SE, resolution_label=5km),
BNGReference(bng_ref_formatted=SU 3 6 NW, resolution_label=5km),
BNGReference(bng_ref_formatted=SU 3 6 NE, resolution_label=5km)]

See also

The equivalent osbng.hierarchy.bng_to_children() function.