I am relatively new to GIS.
I have a set of tiff files containing a raster each. I would like to average them, though their extents are slightly different. They each have their geospatial data recorded in their GeoTransform attribute. I am working in Python.
I have attempted to use GDAL to build a vrt and then average the resulting array, but I am given an error I cannot solve.
My attempt is based off this question here: raster algebra in python with rasters of different extents
#Conglomerate tiff files into a vrt
os.system('gdalbuildvrt obs_avg.vrt %s'%('Obs_tiffs/*.tif'))
print '-----Attempting to open'
g = gdal.Open('obs_avg.vrt')
data = g.ReadAsArray()
mdata = np.ma.array(data, mask=(data==0))
mean = mdata.mean(axis=0)
#Checking output
print type(mean)
print data.shape
plt.imshow(mean)
plt.show()
However, I am given the following error:
0...10...20...30...40...50...60...70...80...90...100 - done. gdalbuildvrt does not support positive NS resolution. Skipping outdir/Obs_tiffs/inputfile.tif
Which causes the vrt to not be created.
What is the cause of this error?