围绕数字高程模型查询点的rasterio包装器
项目描述
demquery
围绕数字高程模型查询点的rasterio包装器。
功能
- 使用多个栅格文件,无需将它们合并到新文件中
- 一次性查询多个点
- 可选的二维插值(线性、三次或五次)
- 通过读取所需的最小数据,性能合理
安装
我建议首先使用Conda安装依赖项,然后使用pip安装demquery本身。
conda install gdal rasterio numpy scipy -c conda-forge
pip install demquery
CLI脚本
> demquery --help
Usage: demquery [OPTIONS] FEATURES...
Assign elevations to GeoJSON
Options:
-d, --dem PATH Paths to DEM files. [required]
-g, --dem-glob TEXT Glob expression for DEM paths if folder is provided.
-b, --band INTEGER Band of rasters to use [default: 1]
-i, --interp-kind TEXT either None, "linear", "cubic", or "quintic". None
will do no interpolation and choose the value in the
DEM closest to the provided point. linear creates a
3x3 grid and runs linear interpolation; cubic
creates a 5x5 grid and runs cubic interpolation;
quintic creates a 7x7 grid and runs quintic
interpolation.
--help Show this message and exit.
echo \
'{"type":"Feature","properties":{"name": "Glacier Peak"},"geometry":{"type":"Point","coordinates":[-121.2436843,48.0163834]}}' \
| demquery -d /path/to/dem/files
输出
{"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "Point", "coordinates": [-121.243684, 48.016383, 1431.5755615234375]}, "properties": {"name": "Glacier Peak"}}]}
文档
from demquery import Query
dem_paths = ['dem1.tif', 'dem2.tif']
query = Query(dem_paths)
# Points must be in longitude, latitude order!
# These points are in Manhattan, not Antarctica
points = [(-73.985564, 40.757965), (-73.968520, 40.778912)]
elevations = query.query_points(points, interp_kind='linear')
数据下载
对于下载全球SRTM数据的优秀视觉工具,请查看以下网站
- 30米分辨率:http://dwtkns.com/srtm30m/
- 90米分辨率:http://dwtkns.com/srtm/
发布
要上传新版本到PyPI
python setup.py sdist
twine upload dist/demquery-0.3.0.tar.gz
变更日志
[0.3.1] - 2020-08-19
- 无更改:尝试使conda-forge包正常工作
[0.3.0] - 2020-01-28
- 添加CLI脚本
[0.2.1] - 2019-12-04
- 将requirements.txt和requirements_dev.txt包含在清单包中
[0.2.0] - 2019-12-02
- 修复虚拟栅格问题。
[0.1.0] - 2019-11-27
- PyPI上的首次发布
项目详情
关闭
demquery-0.3.1.tar.gz 的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | aaf59a283933dc43b2ac1f2097d85e4220bbdb46fa4b52e2879e111fcd687575 |
|
MD5 | 5a18842dd2da50d73ad943d83e47a86e |
|
BLAKE2b-256 | 8cd879a01d2a509da25f5addd102e7537fb1da225fed8144da7e78561aad08fd |