as_bng_reference {osbng} | R Documentation |
Create BNG reference objects
Description
Convert or test user input (strings) to a custom object for handling British National Grid (BNG) references.
Usage
as_bng_reference(bng_ref, ...)
## Default S3 method:
as_bng_reference(bng_ref, ...)
## S3 method for class 'BNGReference'
as_bng_reference(bng_ref, ...)
## S3 method for class 'character'
as_bng_reference(bng_ref, ...)
is_bng_reference(bng_ref)
Arguments
bng_ref |
A character vector of grid references to be created or tested. |
... |
Additional parameters. Not currently used. |
Details
Converts a BNG reference string into a BNGReference
object, ensuring
type consistency across the package. All functions accepting or returning BNG
references enforce the use of this class.
The BNG is structured using a hierarchical system of grid squares at various resolutions. At its highest level, the grid is divided into 100 km by 100 km squares, each of which is identified by a two-letter code. Successive levels of resolution further subdivide the grid squares into finer detail, down to individual 1-meter squares.
The package supports the 'standard' and 'intermediate' quadtree resolutions: 100km, 50km, 10km, 5km, 1km, 500m, 100m, 50m, 10m, 5m and 1m.
Value
An object of type BNGReference
.
See Also
Examples
as_bng_reference("TQ1234")
as_bng_reference(c("TQ1234", "SU5678"))