--- id: xarray-spatial version: "0.10.17" license: MIT license_treatment: permissive maintenance: active --- # xarray-spatial — xarray-based spatial analysis tools License: permissive · Maintenance: active · Downloads: 130.0K/mo ## 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 above — 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 pip install xarray-spatial uv add xarray-spatial 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_current - Install friction: low - Maintenance: active - Downloads: 130.0K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags raster analysis python, geospatial gridded data processing, GIS operations without GDAL, spatial functions xarray, GPU-accelerated raster operations, hydrology and surface analysis, cloud optimized geotiff reader, geospatial-raster, gpu-accelerated, dask-compatible [View on SkillFed](https://skillfed.io/packages/xarray-spatial) · [View on PyPI](https://pypi.org/project/xarray-spatial/)