Learn R Programming

stars (version 0.1-1)

st_xy2sfc: replace x y raster dimensions with simple feature geometry list (points, or polygons = rasterize)

Description

replace x y raster dimensions with simple feature geometry list (points, or polygons = rasterize)

Usage

st_xy2sfc(x, as_points = st_dimensions(x)$x$point, ..., na.rm = TRUE,
  longlat = NULL)

Arguments

x

object of class stars

as_points

logical; if TRUE, generate points at cell centers, else generate polygons

...

arguments passed on to st_as_sfc

na.rm

logical; remove cells with all missing values?

longlat

optionally a stars object with two 2-D arrays with longitude and latitude coordinates for each pixel; if this is defined, x and y dimension definitionss are further ignored.

Value

object of class stars with x and y raster dimensions replaced by a single sfc geometry list column containing either points or square polygons