align_extent: Crop an extent, snapped to the grain

View source: R/vaster.R

align_extentR Documentation

Crop an extent, snapped to the grain

Description

A crop (or extend), it snaps the input extent to the origin of the input extent (based on the dimension) #' Note that snap is modelled on the behaviour of the raster package, and is different from projwin in GDAL (WIP to illustrate).

Usage

align_extent(x, dimension, extent = NULL, snap = c("out", "near", "in"))

Arguments

x

extent

dimension

integer ncol, nrow

extent

numeric extent xmin,xmax,ymin,ymax

snap

out by default, may be near or in

Value

aligned extent

Examples

align_extent(c(4.5, 5.6, 2, 4), c(10, 5), c(0, 10, 0, 5))

hypertidy/vaster documentation built on June 10, 2025, 8:09 a.m.