惰性光栅带处理
picoraster的Python项目详细描述
皮科拉斯特
用于处理大型光栅图像的小型python库。
目前正在进行中。
示例用法
source=AWSLandsat8Source("LC08_L1TP_139045_20170304_20170316_01_T1",band="8")# Lazily create a band and build a description of processing stepsband=Band(source) \ .and_then(Resize(extents)) \ .and_then(HistogramAdjust()) \ .and_then(Reproject(crs))# Forces computationarray=band.render_to_array()band.render_to_file("output.tif")
安装
安装gdal是最具挑战性的部分。从历史上看,直接从pypi安装是不太可能的。
首先,安装numpy:
pip install numpy
然后,选择下列选项之一:
- 使用系统包管理器安装
- ubuntu:
sudo apt install libgdal-dev
- macos:
brew install gdal
- ubuntu:
- 从Conda Forge安装:
conda install -c conda-forge gdal
- compile manually
之后,可以使用
pip install GDAL==$(gdal-config --version) --global-option=build_ext --global-option="-I/usr/include/gdal"
最后,
pip install picoraster
运行测试
python -m src.tests