Skip to main content

crop_grid

Function crop_grid 

Source
pub fn crop_grid(grid: GridInfo, bbox: (f64, f64, f64, f64)) -> Result<GridInfo>
Available on crate feature encoder only.
Expand description

Restrict a grid to the smallest whole-cell window covering bbox (west, south, east, north, degrees).

The window keeps the cell whose center sits at or before each lower edge and the one at or after each upper edge, so the cropped planes always cover the requested box outright. On a wrapping source grid west > east crosses the antimeridian; the returned origin is renormalized into [-180, 180) and the window, not the metadata, carries the wrap.

On a projected grid the box is a curved patch: see crop_projected. A Gaussian grid is cropped by its regular fields, and its rows follow.