stixelize: Generate stixel polygons from PI data

Description Usage Arguments Value Methods (by class) Examples

View source: R/stixelize.R

Description

All predictor importance data are provided at the stixel level. In these files, the stixel is defined based on a centroid, width, and height. This function uses this information to define polygons for each stixel and attaches them to the original data in the form of an sf object

Usage

1
2
3
4
5
6
7
stixelize(x)

## S3 method for class 'data.frame'
stixelize(x)

## S3 method for class 'sf'
stixelize(x)

Arguments

x

data.frame or sf object; PI data loaded with load_pis(), or any other data frame with fields lon, lat, stixel_width, and stixel_hight.

Value

sf object with geometry column storing polygons representing the stixels boundaries.

Methods (by class)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## Not run: 
# download example data
sp_path <- ebirdst_download("example_data", tifs_only = FALSE)

# load predictor importance
pis <- load_pis(sp_path)

stixelize(pis)

# also works on sf objects
pis_sf <- sf::st_as_sf(pis, coords = c("lon", "lat"), crs = 4326)
stixelize(pis_sf)

## End(Not run)

ebirdst documentation built on Jan. 16, 2021, 5:16 p.m.