bng_to_geom | R Documentation |
Convert a valid British National Grid (BNG) grid reference string into a grid square with the resolution implied by the length of the reference string.
bng_to_geom(grid_ref, returnType = c("wkt", "geojson", "geos", "sf"))
grid_ref |
(character) BNG grid reference (required). |
returnType |
(character) Representation for the returned geometry.
Choose |
The National Grid is a unique reference system that covers Great Britain in a series of grid squares at multiple scales. Grid references begin with 2 letters to identify 100km squares followed by a series of digits to identify quadrants nested within. For more information, see https://www.ordnancesurvey.co.uk/documents/resources/guide-to-nationalgrid.pdf
The purpose of this function is to generate geometries based on the extent of the grid square which can be used as spatial filters in OS Data Hub API queries.
Note that all geometries returned will have a coordinate reference system
(CRS) of a EPSG:27700. The sf
package must be installed in order to
return an object of class sf
.
The coordinates of the grid square boundary in either Well-Known
Text (WKT) format, GeoJSON format, an object of class geos
or as a
Simple Features object of class sf
.
extent_from_bng()
bng_to_geom('TL63')
bng_to_geom('TL683365', returnType = 'geojson')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.