Extract an image's dataset-level mask and write to a new file.
Project description
rio-ds-mask
A Rasterio plugin for extracting an image’s dataset-level mask.
Usage
$ rio ds-mask --help
Usage: rio ds-mask [OPTIONS] INPUT OUTPUT
Extract an image's dataset-level mask.
If '--driver' is not given the input driver is used.
Options:
-f, --format, --driver TEXT Output format driver
--co, --profile NAME=VALUE Driver specific creation options.See the
documentation for the selected output driver
for more information.
--help Show this message and exit.
This example command creates a singleband uint8 image that is acceptable to use as a GDAL mask band, meaning that pixels with a value of 255 are transparent and pixels with a vaue of 0 are opaque. The image is losslessly compressed and internally tiled.
$ rio ds-mask \
--driver GTiff \
tests/data/alpha.tif \
mask.tif \
--co COMPRESS=DEFLATE \
--co TILED=YES
Installing
First install Rasterio, then:
$ pip install rio-ds-mask --user
Developing
$ git clone https://github.com/geowurster/rio-ds-mask.git
$ cd rio-ds-mask
$ pip install -e .\[all\]
$ pytest --cov rio-ds-mask --cov-report term-missing
License
See LICENSE.txt
Changelog
See CHANGES.md
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
rio-ds-mask-1.1.tar.gz
(4.9 kB
view details)
Built Distribution
File details
Details for the file rio-ds-mask-1.1.tar.gz
.
File metadata
- Download URL: rio-ds-mask-1.1.tar.gz
- Upload date:
- Size: 4.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d93ad868322dfe50512bd97d6c14093ba0644e4bc45328e2baf37288f29517d9 |
|
MD5 | c35c6600e6319229934c801485904060 |
|
BLAKE2b-256 | 153025801e3249e73d60650421c67affae9eb2a93f1b9da6800ff6574addf2cc |
File details
Details for the file rio_ds_mask-1.1-py2.py3-none-any.whl
.
File metadata
- Download URL: rio_ds_mask-1.1-py2.py3-none-any.whl
- Upload date:
- Size: 5.9 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a786ad935732b0cdc90e8c61097c73bc9a4c10017601e5b01b4344fc54558b00 |
|
MD5 | 7c5dcaa4e011fc8099ba57bd802cb504 |
|
BLAKE2b-256 | 1f5ab9cc2e70c6a3d0a0c4698aee87f0aa8b2196416f5168ceb01a3131170b6e |