Linux环境:
- 安装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
- 创建Python环境
# 安装
conda create -n python3.6 python=3.6
# 激活
conda activate python3.6
- 安装gdal
conda install conda-forge::gdal
- 安装pyinstaller
pip install pyinstaller -i https://pypi.tuna.tsinghua.edu.cn/simple
or
pip install pyinstaller
- 打包gdal_retile.py
pyinstaller -F /root/miniconda3/bin/gdal_retile.py --clean
- 测试
dist/gdal_retile -v -r bilinear -levels 20 -ps 256 256 \
-targetDir /home/test -co TILED=YES /home/xxx.tif
- 更多参数
官方文档