Using the GridR’s chain grid resampling API

This guide walks you through GridR’s chain grid resampling API, basic_grid_resampling_chain, in a series of focused tutorials. The chain layer is the file-oriented wrapper around the core array_grid_resampling function: it reads from and writes to rasterio datasets, and processes the output in memory-efficient strips and tiles.

Each page is self-contained and executable as a Jupyter notebook — you can follow them in order or jump directly to the topic you need. Pages declare their prerequisites and end with a pointer to the next logical step.

Recommended reading order

The pages are ordered for first-time readers below. Use the Previous / Next links at the bottom of each page to navigate sequentially. If you are already familiar with the core API (array_grid_resampling), start with the overview to see how chain arguments map to their core counterparts.

  1. Overview — relationship between the chain and core layers

  2. Getting started — your first call to basic_grid_resampling_chain

  3. Output mask — requesting an output validity mask

  4. Grid mask — flagging grid nodes as invalid

  5. Source mask — flagging source raster pixels as invalid

  6. Geometry masks — using Shapely polygons as masks

  7. Shift and windowgrid_shift and computation window

  8. I/O and memory — strips, tiles, logging