根据调试,发现主要是进行 array运算时出现的该异常
from osgeo import ogr
from osgeo import gdal
from osgeo import gdal_array as ga
import os,math,ogr,osr
def calculateNdvi(clip_raster,ndvi_raster):
print("calculateNdvi...")
img_array = ga.LoadFile(clip_raster)
a = img_array[3]-img_array[2]
b = img_array[3]+img_array[2]
ndvi_array = a/