geom_to_bng_intersection_explode {osbng}R Documentation

Spatial data frame for indexed geometries

Description

Generate a set of BNG Reference objects given a geometry and a specified resolution and provide results in a spatial data frame format.

Usage

geom_to_bng_intersection_explode(geom, resolution, reset_index = TRUE, ...)

## S3 method for class 'geos_geometry'
geom_to_bng_intersection_explode(geom, resolution, reset_index = TRUE, ...)

## S3 method for class 'sf'
geom_to_bng_intersection_explode(geom, resolution, reset_index = TRUE, ...)

## S3 method for class 'sfc'
geom_to_bng_intersection_explode(geom, resolution, reset_index = TRUE, ...)

Arguments

geom

geometry object of type geos-geometry or sf

resolution

spatial resolution of the BNG cell expressed in string or integer values

reset_index

logical. Should the row names be reset in the output? Default is TRUE to renumber the output rows sequentially.

...

additional parameters. Not currently used.

Details

The BNG Reference objects returned represent the grid squares intersected by the input geometry. This function followings the pattern of geom_to_bng_intersection(), but flattens the list structure of results into a spatial data frame. The original geometry is dropped in this process and all other columns are retained in the output.

The sf package is required to use this functionality.

Value

a spatial data frame of type sf with the coordinate reference system to British National Grid (EPSG:27700). The non-geometry columns of the input (if any) are joined with three columns for the BNGReference object, the is_core property, and the indexed geometry.

See Also

geom_to_bng_intersection()

Examples


geom_to_bng_intersection_explode(geos::geos_make_polygon(c(375480.64511692, 
426949.67604058, 465166.20199588, 453762.88376729, 393510.2158297, 
375480.64511692), c(144999.23691181, 160255.02751493, 153320.57724078, 
94454.79935802, 91989.21703833, 144999.23691181)), "50km")
 


[Package osbng version 0.2.0 Index]