打包gdal_retile.py切片工具

本文详细介绍了如何在Linux系统中安装和配置Miniconda,创建Python3.6环境,以及如何使用conda安装GDAL和PyInstaller。步骤包括设置环境变量、安装软件包,并演示了如何打包GDAL_retile.py脚本进行测试。
摘要由CSDN通过智能技术生成

Linux环境:

  1. 安装conda
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
bash /tmp/Miniconda3-latest-Linux-x86_64.sh
tee /etc/profile.d/conda.sh<<EOF
export PATH="/root/miniconda3/bin/:\$PATH"
EOF
source /etc/profile.d/conda.sh
conda config --set auto_activate_base false
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
  1. 创建Python环境
# 安装
conda create -n python3.6 python=3.6
# 激活
conda activate python3.6
  1. 安装gdal
conda install conda-forge::gdal
  1. 安装pyinstaller
pip install pyinstaller -i https://pypi.tuna.tsinghua.edu.cn/simple
or
pip install pyinstaller
  1. 打包gdal_retile.py
pyinstaller -F /root/miniconda3/bin/gdal_retile.py --clean
  1. 测试
dist/gdal_retile -v -r bilinear -levels 20 -ps 256 256 \
-targetDir /home/test -co TILED=YES /home/xxx.tif
  1. 更多参数
    官方文档
  • 9
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值