chore: remove large file and update .gitignore
This commit is contained in:
BIN
public/image/clean_rgb_downsampled.tif
Normal file
BIN
public/image/clean_rgb_downsampled.tif
Normal file
Binary file not shown.
55
public/image/convert_tif.bat
Normal file
55
public/image/convert_tif.bat
Normal file
@ -0,0 +1,55 @@
|
||||
@echo off
|
||||
setlocal
|
||||
|
||||
REM 源文件
|
||||
set SRC=odm_orthophoto.tif
|
||||
|
||||
REM 中间文件:去掩膜 + 保留 4 波段
|
||||
set TMP1=tmp_nomask.tif
|
||||
|
||||
REM 中间文件:gdalwarp 处理透明通道
|
||||
set TMP2=tmp_nomask_alpha.tif
|
||||
|
||||
REM 最终输出文件(性能优化:缩放 + 压缩)
|
||||
set FINAL=clean_no_mask_optimized.tif
|
||||
|
||||
REM 配置参数
|
||||
REM -tr 0.25x 分辨率控制(0.25 倍像素,或者每个像素大小扩大4倍),视你项目需要可调
|
||||
REM -co 压缩参数:LZW 是无损压缩方式,TILED=YES 支持分块加载
|
||||
REM -r average 使用平均值重采样可保持图像质量
|
||||
|
||||
echo [1/4] gdal_translate:去除掩膜并保留RGBA四波段...
|
||||
gdal_translate -b 1 -b 2 -b 3 -b 4 -mask none -co PHOTOMETRIC=RGB -co ALPHA=YES %SRC% %TMP1%
|
||||
if errorlevel 1 (
|
||||
echo ❌ gdal_translate 失败
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
echo [2/4] gdalwarp:强制生成 Alpha 通道...
|
||||
gdalwarp -dstalpha %TMP1% %TMP2%
|
||||
if errorlevel 1 (
|
||||
echo ❌ gdalwarp 失败
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
echo [3/4] gdalwarp:降采样并启用压缩优化...
|
||||
gdalwarp ^
|
||||
-r average ^
|
||||
-tr 2 2 ^
|
||||
-co COMPRESS=LZW ^
|
||||
-co TILED=YES ^
|
||||
-co PHOTOMETRIC=RGB ^
|
||||
-co ALPHA=YES ^
|
||||
%TMP2% %FINAL%
|
||||
if errorlevel 1 (
|
||||
echo ❌ gdalwarp 压缩优化失败
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
echo [4/4] 清理临时文件...
|
||||
del %TMP1%
|
||||
del %TMP2%
|
||||
|
||||
echo ✅ 完成!优化后的 GeoTIFF 已生成:%FINAL%
|
||||
endlocal
|
||||
pause
|
Reference in New Issue
Block a user