参考:将原GeoTIFF数据的投影坐标信息赋值到新创建的文件上

pro tiff_projection

  ;启动ENVI

  e = ENVI(/HEADLESS)

  ;打开文件

  file = 'D:\01-Working\2017\20171204-IDL平均计算\GOCI_0510\GOCI_0510_01_GDPS_RC_GEO_ZJ_MASK_BIL_FLAASH_TSM.tif'

  raster = e.OpenRaster(file)

  ;读取影像的第一个波段
data = raster.GetData(BANDS = 0) ;另存为新文件
resultFile = 'D:\01-Working\2017\20171204-IDL平均计算\cc.tif'
newRaster = e.CreateRaster(resultFile, data, INHERITS_FROM = raster)
newRaster.Save end
05-15 23:51