提取图像的数据集级掩码并写入新文件。

rio-ds-mask的Python项目详细描述


RIO DS面罩

用于提取的Rasterio插件 图像的数据集级掩码。

https://travis-ci.org/geowurster/rio-ds-mask.svg?branch=masterhttps://coveralls.io/repos/github/geowurster/rio-ds-mask/badge.svg?branch=master

用法

Usage: rio ds-mask [OPTIONS] INPUT OUTPUT

  Extract an image's dataset-level mask.

  Both output driver and datatype are derived from the input image if not
  given.

  In some cases this plugin alters GDAL's returned mask values.  When
  writing masks GDAL uses 0's for opaque and 255's for transparent, but when
  reading masks the returned value differs based on the image's datatype.  8
  bit images produce 8 bit masks where 0's are opaque and 255's are
  transparent, however 16 bit images use 0's for opaque and 1's for
  transparent, still stored as 8 bit.  If the image's datatype is 'int16' or
  'uint16' and the mask's maximum value is 1, then all 1's are translated to
  255's.  The mask's datatype is preserved.  I have not fully investigated
  all of GDAL's masking options to determine if the behavior is consistent.
  If it is found to be a deliberate choice then the normalization will be
  removed.

Options:
  -f, --format, --driver TEXT     Output format driver
  -t, --dtype [ubyte|uint8|uint16|int16|uint32|int32|float32|float64]
                                  Output data type.
  --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.

此示例命令创建可接受的单波段uint8图像 用作gdal遮罩带,这意味着值为255的像素 透明像素和值为0的像素是不透明的。图像是 无损压缩和内部平铺。

$ rio ds-mask \
    --driver GTiff \
    tests/data/alpha.tif \
    mask.tif \
    --co COMPRESS=DEFLATE \
    --co TILED=YES

安装

第一个install Rasterio, 然后:

$ pip install rio-ds-mask --user

发展中

$ 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.txt

变更日志

CHANGES.md

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
使用MongoDB进行java漏斗分析?   java如何重构此代码以仅执行一次方法logViolation(),并在单个字符串中获取字符串变量(speedType)的所有值   java如何将方向向量转换为角度?   Java中json文件中的股票价格   java有没有一种方法可以查看网站中的哪些资源加载了selenium?   java文件定位器可以指向不同文件服务器上的目录吗?   java GWT等待SetVisibleRange和ClearData完成   macos Java Applet无法在Mac OS下接收鼠标输入   java BottomNavigationView不支持单次单击必须单击两次   MS SQL Server 2012中的java:我的数据库名称是J.3.0.0\u DEV我无法在Oracle SQL Developer IDE中连接它?   java对JFileChooser的修改,只显示文件夹内容   java如何将动态对象查询更改为criteria builder或更好的性能   java中的swing新字体类型   java Hibernate。删除未使用的条目   上载CSV文件并将其转换为Java模型对象   java如何将信息添加到库的日志消息中?   JavaEclipseGit:使用egit从另一个分支、标记或引用打开版本   使用Firebase控制台消息的java开放视频