A library to compute DEM-based topographical descriptors.
Project description
topo-descriptors
A python library to compute DEM-based topographical descriptors.
Usage
Let's install topo-descriptors
with few additional packages that will help us
to run a simple example:
pip install topo-descriptors
pip install elevation
pip install rasterio
elevation is an python library that provides an easy access to global elevation data. Here we are going to clip the SRTM 30m DEM around the Basodino region in southern Switzerland, around 46.4N 8.5E:
eio clip -o Basodino-30m-DEM.tif --bounds 8.2 46.30 8.6 46.55
Now in python we can use the xarray interface to rasterio to easily import our
Basodino-30m-DEM.tif
file:
import xarray as xr
dem = xr.open_rasterio("Basodino-30m-DEM.tif")
dem = dem.isel(band=0, drop=True)
dem.plot()
With the DEM data imported as a xarray DataArray, we can use topo-descriptors to compute common topographical descriptors, as here for the TPI at 500 meters scale:
from topo_descriptors import topo, helpers
scale_meters = 500
scale_pixel, __ = helpers.scale_to_pixel(scale_meters, dem)
topo.tpi(dem, scale_pixel).plot(vmin=-100, vmax=100, cmap="bwr")
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for topo_descriptors-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dcd903ef1afeecf0be844c8aad3f082c42fad03071d0c973391b85289112d5ff |
|
MD5 | 69780dc2b5bcc4820b3a04afb04e380d |
|
BLAKE2b-256 | f0ab0bbadecaefaead85f63552afce760426124ac4b5724a59aaffae9a6d6827 |