赞
踩
参考https://www.jianshu.com/p/821c741ff169
- def rasterwarp(base_file,inpath,outpath):
- if not os.path.exists(outpath):
- os.mkdir(outpath)
- out_file = os.path.join(outpath,'mcd12q1.tif')
- inputrasfile1 = gdal.Open(base_file, gdal.GA_ReadOnly) # 第一幅影像
- inputProj1 = inputrasfile1.GetProjection()
- options = gdal.WarpOptions(srcSRS=inputProj1, dstSRS=inputProj1, format='GTiff', resampleAlg=gdalconst.GRA_Max)
- rasterlist = []
- filelist = pathlib.Path(inpath).glob('*.tif')
- for rasterfile in filelist:
- rasterfile = str(rasterfile)
- inputrasfile2 = gdal.Open(rasterfile, gdal.GA_ReadOnly) # 第二幅影像
- rasterl
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。