Science Score: 36.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
✓Committers with academic emails
2 of 29 committers (6.9%) from academic institutions -
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (16.0%) to scientific vocabulary
Keywords
Keywords from Contributors
Repository
Raster-based Spatial Analytics for Python
Basic Info
- Host: GitHub
- Owner: makepath
- License: mit
- Language: Python
- Default Branch: master
- Homepage: https://xarray-spatial.readthedocs.io/
- Size: 169 MB
Statistics
- Stars: 892
- Watchers: 23
- Forks: 85
- Open Issues: 50
- Releases: 36
Topics
Metadata Files
README.md
| Latest Release |
|
Downloads |
|
| License |
|
People |
|
| Build Status | Coverage |
:round_pushpin: Fast, Accurate Python library for Raster Operations
:zap: Extensible with Numba
:fast_forward: Scalable with Dask
:confetti_ball: Free of GDAL / GEOS Dependencies
:earth_africa: General-Purpose Spatial Processing, Geared Towards GIS Professionals
Xarray-Spatial implements common raster analysis functions using Numba and provides an easy-to-install, easy-to-extend codebase for raster analysis.
Installation
```bash
via pip
pip install xarray-spatial
via conda
conda install -c conda-forge xarray-spatial ```
Downloading our starter examples and data
Once you have xarray-spatial installed in your environment, you can use one of the following in your terminal (with the environment active) to download our examples and/or sample data into your local directory.
xrspatial examples : Download the examples notebooks and the data used.
xrspatial copy-examples : Download the examples notebooks but not the data. Note: you won't be able to run many of the examples.
xrspatial fetch-data : Download just the data and not the notebooks.
In all the above, the command will download and store the files into your current directory inside a folder named 'xrspatial-examples'.
| | | | | |
|:-------------------------:|:-------------------------:|:-------------------------:|:-------------------------:|:-------------------------:|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
xarray-spatial grew out of the Datashader project, which provides fast rasterization of vector data (points, lines, polygons, meshes, and rasters) for use with xarray-spatial.
xarray-spatial does not depend on GDAL / GEOS, which makes it fully extensible in Python but does limit the breadth of operations that can be covered. xarray-spatial is meant to include the core raster-analysis functions needed for GIS developers / analysts, implemented independently of the non-Python geo stack.
Our documentation is still under construction, but docs can be found here.
Raster-huh?
Rasters are regularly gridded datasets like GeoTIFFs, JPGs, and PNGs.
In the GIS world, rasters are used for representing continuous phenomena (e.g. elevation, rainfall, distance), either directly as numerical values, or as RGB images created for humans to view. Rasters typically have two spatial dimensions, but may have any number of other dimensions (time, type of measurement, etc.)
Supported Spatial Functions with Supported Inputs
Classification
| Name | NumPy xr.DataArray | Dask xr.DataArray | CuPy GPU xr.DataArray | Dask GPU xr.DataArray | |:----------:|:----------------------:|:--------------------:|:-------------------:|:------:| | Equal Interval |✅️ |✅ | ✅ | ️ | | Natural Breaks |✅️ | | | ️ | | Reclassify |✅️ |✅ | ✅ |✅ | | Quantile |✅️ | ✅ |✅ | ️|
Focal
| Name | NumPy xr.DataArray | Dask xr.DataArray | CuPy GPU xr.DataArray | Dask GPU xr.DataArray | |:----------:|:----------------------:|:--------------------:|:-------------------:|:------:| | Apply | ✅️ | ✅️ | | | | Hotspots | ✅️ | ✅️ | ✅️ | | | Mean | ✅️ | ✅️ | ✅️ | | | Focal Statistics | ✅️ | ✅️ | ✅️ | |
Multispectral
| Name | NumPy xr.DataArray | Dask xr.DataArray | CuPy GPU xr.DataArray | Dask GPU xr.DataArray | |:----------:|:----------------------:|:--------------------:|:-------------------:|:------:| | Atmospherically Resistant Vegetation Index (ARVI) | ✅️ |✅️ | ✅️ |✅️ | | Enhanced Built-Up and Bareness Index (EBBI) | ✅️ |✅️ | ✅️ |✅️ | | Enhanced Vegetation Index (EVI) | ✅️ |✅️ | ✅️ |✅️ | | Green Chlorophyll Index (GCI) | ✅️ |✅️ | ✅️ |✅️ | | Normalized Burn Ratio (NBR) | ✅️ |✅️ | ✅️ |✅️ | | Normalized Burn Ratio 2 (NBR2) | ✅️ |✅️ | ✅️ |✅️ | | Normalized Difference Moisture Index (NDMI) | ✅️ |✅️ | ✅️ |✅️ | | Normalized Difference Vegetation Index (NDVI) | ✅️ |✅️ | ✅️ |✅️ | | Soil Adjusted Vegetation Index (SAVI) | ✅️ |✅️ | ✅️ |✅️ | | Structure Insensitive Pigment Index (SIPI) | ✅️ |✅️ | ✅️ |✅️ | | True Color | ✅️ | ️ | ✅️ | ️ |
Pathfinding
| Name | NumPy xr.DataArray | Dask xr.DataArray | CuPy GPU xr.DataArray | Dask GPU xr.DataArray | |:----------:|:----------------------:|:--------------------:|:-------------------:|:------:| | A* Pathfinding | ✅️ | | | |
Proximity
| Name | NumPy xr.DataArray | Dask xr.DataArray | CuPy GPU xr.DataArray | Dask GPU xr.DataArray | |:----------:|:----------------------:|:--------------------:|:-------------------:|:------:| | Allocation | ✅️ | ✅ | | | | Direction | ✅️ | ✅ | | | | Proximity | ✅️ | ✅ | | |
Raster to vector
| Name | NumPy xr.DataArray | Dask xr.DataArray | CuPy GPU xr.DataArray | Dask GPU xr.DataArray | |:-----|:------------------:|:-----------------:|:---------------------:|:---------------------:| | Polygonize | ✅️ | | | |
Surface
| Name | NumPy xr.DataArray | Dask xr.DataArray | CuPy GPU xr.DataArray | Dask GPU xr.DataArray | |:----------:|:----------------------:|:--------------------:|:-------------------:|:------:| | Aspect | ✅️ | ✅️ | ✅️ | ⚠️ | | Curvature | ✅️ | | | ⚠️ | | Hillshade | ✅️ | ✅️ | | | | Slope | ✅️ | ✅️ | ✅️ | ⚠️ | | Terrain Generation | ✅️ | ✅️ | ✅️ | | | Viewshed | ✅️ | | | | | Perlin Noise | ✅️ | ✅️ | ✅️ | | | Bump Mapping | ✅️ | | | |
Zonal
| Name | NumPy xr.DataArray | Dask xr.DataArray | CuPy GPU xr.DataArray | Dask GPU xr.DataArray | |:----------:|:----------------------:|:--------------------:|:-------------------:|:------:| | Apply | ✅️ | ✅️ | | | | Crop | ✅️ | | | | | Regions | | | | | | Trim | ✅️ | | | | | Zonal Statistics | ✅️ | ✅️| | | | Zonal Cross Tabulate | ✅️ | ✅️| | |
Local
| Name | NumPy xr.DataArray | Dask xr.DataArray | CuPy GPU xr.DataArray | Dask GPU xr.DataArray | |:----------:|:----------------------:|:--------------------:|:-------------------:|:------:| | Cell Stats | ✅️ | | | | | Combine | ✅️ | | | | | Lesser Frequency | ✅️ | | | | | Equal Frequency | ✅️ | | | | | Greater Frequency | ✅️ | | | | | Lowest Position | ✅️ | | | | | Highest Position | ✅️ | | | | | Popularity | ✅️ | | | | | Rank | ✅️ | | | |
Usage
Basic Pattern
```python import xarray as xr from xrspatial import hillshade
mydataarray = xr.DataArray(...) hillshadeddataarray = hillshade(my_dataarray) ```
Check out the user guide here.

Dependencies
xarray-spatial currently depends on Datashader, but will soon be updated to depend only on xarray and numba, while still being able to make use of Datashader output when available.
Notes on GDAL
Within the Python ecosystem, many geospatial libraries interface with the GDAL C++ library for raster and vector input, output, and analysis (e.g. rasterio, rasterstats, geopandas). GDAL is robust, performant, and has decades of great work behind it. For years, off-loading expensive computations to the C/C++ level in this way has been a key performance strategy for Python libraries (obviously...Python itself is implemented in C!).
However, wrapping GDAL has a few drawbacks for Python developers and data scientists: - GDAL can be a pain to build / install. - GDAL is hard for Python developers/analysts to extend, because it requires understanding multiple languages. - GDAL's data structures are defined at the C/C++ level, which constrains how they can be accessed from Python.
With the introduction of projects like Numba, Python gained new ways to provide high-performance code directly in Python, without depending on or being constrained by separate C/C++ extensions. xarray-spatial implements algorithms using Numba and Dask, making all of its source code available as pure Python without any "black box" barriers that obscure what is going on and prevent full optimization. Projects can make use of the functionality provided by xarray-spatial where available, while still using GDAL where required for other tasks.
Citation
Cite our code:
makepath/xarray-spatial, https://github.com/makepath/xarray-spatial, ©2020-2024.
Owner
- Name: makepath
- Login: makepath
- Kind: organization
- Location: Austin, TX
- Website: https://www.makepath.com
- Repositories: 27
- Profile: https://github.com/makepath
GitHub Events
Total
- Issues event: 2
- Watch event: 63
- Issue comment event: 5
- Push event: 1
- Pull request event: 2
- Pull request review event: 1
- Fork event: 1
- Create event: 1
Last Year
- Issues event: 2
- Watch event: 63
- Issue comment event: 5
- Push event: 1
- Pull request event: 2
- Pull request review event: 1
- Fork event: 1
- Create event: 1
Committers
Last synced: 11 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| brendancol | b****s@p****o | 221 |
| thuydotm | 4****m | 119 |
| Giancarlo Castro | g****k@g****m | 57 |
| Ian Thomas | i****3@g****m | 29 |
| Chloe | 6****c | 15 |
| Kristine | k****n@g****m | 7 |
| thuydotm | m****o@D****n | 6 |
| Alexander Soklev | a****v@g****m | 5 |
| Marco Zimmermann | 6****m | 5 |
| Timo Cornelius Metzger | 3****r | 5 |
| Sapir Carlo Lastimoza-Dooley | 7****y | 4 |
| Chase Dwelle | d****m@u****u | 3 |
| Filipe | o****f@g****m | 2 |
| Iliakis Konstantinos | k****s@c****h | 2 |
| Jeremy T. Hetzel | j****l@g****m | 2 |
| Natalie O'Dell | 6****1 | 2 |
| James A. Bednar | j****r | 2 |
| mkeenan195 | 7****5 | 1 |
| g2giovanni | g****r@g****m | 1 |
| akupitz | a****z@g****m | 1 |
| Sergio Rey | s****y@g****m | 1 |
| Santiago Nullo | 6****4 | 1 |
| RichardScottOZ | 7****Z | 1 |
| Filipe Limberger | l****7@g****m | 1 |
| Denis Rykov | r****d@g****m | 1 |
| Daniel Avrella | d****l@d****m | 1 |
| Dahn | d****n@g****m | 1 |
| Ubuntu | u****u@i****l | 1 |
| Andrew | 1****1 | 1 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 221
- Total pull requests: 31
- Average time to close issues: about 1 year
- Average time to close pull requests: about 1 month
- Total issue authors: 28
- Total pull request authors: 8
- Average comments per issue: 0.91
- Average comments per pull request: 1.16
- Merged pull requests: 25
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 4
- Pull requests: 5
- Average time to close issues: N/A
- Average time to close pull requests: about 1 month
- Issue authors: 4
- Pull request authors: 3
- Average comments per issue: 0.75
- Average comments per pull request: 0.2
- Merged pull requests: 1
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- marcozimmermannpm (117)
- brendancol (56)
- thuydotm (20)
- giancastro (3)
- MaxDragonheart (2)
- rhugonnet (1)
- SapirLastimoza-Dooley (1)
- trygvels (1)
- TC-FF (1)
- KipCrossing (1)
- bidhya (1)
- giovp (1)
- GrahamReveley (1)
- theoway (1)
- TomAugspurger (1)
Pull Request Authors
- thuydotm (16)
- brendancol (10)
- tcmetzger (7)
- trygvels (2)
- ahuang11 (2)
- ianthomas23 (1)
- jthetzel (1)
- giancastro (1)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 2
-
Total downloads:
- pypi 54,798 last-month
- Total docker downloads: 310
-
Total dependent packages: 6
(may contain duplicates) -
Total dependent repositories: 25
(may contain duplicates) - Total versions: 74
- Total maintainers: 1
pypi.org: xarray-spatial
xarray-based spatial analysis tools
- Homepage: https://github.com/makepath/xarray-spatial
- Documentation: https://xarray-spatial.readthedocs.io/
- License: MIT
-
Latest release: 0.4.0
published almost 2 years ago
Rankings
Maintainers (1)
proxy.golang.org: github.com/makepath/xarray-spatial
- Documentation: https://pkg.go.dev/github.com/makepath/xarray-spatial#section-documentation
- License: mit
-
Latest release: v0.4.0
published almost 2 years ago
Rankings
Dependencies
- actions/checkout master composite
- actions/setup-python master composite
- codecov/codecov-action v2 composite
- actions/checkout master composite
- actions/setup-python v1 composite
- pypa/gh-action-pypi-publish master composite
- actions/checkout master composite
- actions/setup-python master composite
- check-manifest * development
- pytest * development
- setuptools_scm * development
- tox * development
- datashader *
- noise >=1.2.2
- numba *
- xarray *
- Jinja2 >=2.11
- dask *
- flake8 *
- geopandas *
- ipykernel *
- isort *
- matplotlib *
- nbsphinx *
- noise >=1.2.2
- numpydoc *
- pandoc *
- pydata_sphinx_theme *
- pytest *
- pytest-cov *
- sphinx *
- sphinx-panels *
- sphinx_rtd_theme *
