osbng.bng_reference.BNGReference.bng_to_children#
- BNGReference.bng_to_children(*, resolution: int | str | None = None) list[BNGReference][source]#
Returns a list of child
BNGReferenceobjects of thisBNGReference.By default, the children of the
BNGReferenceobject is defined as theBNGReferenceobjects in the next resolution down from the currentBNGReferenceresolution. 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
BNGReferenceobject.- Keyword Arguments:
resolution (int | str | None, optional) – The resolution of the children
BNGReferenceobjects 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
BNGReferenceobject.
- Return type:
- Raises:
BNGHierarchyError – If the resolution of the current
BNGReferenceobject is 1m.BNGHierarchyError – If the resolution is greater than or equal to the resolution of the current
BNGReferenceobject.BNGResolutionError – If an invalid resolution is provided.
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.