build_fishnet: Build a vector polygon fishnet from reference object bounds...

View source: R/analysis.R

build_fishnetR Documentation

Build a vector polygon fishnet from reference object bounds and user-defined resolution.

Description

Build a global vector polygon fishnet with grid spacing provided by the user and bounds determined by the input reference object (ref_obj). The data frame is given a unique attribute value for each cell named "fn_key" and is a large integer from 1..n. The "grid_area" field is the area in the linear units of the user-defined coordinate system for each cell.

Usage

build_fishnet(ref_obj, resolution, lower_left_xy, to_crs = NULL)

Arguments

ref_obj

An sf spatial object that will be used to create the bounds of the fishnet

resolution

float. The desired grid resolution of the fishnet.

lower_left_xy

numeric of length 2. lower left corner corrdinates (x, y) of the grid

to_crs

integer. The EPSG number of the desired output coordinate reference system. The default is NULL; which will inherit the CRS of the input ref_obj.

Value

A simple features (sf) spatial data frame object.

Author(s)

Chris R. Vernon (chris.vernon@pnnl.gov)


JGCRI/rgis documentation built on July 27, 2023, 1:47 p.m.