Skip to content

Decouple datashader from xarray-spatial (consolidated: #3450 + #3451 + #3453-#3464) #3640

Description

@Melissari1997

Reason or Problem

xarray-spatial pulls datashader into its [examples] extra, and a handful of
source and documentation references still reach for datashader APIs
(canvas_like, ds.Canvas().points/line/polygons, shade/stack/dynspread,
Elevation/Set1/Set3 colormaps). The library no longer needs datashader:
vector rasterization is available through the arr.xrs.rasterize(...)
accessor, and rendering can be done with matplotlib.

This is a consolidated implementation of the 14 issues tracked under #3450.

Proposal

Remove every datashader dependency from library source, notebooks, examples,
packaging, and install docs, without changing any public xrspatial.*
behavior.

Deliberate datashader references that stay: the A/B benchmark in
benchmarks/rasterizer_benchmarks.py (already import-guarded, #3452 closed)
and the historical-credit prose in why_xarray_spatial.rst / index.rst.

Design: substitution-only. No new public API, no behavior changes.

Value: the [examples] extra stops pulling the heavy
datashader/numba/spatialpandas graph; the library source has zero datashader
imports; docs and examples run on matplotlib alone.

Stakeholders and Impacts

Anyone installing xarray-spatial[examples] benefits from the smaller
dependency footprint. No public API changes, so existing user code is
unaffected unless it called canvas_like (never exported, no callers).

Drawbacks

None significant. Notebook output images will differ visually (matplotlib vs
datashader rendering); acceptance is "runs top-to-bottom with no datashader
import", not pixel-identical output.

Alternatives

Keep datashader as an optional dep. Rejected: it adds weight for no current
library use.

Unresolved Questions

None. The multispectral resampling strategy (.interp/.coarsen) and the
pharmacy-deserts multi-reducer merge= semantics are confirmed against
xrspatial/rasterize.py.

Additional Notes or Context

Implements, in order: #3451, #3453, #3454, #3455, #3456, #3457, #3458, #3459,
#3460, #3461, #3462, #3463, #3464, then #3450 last. #3452 is already closed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationenhancementNew feature or requestinfrastructureCI, benchmarks, and tooling

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions