gridsquare_geometry | R Documentation |
This function converts a grid reference to its square polygon geometry feature through conversion to well-known text.
gridsquare_geometry(x)
## S3 method for class 'gridref'
gridsquare_geometry(grid_reference)
grid_reference |
A Great British or Irish grid reference character string with class gridref. |
It can check either British or Irish grid references up to 10 figure (1m precision), including tetrads (2000m precision).
The square polygon geometry feature
Other grid reference functions:
easting()
,
hectad()
,
hectare()
,
monad()
,
northing()
,
pentad()
,
precision()
,
projection()
,
ten_metre()
,
tetrad()
suppressPackageStartupMessages({
suppressWarnings({
library(dplyr)
library(janitor)
})
})
grid_references <- nbn_demonstration_dataset %>%
clean_names() %>%
slice_tail(n = 15) %>%
select(grid_reference) %>%
mutate(grid_reference = as_gridref(grid_reference))
# create sf data frame
suppressPackageStartupMessages({
suppressWarnings({
library(dplyr)
library(sf)
})
})
grid_references %>%
rowwise() %>%
mutate(geometry = gridsquare_geometry(grid_reference)) %>%
st_as_sf()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.