xarray-spatial


Namexarray-spatial JSON
Version 0.3.7 PyPI version JSON
download
home_pagehttps://github.com/makepath/xarray-spatial
Summaryxarray-based spatial analysis tools
upload_time2023-06-09 04:30:00
maintainer
docs_urlNone
authormakepath
requires_python>=3.7
licenseMIT
keywords
VCS
bugtrack_url
requirements datashader noise numba xarray
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <img src="img/Xarray-Spatial-logo.svg"/>

<table>
<tr>
  <td>Latest Release</td>
  <td>
    <div>
    <img src="https://badge.fury.io/py/xarray-spatial.svg" alt="pypi version" />
    </div>
    </a>
  </td>

  <td>Downloads</td>
  <td>
    <div>
    <a href="https://xarray-spatial.org/getting_started/installation.html">
    <img src="https://img.shields.io/pypi/dm/xarray-spatial?label=PyPI"
         alt="PyPI downloads per month" />
    </a>
    </div>
  </td>
</tr>

<tr>
  <td>License</td>
  <td>
    <a href="https://github.com/makepath/xarray-spatial/blob/master/LICENSE.txt">
    <img src="https://img.shields.io/pypi/l/xarray-spatial.svg"
         alt="MIT" />
    </a>
  </td>

  <td>People</td>
  <td>
    <img src="https://img.shields.io/github/contributors/makepath/xarray-spatial"
         alt="GitHub contributors" />
  </td>
</tr>

<tr>
  <td>Build Status</td>
  <td>
    <div>
    <a href="https://github.com/makepath/xarray-spatial/actions/workflows/test.yml">
    <img src="https://github.com/makepath/xarray-spatial/actions/workflows/test.yml/badge.svg"
         alt="Current github actions build status" />
    </a>
    </div>
    <div>
    <a href="https://github.com/makepath/xarray-spatial/actions/workflows/pypi-publish.yml">
    <img src="https://github.com/makepath/xarray-spatial/actions/workflows/pypi-publish.yml/badge.svg"
         alt="Current github actions build status" />
    </a>
    </div>
  </td>
  <td>Coverage</td>
  <td>
    <div>
      <a href="https:https://codecov.io/gh/makepath/xarray-spatial">
      <img alt="Language grade: Python" src="https://codecov.io/gh/makepath/xarray-spatial/branch/master/graph/badge.svg"/>
      </a>
    </div>
  </td>

</tr>
</table>

-------


[![History of OS GIS Timeline](img/featured-badge-gh.svg)](https://makepath.com/history-of-open-source-gis/)


-------
![title](img/composite_map.gif)
-------
:round_pushpin: Fast, Accurate Python library for Raster Operations

:zap: Extensible with [Numba](http://numba.pydata.org/)

:fast_forward: Scalable with [Dask](http://dask.pydata.org)

: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'.


| | | | | |
|:-------------------------:|:-------------------------:|:-------------------------:|:-------------------------:|:-------------------------:|
|<a href="/examples/"><img width="1604" src="img/0-0.png"></a>                           | <a href="/examples/user_guide/2_Proximity.ipynb"><img width="1604" src="img/0-1.png"></a>     |<a href="/examples/user_guide/2_Proximity.ipynb"><img width="1604" src="img/0-2.png"></a>     |<a href="/examples/user_guide/2_Proximity.ipynb"><img width="1604" src="img/0-3.png"></a>     |<a href="/examples/pharmacy-deserts.ipynb"><img width="1604" src="img/0-4.png"></a>|
|<a href="/examples/user_guide/1_Surface.ipynb"><img width="1604" src="img/1-0.png"></a> | <a href="/examples/user_guide/1_Surface.ipynb"><img width="1604" src="img/1-1.png"></a>       |<a href="/examples/user_guide/1_Surface.ipynb"><img width="1604" src="img/1-2.png"></a>       |<a href="/examples/user_guide/1_Surface.ipynb"><img width="1604" src="img/1-3.png"></a>       |<a href="/examples/pharmacy-deserts.ipynb"><img width="1604" src="img/1-4.png"></a>|
|<a href="/examples/user_guide/1_Surface.ipynb"><img width="1604" src="img/2-0.png"></a> | <a href="/examples/user_guide/8_Remote_Sensing.ipynb"><img width="1604" src="img/2-1.png"></a>|<a href="/examples/user_guide/8_Remote_Sensing.ipynb"><img width="1604" src="img/2-2.png"></a>|<a href="/examples/user_guide/5_Classification.ipynb"><img width="1604" src="img/2-3.png"></a>|<a href="/examples/pharmacy-deserts.ipynb"><img width="1604" src="img/2-4.png"></a>|
|<a href="/examples/"><img width="1604" src="img/3-0.png"></a>                           | <a href="/examples/"><img width="1604" src="img/3-1.png"></a>                                 |<a href="/examples/user_guide/5_Classification.ipynb"><img width="1604" src="img/3-2.png"></a>|<a href="/examples/pharmacy-deserts.ipynb"><img width="1604" src="img/3-3.png"></a>|<a href="/examples/"><img width="1604" src="img/3-4.png"></a>|
|<a href="/examples/Pathfinding_Austin_Road_Network.ipynb"><img width="1604" src="img/4-0.png"></a> |<a href="/examples/user_guide/1_Surface.ipynb#Hillshade"><img width="1604" src="img/4-1.png"></a> | <a href="/examples/user_guide/1_Surface.ipynb#Hillshade"><img width="1604" src="img/4-2.png"></a>| <a href="/examples/user_guide/1_Surface.ipynb#Slope"><img width="1604" src="img/4-3.png"></a>| <a href="/examples/pharmacy-deserts.ipynb#Create-a-%22Distance-to-Nearest-Pharmacy%22-Layer-&-Classify-into-5-Groups"><img width="1604" src="img/4-4.png"></a>|


`xarray-spatial` grew out of the [Datashader project](https://datashader.org/), 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](https://xarray-spatial.org/).


#### 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](xrspatial/classify.py) |✅️ |✅ | ✅ | ️ |
| [Natural Breaks](xrspatial/classify.py) |✅️ |  |  | ️ |
| [Reclassify](xrspatial/classify.py) |✅️ |✅ | ✅ |✅ |
| [Quantile](xrspatial/classify.py) |✅️ | ✅ |✅ |  ️|

-------

### **Focal**

| Name | NumPy xr.DataArray | Dask xr.DataArray | CuPy GPU xr.DataArray | Dask GPU xr.DataArray |
|:----------:|:----------------------:|:--------------------:|:-------------------:|:------:|
| [Apply](xrspatial/focal.py) | ✅️ | ✅️ |  |  |
| [Hotspots](xrspatial/focal.py) | ✅️ | ✅️ | ✅️ |  |
| [Mean](xrspatial/focal.py) | ✅️ | ✅️ | ✅️ | |
| [Focal Statistics](xrspatial/focal.py) | ✅️ | ✅️ | ✅️ | |

-------

### **Multispectral**

| Name | NumPy xr.DataArray | Dask xr.DataArray | CuPy GPU xr.DataArray | Dask GPU xr.DataArray |
|:----------:|:----------------------:|:--------------------:|:-------------------:|:------:|
| [Atmospherically Resistant Vegetation Index (ARVI)](xrspatial/multispectral.py) | ✅️ |✅️ | ✅️ |✅️ |
| [Enhanced Built-Up and Bareness Index (EBBI)](xrspatial/multispectral.py) | ✅️ |✅️  | ✅️ |✅️ |
| [Enhanced Vegetation Index (EVI)](xrspatial/multispectral.py) | ✅️ |✅️ | ✅️ |✅️ |
| [Green Chlorophyll Index (GCI)](xrspatial/multispectral.py) | ✅️ |✅️ | ✅️ |✅️ |
| [Normalized Burn Ratio (NBR)](xrspatial/multispectral.py) | ✅️ |✅️ | ✅️ |✅️ |
| [Normalized Burn Ratio 2 (NBR2)](xrspatial/multispectral.py) | ✅️ |✅️ | ✅️ |✅️ |
| [Normalized Difference Moisture Index (NDMI)](xrspatial/multispectral.py) | ✅️ |✅️ | ✅️ |✅️ |
| [Normalized Difference Vegetation Index (NDVI)](xrspatial/multispectral.py) | ✅️ |✅️ | ✅️ |✅️ |
| [Soil Adjusted Vegetation Index (SAVI)](xrspatial/multispectral.py) | ✅️ |✅️ | ✅️ |✅️ |
| [Structure Insensitive Pigment Index (SIPI)](xrspatial/multispectral.py) | ✅️ |✅️ | ✅️ |✅️ |
| [True Color](xrspatial/multispectral.py) | ✅️ | ️ | ✅️ | ️ |

-------


### **Pathfinding**

| Name | NumPy xr.DataArray | Dask xr.DataArray | CuPy GPU xr.DataArray | Dask GPU xr.DataArray |
|:----------:|:----------------------:|:--------------------:|:-------------------:|:------:|
| [A* Pathfinding](xrspatial/pathfinding.py) | ✅️ |  | | |

----------

### **Proximity**

| Name | NumPy xr.DataArray | Dask xr.DataArray | CuPy GPU xr.DataArray | Dask GPU xr.DataArray |
|:----------:|:----------------------:|:--------------------:|:-------------------:|:------:|
| [Allocation](xrspatial/proximity.py) | ✅️ | ✅ | | |
| [Direction](xrspatial/proximity.py) | ✅️ | ✅ | | |
| [Proximity](xrspatial/proximity.py) | ✅️ | ✅ | | |

--------

### **Raster to vector**

| Name | NumPy xr.DataArray | Dask xr.DataArray | CuPy GPU xr.DataArray | Dask GPU xr.DataArray |
|:-----|:------------------:|:-----------------:|:---------------------:|:---------------------:|
| [Polygonize](xrspatial/experimental/polygonize.py) | ✅️ | | | |

--------

### **Surface**

| Name | NumPy xr.DataArray | Dask xr.DataArray | CuPy GPU xr.DataArray | Dask GPU xr.DataArray |
|:----------:|:----------------------:|:--------------------:|:-------------------:|:------:|
| [Aspect](xrspatial/aspect.py) | ✅️ | ✅️ | ✅️ | ⚠️ |
| [Curvature](xrspatial/curvature.py) | ✅️ | | | ⚠️  |
| [Hillshade](xrspatial/hillshade.py) | ✅️ | ✅️  | | |
| [Slope](xrspatial/slope.py) | ✅️  | ✅️  | ✅️ | ⚠️  |
| [Terrain Generation](xrspatial/terrain.py) | ✅️ | ✅️ | ✅️ | |
| [Viewshed](xrspatial/viewshed.py) | ✅️ |  | | |
| [Perlin Noise](xrspatial/perlin.py) | ✅️ | ✅️ | ✅️ | |
| [Bump Mapping](xrspatial/bump.py) | ✅️ | | | |

-----------

### **Zonal**

| Name | NumPy xr.DataArray | Dask xr.DataArray | CuPy GPU xr.DataArray | Dask GPU xr.DataArray |
|:----------:|:----------------------:|:--------------------:|:-------------------:|:------:|
| [Apply](xrspatial/zonal.py) | ✅️ | ✅️ | | |
| [Crop](xrspatial/zonal.py) | ✅️ | | | |
| [Regions](xrspatial/zonal.py) |  |  | | |
| [Trim](xrspatial/zonal.py) | ✅️ |  | | |
| [Zonal Statistics](xrspatial/zonal.py) | ✅️ | ✅️| | |
| [Zonal Cross Tabulate](xrspatial/zonal.py) | ✅️ | ✅️| | |

-----------

### **Local**

| Name | NumPy xr.DataArray | Dask xr.DataArray | CuPy GPU xr.DataArray | Dask GPU xr.DataArray |
|:----------:|:----------------------:|:--------------------:|:-------------------:|:------:|
| [Cell Stats](xrspatial/local.py) | ✅️ |  | | |
| [Combine](xrspatial/local.py) | ✅️ | | | |
| [Lesser Frequency](xrspatial/local.py) | ✅️ |  | | |
| [Equal Frequency](xrspatial/local.py) | ✅️ |  | | |
| [Greater Frequency](xrspatial/local.py) | ✅️ |  | | |
| [Lowest Position](xrspatial/local.py) | ✅️ | | | |
| [Highest Position](xrspatial/local.py) | ✅️ | | | |
| [Popularity](xrspatial/local.py) | ✅️ | | | |
| [Rank](xrspatial/local.py) | ✅️ | | | |

#### Usage

##### Basic Pattern
```python
import xarray as xr
from xrspatial import hillshade

my_dataarray = xr.DataArray(...)
hillshaded_dataarray = hillshade(my_dataarray)
```

Check out the user guide [here](/examples/user_guide/).

------

![title](img/composite_map.png)
![title](img/makepath-supply-chain-international-shipping.png)

#### 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.

![title](img/dependencies.svg)

#### 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-2023.`

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/makepath/xarray-spatial",
    "name": "xarray-spatial",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "",
    "author": "makepath",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/80/26/3bfcfb02e1119f920c0961ed9b94760eef4a8b179de5336a69bf17eac21e/xarray-spatial-0.3.7.tar.gz",
    "platform": "any",
    "description": "<img src=\"img/Xarray-Spatial-logo.svg\"/>\n\n<table>\n<tr>\n  <td>Latest Release</td>\n  <td>\n    <div>\n    <img src=\"https://badge.fury.io/py/xarray-spatial.svg\" alt=\"pypi version\" />\n    </div>\n    </a>\n  </td>\n\n  <td>Downloads</td>\n  <td>\n    <div>\n    <a href=\"https://xarray-spatial.org/getting_started/installation.html\">\n    <img src=\"https://img.shields.io/pypi/dm/xarray-spatial?label=PyPI\"\n         alt=\"PyPI downloads per month\" />\n    </a>\n    </div>\n  </td>\n</tr>\n\n<tr>\n  <td>License</td>\n  <td>\n    <a href=\"https://github.com/makepath/xarray-spatial/blob/master/LICENSE.txt\">\n    <img src=\"https://img.shields.io/pypi/l/xarray-spatial.svg\"\n         alt=\"MIT\" />\n    </a>\n  </td>\n\n  <td>People</td>\n  <td>\n    <img src=\"https://img.shields.io/github/contributors/makepath/xarray-spatial\"\n         alt=\"GitHub contributors\" />\n  </td>\n</tr>\n\n<tr>\n  <td>Build Status</td>\n  <td>\n    <div>\n    <a href=\"https://github.com/makepath/xarray-spatial/actions/workflows/test.yml\">\n    <img src=\"https://github.com/makepath/xarray-spatial/actions/workflows/test.yml/badge.svg\"\n         alt=\"Current github actions build status\" />\n    </a>\n    </div>\n    <div>\n    <a href=\"https://github.com/makepath/xarray-spatial/actions/workflows/pypi-publish.yml\">\n    <img src=\"https://github.com/makepath/xarray-spatial/actions/workflows/pypi-publish.yml/badge.svg\"\n         alt=\"Current github actions build status\" />\n    </a>\n    </div>\n  </td>\n  <td>Coverage</td>\n  <td>\n    <div>\n      <a href=\"https:https://codecov.io/gh/makepath/xarray-spatial\">\n      <img alt=\"Language grade: Python\" src=\"https://codecov.io/gh/makepath/xarray-spatial/branch/master/graph/badge.svg\"/>\n      </a>\n    </div>\n  </td>\n\n</tr>\n</table>\n\n-------\n\n\n[![History of OS GIS Timeline](img/featured-badge-gh.svg)](https://makepath.com/history-of-open-source-gis/)\n\n\n-------\n![title](img/composite_map.gif)\n-------\n:round_pushpin: Fast, Accurate Python library for Raster Operations\n\n:zap: Extensible with [Numba](http://numba.pydata.org/)\n\n:fast_forward: Scalable with [Dask](http://dask.pydata.org)\n\n:confetti_ball: Free of GDAL / GEOS Dependencies\n\n:earth_africa: General-Purpose Spatial Processing, Geared Towards GIS Professionals\n\n-------\n\nXarray-Spatial implements common raster analysis functions using Numba and provides an easy-to-install, easy-to-extend codebase for raster analysis.\n\n### Installation\n```bash\n# via pip\npip install xarray-spatial\n\n# via conda\nconda install -c conda-forge xarray-spatial\n```\n\n### Downloading our starter examples and data\nOnce 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.\n\n```xrspatial examples``` : Download the examples notebooks and the data used.\n\n```xrspatial copy-examples``` : Download the examples notebooks but not the data. Note: you won't be able to run many of the examples.\n\n```xrspatial fetch-data``` : Download just the data and not the notebooks.\n\nIn all the above, the command will download and store the files into your current directory inside a folder named 'xrspatial-examples'.\n\n\n| | | | | |\n|:-------------------------:|:-------------------------:|:-------------------------:|:-------------------------:|:-------------------------:|\n|<a href=\"/examples/\"><img width=\"1604\" src=\"img/0-0.png\"></a>                           | <a href=\"/examples/user_guide/2_Proximity.ipynb\"><img width=\"1604\" src=\"img/0-1.png\"></a>     |<a href=\"/examples/user_guide/2_Proximity.ipynb\"><img width=\"1604\" src=\"img/0-2.png\"></a>     |<a href=\"/examples/user_guide/2_Proximity.ipynb\"><img width=\"1604\" src=\"img/0-3.png\"></a>     |<a href=\"/examples/pharmacy-deserts.ipynb\"><img width=\"1604\" src=\"img/0-4.png\"></a>|\n|<a href=\"/examples/user_guide/1_Surface.ipynb\"><img width=\"1604\" src=\"img/1-0.png\"></a> | <a href=\"/examples/user_guide/1_Surface.ipynb\"><img width=\"1604\" src=\"img/1-1.png\"></a>       |<a href=\"/examples/user_guide/1_Surface.ipynb\"><img width=\"1604\" src=\"img/1-2.png\"></a>       |<a href=\"/examples/user_guide/1_Surface.ipynb\"><img width=\"1604\" src=\"img/1-3.png\"></a>       |<a href=\"/examples/pharmacy-deserts.ipynb\"><img width=\"1604\" src=\"img/1-4.png\"></a>|\n|<a href=\"/examples/user_guide/1_Surface.ipynb\"><img width=\"1604\" src=\"img/2-0.png\"></a> | <a href=\"/examples/user_guide/8_Remote_Sensing.ipynb\"><img width=\"1604\" src=\"img/2-1.png\"></a>|<a href=\"/examples/user_guide/8_Remote_Sensing.ipynb\"><img width=\"1604\" src=\"img/2-2.png\"></a>|<a href=\"/examples/user_guide/5_Classification.ipynb\"><img width=\"1604\" src=\"img/2-3.png\"></a>|<a href=\"/examples/pharmacy-deserts.ipynb\"><img width=\"1604\" src=\"img/2-4.png\"></a>|\n|<a href=\"/examples/\"><img width=\"1604\" src=\"img/3-0.png\"></a>                           | <a href=\"/examples/\"><img width=\"1604\" src=\"img/3-1.png\"></a>                                 |<a href=\"/examples/user_guide/5_Classification.ipynb\"><img width=\"1604\" src=\"img/3-2.png\"></a>|<a href=\"/examples/pharmacy-deserts.ipynb\"><img width=\"1604\" src=\"img/3-3.png\"></a>|<a href=\"/examples/\"><img width=\"1604\" src=\"img/3-4.png\"></a>|\n|<a href=\"/examples/Pathfinding_Austin_Road_Network.ipynb\"><img width=\"1604\" src=\"img/4-0.png\"></a> |<a href=\"/examples/user_guide/1_Surface.ipynb#Hillshade\"><img width=\"1604\" src=\"img/4-1.png\"></a> | <a href=\"/examples/user_guide/1_Surface.ipynb#Hillshade\"><img width=\"1604\" src=\"img/4-2.png\"></a>| <a href=\"/examples/user_guide/1_Surface.ipynb#Slope\"><img width=\"1604\" src=\"img/4-3.png\"></a>| <a href=\"/examples/pharmacy-deserts.ipynb#Create-a-%22Distance-to-Nearest-Pharmacy%22-Layer-&-Classify-into-5-Groups\"><img width=\"1604\" src=\"img/4-4.png\"></a>|\n\n\n`xarray-spatial` grew out of the [Datashader project](https://datashader.org/), which provides fast rasterization of vector data (points, lines, polygons, meshes, and rasters) for use with xarray-spatial.\n\n`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.\n\n\nOur documentation is still under construction, but [docs can be found here](https://xarray-spatial.org/).\n\n\n#### Raster-huh?\n\nRasters are regularly gridded datasets like GeoTIFFs, JPGs, and PNGs.\n\nIn 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.)\n\n#### Supported Spatial Functions with Supported Inputs\n\n-------\n\n### **Classification**\n\n| Name | NumPy xr.DataArray | Dask xr.DataArray | CuPy GPU xr.DataArray | Dask GPU xr.DataArray |\n|:----------:|:----------------------:|:--------------------:|:-------------------:|:------:|\n| [Equal Interval](xrspatial/classify.py) |\u2705\ufe0f |\u2705 | \u2705 | \ufe0f |\n| [Natural Breaks](xrspatial/classify.py) |\u2705\ufe0f |  |  | \ufe0f |\n| [Reclassify](xrspatial/classify.py) |\u2705\ufe0f |\u2705 | \u2705 |\u2705 |\n| [Quantile](xrspatial/classify.py) |\u2705\ufe0f | \u2705 |\u2705 |  \ufe0f|\n\n-------\n\n### **Focal**\n\n| Name | NumPy xr.DataArray | Dask xr.DataArray | CuPy GPU xr.DataArray | Dask GPU xr.DataArray |\n|:----------:|:----------------------:|:--------------------:|:-------------------:|:------:|\n| [Apply](xrspatial/focal.py) | \u2705\ufe0f | \u2705\ufe0f |  |  |\n| [Hotspots](xrspatial/focal.py) | \u2705\ufe0f | \u2705\ufe0f | \u2705\ufe0f |  |\n| [Mean](xrspatial/focal.py) | \u2705\ufe0f | \u2705\ufe0f | \u2705\ufe0f | |\n| [Focal Statistics](xrspatial/focal.py) | \u2705\ufe0f | \u2705\ufe0f | \u2705\ufe0f | |\n\n-------\n\n### **Multispectral**\n\n| Name | NumPy xr.DataArray | Dask xr.DataArray | CuPy GPU xr.DataArray | Dask GPU xr.DataArray |\n|:----------:|:----------------------:|:--------------------:|:-------------------:|:------:|\n| [Atmospherically Resistant Vegetation Index (ARVI)](xrspatial/multispectral.py) | \u2705\ufe0f |\u2705\ufe0f | \u2705\ufe0f |\u2705\ufe0f |\n| [Enhanced Built-Up and Bareness Index (EBBI)](xrspatial/multispectral.py) | \u2705\ufe0f |\u2705\ufe0f  | \u2705\ufe0f |\u2705\ufe0f |\n| [Enhanced Vegetation Index (EVI)](xrspatial/multispectral.py) | \u2705\ufe0f |\u2705\ufe0f | \u2705\ufe0f |\u2705\ufe0f |\n| [Green Chlorophyll Index (GCI)](xrspatial/multispectral.py) | \u2705\ufe0f |\u2705\ufe0f | \u2705\ufe0f |\u2705\ufe0f |\n| [Normalized Burn Ratio (NBR)](xrspatial/multispectral.py) | \u2705\ufe0f |\u2705\ufe0f | \u2705\ufe0f |\u2705\ufe0f |\n| [Normalized Burn Ratio 2 (NBR2)](xrspatial/multispectral.py) | \u2705\ufe0f |\u2705\ufe0f | \u2705\ufe0f |\u2705\ufe0f |\n| [Normalized Difference Moisture Index (NDMI)](xrspatial/multispectral.py) | \u2705\ufe0f |\u2705\ufe0f | \u2705\ufe0f |\u2705\ufe0f |\n| [Normalized Difference Vegetation Index (NDVI)](xrspatial/multispectral.py) | \u2705\ufe0f |\u2705\ufe0f | \u2705\ufe0f |\u2705\ufe0f |\n| [Soil Adjusted Vegetation Index (SAVI)](xrspatial/multispectral.py) | \u2705\ufe0f |\u2705\ufe0f | \u2705\ufe0f |\u2705\ufe0f |\n| [Structure Insensitive Pigment Index (SIPI)](xrspatial/multispectral.py) | \u2705\ufe0f |\u2705\ufe0f | \u2705\ufe0f |\u2705\ufe0f |\n| [True Color](xrspatial/multispectral.py) | \u2705\ufe0f | \ufe0f | \u2705\ufe0f | \ufe0f |\n\n-------\n\n\n### **Pathfinding**\n\n| Name | NumPy xr.DataArray | Dask xr.DataArray | CuPy GPU xr.DataArray | Dask GPU xr.DataArray |\n|:----------:|:----------------------:|:--------------------:|:-------------------:|:------:|\n| [A* Pathfinding](xrspatial/pathfinding.py) | \u2705\ufe0f |  | | |\n\n----------\n\n### **Proximity**\n\n| Name | NumPy xr.DataArray | Dask xr.DataArray | CuPy GPU xr.DataArray | Dask GPU xr.DataArray |\n|:----------:|:----------------------:|:--------------------:|:-------------------:|:------:|\n| [Allocation](xrspatial/proximity.py) | \u2705\ufe0f | \u2705 | | |\n| [Direction](xrspatial/proximity.py) | \u2705\ufe0f | \u2705 | | |\n| [Proximity](xrspatial/proximity.py) | \u2705\ufe0f | \u2705 | | |\n\n--------\n\n### **Raster to vector**\n\n| Name | NumPy xr.DataArray | Dask xr.DataArray | CuPy GPU xr.DataArray | Dask GPU xr.DataArray |\n|:-----|:------------------:|:-----------------:|:---------------------:|:---------------------:|\n| [Polygonize](xrspatial/experimental/polygonize.py) | \u2705\ufe0f | | | |\n\n--------\n\n### **Surface**\n\n| Name | NumPy xr.DataArray | Dask xr.DataArray | CuPy GPU xr.DataArray | Dask GPU xr.DataArray |\n|:----------:|:----------------------:|:--------------------:|:-------------------:|:------:|\n| [Aspect](xrspatial/aspect.py) | \u2705\ufe0f | \u2705\ufe0f | \u2705\ufe0f | \u26a0\ufe0f |\n| [Curvature](xrspatial/curvature.py) | \u2705\ufe0f | | | \u26a0\ufe0f  |\n| [Hillshade](xrspatial/hillshade.py) | \u2705\ufe0f | \u2705\ufe0f  | | |\n| [Slope](xrspatial/slope.py) | \u2705\ufe0f  | \u2705\ufe0f  | \u2705\ufe0f | \u26a0\ufe0f  |\n| [Terrain Generation](xrspatial/terrain.py) | \u2705\ufe0f | \u2705\ufe0f | \u2705\ufe0f | |\n| [Viewshed](xrspatial/viewshed.py) | \u2705\ufe0f |  | | |\n| [Perlin Noise](xrspatial/perlin.py) | \u2705\ufe0f | \u2705\ufe0f | \u2705\ufe0f | |\n| [Bump Mapping](xrspatial/bump.py) | \u2705\ufe0f | | | |\n\n-----------\n\n### **Zonal**\n\n| Name | NumPy xr.DataArray | Dask xr.DataArray | CuPy GPU xr.DataArray | Dask GPU xr.DataArray |\n|:----------:|:----------------------:|:--------------------:|:-------------------:|:------:|\n| [Apply](xrspatial/zonal.py) | \u2705\ufe0f | \u2705\ufe0f | | |\n| [Crop](xrspatial/zonal.py) | \u2705\ufe0f | | | |\n| [Regions](xrspatial/zonal.py) |  |  | | |\n| [Trim](xrspatial/zonal.py) | \u2705\ufe0f |  | | |\n| [Zonal Statistics](xrspatial/zonal.py) | \u2705\ufe0f | \u2705\ufe0f| | |\n| [Zonal Cross Tabulate](xrspatial/zonal.py) | \u2705\ufe0f | \u2705\ufe0f| | |\n\n-----------\n\n### **Local**\n\n| Name | NumPy xr.DataArray | Dask xr.DataArray | CuPy GPU xr.DataArray | Dask GPU xr.DataArray |\n|:----------:|:----------------------:|:--------------------:|:-------------------:|:------:|\n| [Cell Stats](xrspatial/local.py) | \u2705\ufe0f |  | | |\n| [Combine](xrspatial/local.py) | \u2705\ufe0f | | | |\n| [Lesser Frequency](xrspatial/local.py) | \u2705\ufe0f |  | | |\n| [Equal Frequency](xrspatial/local.py) | \u2705\ufe0f |  | | |\n| [Greater Frequency](xrspatial/local.py) | \u2705\ufe0f |  | | |\n| [Lowest Position](xrspatial/local.py) | \u2705\ufe0f | | | |\n| [Highest Position](xrspatial/local.py) | \u2705\ufe0f | | | |\n| [Popularity](xrspatial/local.py) | \u2705\ufe0f | | | |\n| [Rank](xrspatial/local.py) | \u2705\ufe0f | | | |\n\n#### Usage\n\n##### Basic Pattern\n```python\nimport xarray as xr\nfrom xrspatial import hillshade\n\nmy_dataarray = xr.DataArray(...)\nhillshaded_dataarray = hillshade(my_dataarray)\n```\n\nCheck out the user guide [here](/examples/user_guide/).\n\n------\n\n![title](img/composite_map.png)\n![title](img/makepath-supply-chain-international-shipping.png)\n\n#### Dependencies\n\n`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.\n\n![title](img/dependencies.svg)\n\n#### Notes on GDAL\n\nWithin 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!).\n\nHowever, wrapping GDAL has a few drawbacks for Python developers and data scientists:\n- GDAL can be a pain to build / install.\n- GDAL is hard for Python developers/analysts to extend, because it requires understanding multiple languages.\n- GDAL's data structures are defined at the C/C++ level, which constrains how they can be accessed from Python.\n\nWith 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.\n\n#### Citation\nCite our code:\n\n`makepath/xarray-spatial, https://github.com/makepath/xarray-spatial, \u00a92020-2023.`\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "xarray-based spatial analysis tools",
    "version": "0.3.7",
    "project_urls": {
        "Homepage": "https://github.com/makepath/xarray-spatial"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d215b89704ba16140a9fce8973b6612d96cf962188b7830959b314ed3b5d6db7",
                "md5": "64a04547fdc37c108f9b37a947553675",
                "sha256": "09a5b54bd34edc5c3c14dcadc0ced5eb5af151e309c4d0fb5196c95b42a10286"
            },
            "downloads": -1,
            "filename": "xarray_spatial-0.3.7-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "64a04547fdc37c108f9b37a947553675",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 2014889,
            "upload_time": "2023-06-09T04:29:55",
            "upload_time_iso_8601": "2023-06-09T04:29:55.940813Z",
            "url": "https://files.pythonhosted.org/packages/d2/15/b89704ba16140a9fce8973b6612d96cf962188b7830959b314ed3b5d6db7/xarray_spatial-0.3.7-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "80263bfcfb02e1119f920c0961ed9b94760eef4a8b179de5336a69bf17eac21e",
                "md5": "3bf1a7c800ef5ece338db7ee7bbee905",
                "sha256": "21bef5f0f5a3cfe18d7a33f40d7c9eee459ed33f7e5674cfe1d156de56d47b2f"
            },
            "downloads": -1,
            "filename": "xarray-spatial-0.3.7.tar.gz",
            "has_sig": false,
            "md5_digest": "3bf1a7c800ef5ece338db7ee7bbee905",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 70251357,
            "upload_time": "2023-06-09T04:30:00",
            "upload_time_iso_8601": "2023-06-09T04:30:00.162729Z",
            "url": "https://files.pythonhosted.org/packages/80/26/3bfcfb02e1119f920c0961ed9b94760eef4a8b179de5336a69bf17eac21e/xarray-spatial-0.3.7.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-06-09 04:30:00",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "makepath",
    "github_project": "xarray-spatial",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "datashader",
            "specs": []
        },
        {
            "name": "noise",
            "specs": [
                [
                    ">=",
                    "1.2.2"
                ]
            ]
        },
        {
            "name": "numba",
            "specs": []
        },
        {
            "name": "xarray",
            "specs": []
        }
    ],
    "lcname": "xarray-spatial"
}
        
Elapsed time: 0.07411s