Read and write rasters in parallel using Rasterio and Dask
Project description
dask-rasterio
dask-rasterio
provides some methods for reading and writing rasters in
parallel using Rasterio and
Dask arrays.
Usage
Read a multiband raster with read_raster
:
>>> from dask_rasterio import read_raster
>>> array = read_raster('tests/data/RGB.byte.tif')
>>> array
dask.array<stack, shape=(3, 718, 791), dtype=uint8, chunksize=(1, 3, 791)>
>>> array.mean()
dask.array<mean_agg-aggregate, shape=(), dtype=float64, chunksize=()>
>>> array.mean().compute()
40.858976977533935
Write a singleband or multiband raster with write_raster
:
>>> from dask_rasterio import read_raster
>>> array = read_raster('tests/data/RGB.byte.tif')
>>> new_array = array & (array > 100)
>>> new_array
dask.array<and_, shape=(3, 718, 791), dtype=uint8, chunksize=(1, 3, 791)>
>>> prof = ... # reuse profile from tests/data/RGB.byte.tif...
>>> write_raster('processed_image.tif', new_array, **prof)
Install
Install with pip:
pip install dask-rasterio
Development
This project is managed by Poetry. If you do not have it installed, please refer to Poetry instructions.
Now, clone the repository and run poetry install
. This will create a virtual
environment and install all required packages there.
Run poetry run pytest
to run all tests.
Run poetry build
to build package on dist/
.
Issue tracker
Please report any bugs and enhancement ideas using the GitHub issue tracker:
https://github.com/dymaxionlabs/dask-rasterio/issues
Feel free to also ask questions on our Gitter channel, or by email.
Help wanted
Any help in testing, development, documentation and other tasks is highly appreciated and useful to the project.
For more details, see the file CONTRIBUTING.md.
License
Source code is released under a BSD-2 license. Please refer to LICENSE.md for more information.
Project details
Release history Release notifications | RSS feed
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
File details
Details for the file dask-rasterio-0.1.0.tar.gz
.
File metadata
- Download URL: dask-rasterio-0.1.0.tar.gz
- Upload date:
- Size: 4.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 21d17fe5b540938c40320312601d669e0f07f34d333f7e4bc4e68b3f35cb040b |
|
MD5 | a3003847ca0d8253202e5ff7ff47f479 |
|
BLAKE2b-256 | fb2e9d4f71ba869f619bf76959675f32d9412ef7a6ba6da80ba6595d003ef7b5 |
File details
Details for the file dask_rasterio-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: dask_rasterio-0.1.0-py3-none-any.whl
- Upload date:
- Size: 8.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fef6e9c8aa96db34cea1cae96d260aafa9f478309589c917f2a901f981ada41f |
|
MD5 | c3f9591fd3209360c7fd9c52e6963f09 |
|
BLAKE2b-256 | 3c9f789089d5c898c11ea770e9042862de4784498705fe123e38fa050600cd51 |