问题遇到的现象和发生背景
利用python对影像正射校正,利用在网上找到的代码试了一下出现了”ERROR 6: A 31688 pixels x 31962 lines x 4 bands UInt16 image would be larger than 4GB but this is the largest size a TIFF can be, and BigTIFF is unavailable. Creation failed.“的错误,不知道该怎么处理
问题相关代码,请勿粘贴截图
import os,glob
import time
import gdal,osr
import tarfile
import math
path = 'D:\ENVI\Data\GF1_WFV3_E115.0_N35.6_20190614_L1A0004059202'
os.chdir(path)
tif_files = glob.glob('*.tiff')
##print(tif_files)
filename = os.path.basename(path)
##print(filename)
lon = float(filename.split('_')[2][1:])
zone_ = int(math.ceil(lon / 6)) + 30
zone = int ("326" + str(zone_))
##print(zone)
inputfile = gdal.Open(tif_files[0]) #读取输入数据
outputfile = tif_files[0][:-5] + '_orrho.tiff' ##定义输出路径
denfile = {"RPC_DEM = D:\ENVI\Data\shiyan0614\GMTED2010.jp2"} ##dem文件
dstSRS = osr.SpatialReference() ##定义投影信息
dstSRS.ImportFromEPSG(zone) ##定义投影信息
##正射校正
starttime = time.time()
process = gdal.Warp(outputfile, inputfile, format="Gtiff", xRes=8, yRes=8, dstSRS=dstSRS, rpc=True, transformerOptions=denfile)
endtime = time.time()
del inputfile, outputfile, process
print(endtime-starttime)
运行结果及报错内容
ERROR 6: A 31688 pixels x 31962 lines x 4 bands UInt16 image would be larger than 4GB but this is the largest size a TIFF can be, and BigTIFF is unavailable. Creation failed.