skillfed

xarray-spatial

xarray-based spatial analysis tools

xarray-spatial v0.10.17 130.0K downloads/30d#11,655 on PyPI961
Permissive license MIT Active released

What it is and what it does

xarray-spatial is a Python library for raster analysis built on xarray that handles gridded geospatial data (GeoTIFFs, COGs, and other raster formats) without requiring GDAL or GEOS. It provides a large collection of spatial functions for tasks like elevation analysis, hydrological modeling, fire behavior simulation, and multispectral image processing. The library automatically selects the right computational backend—NumPy for single-machine CPU work, Dask for distributed processing, CuPy for GPU acceleration, or combinations thereof—based on your data and parameters, so you write the same code regardless of scale.

The package includes a native GeoTIFF and Cloud Optimized GeoTIFF reader and writer implemented in pure Python and Numba, eliminating the need for external C/C++ geospatial libraries. It is designed for GIS professionals and researchers who need fast, extensible raster operations. The project is currently in feature freeze leading toward a 1.0.0 release, accepting only bug fixes, performance improvements, and documentation work.

Use it for:

  • Read and write GeoTIFF or COG files directly without GDAL, optionally scaling to Dask or GPU backends.
  • Compute hydrological flow direction and accumulation using D8, D-infinity, or MFD algorithms on elevation models.
  • Generate multispectral vegetation indices from satellite imagery bands.
  • Model flood extent and fire behavior by applying focal and morphological operations across raster datasets.
  • Perform proximity analysis, pathfinding, and interpolation on gridded spatial data with automatic backend dispatch.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

xarray-spatial provides 150+ functions for raster analysis—surface operations, hydrology, fire behavior, flood modeling, multispectral indices, and pathfinding—that dispatch automatically across NumPy, Dask, CuPy, and Dask+CuPy backends, with native GeoTIFF/COG I/O and no GDAL dependency.

Yes, if you work with raster geospatial data and want to avoid GDAL/GEOS dependencies. The library is actively maintained, has low install friction, and offers a broad toolkit for common GIS operations. The feature freeze may slow new feature adoption, but core functionality is stable. Requires Python 3.12+. No known security vulnerabilities.

Install

xarray-spatial on PyPI

pip

pip install xarray-spatial

uv

uv add xarray-spatial

poetry

poetry add xarray-spatial

Installing xarray-spatial

Before you install

Low friction: pure-Python wheel with six runtime dependencies (numba, scipy, xarray, numpy, urllib3, zstandard). Active maintenance—last commit 2026-08-08, release 28 days ago. Requires Python 3.12+.

License in practice

MIT license (permissive): you can use, modify, and distribute xarray-spatial freely in commercial and private projects with minimal restrictions, provided you include the license notice.

Quickstart

pip install xarray-spatial

import xarray
from xarray_spatial import geotiff

da = geotiff.open_geotiff('dem.tif')
geotiff.to_geotiff(da, 'output.tif', compression='zstd')

Requires Python 3.12 or later. GPU operations require additional NVIDIA libraries not bundled with the package.

Verify before relying

  • Whether the 150+ functions cover your specific spatial analysis use case.
  • Performance characteristics and memory overhead on CPU-only systems with large rasters.
  • Stability of experimental GPU backends for production workflows.
  • Timeline and scope of the 1.0.0 release and feature freeze impact on your needs.

Package facts

License MIT (permissive)
Python support supports the current Python release (>=3.12)
Install friction low — pure-Python wheel
Runtime dependencies 6 — numba, scipy, xarray, numpy, urllib3, zstandard
Maintenance actively maintained — 28 days since the last release
Last repo commit
First released
Downloads 130,025/month — #11,655 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: xarray_spatial-0.10.17-py3-none-any.whl

Development Status :: 4 - BetaIntended Audience :: DevelopersIntended Audience :: Science/ResearchLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3

Tags

raster analysis pythongeospatial gridded data processingGIS operations without GDALspatial functions xarrayGPU-accelerated raster operationshydrology and surface analysiscloud optimized geotiff reader
geospatial-rastergpu-accelerateddask-compatible

More Information Analysis packages