bng_neighbours {osbng} | R Documentation |
Identify neighbouring grid squares
Description
Find BNG references which share a grid cell edge with a target BNG reference.
Usage
bng_neighbours(bng_ref, ...)
bng_is_neighbour(bng_ref1, bng_ref2, ...)
Arguments
bng_ref |
target object of type |
... |
additional parameters. Not currently used |
bng_ref1 , bng_ref2 |
|
Details
Grid references are "neighbours" when they share a contiguous
edge (i.e. corners do not define neighbours). In the event that a target
reference is along the edge or corner of the valid BNG area, then 3 or 2
references, respectively, will be returned bng_is_neighbour
only
compares references of equal resolution.
If bng_ref1
exactly matches bng_ref2
then
bng_is_neighbour
returns FALSE
.
Value
A list containing a set of up to four BNGReference
objects
that border the target reference.
a boolean identifying if the grid references share a border
Examples
bng_neighbours(as_bng_reference("SU1234"))
bng_is_neighbour(as_bng_reference("SE1921"), as_bng_reference("SE1821"))
bng_is_neighbour(as_bng_reference("SE1922"), as_bng_reference("SE1821"))
bng_is_neighbour(as_bng_reference("SU1234"), as_bng_reference("SU1234"))