ERROR 1: Writing through VRTSourcedRasterBand is not supported.
ERROR 1: C:\Users\Lenovo\AppData\Local\Temp\s8fk.0, band 1: IReadBlock failed at X offset 0, Y offset 0: Writing through VRTSourcedRasterBand is not supported.
GDALDataset *m_out_ds=(GDALDataset*)GDALAutoCreateWarpedVRT(poDSRef, in_srs_wkt, out_srs_wkt, GRA_NearestNeighbour , 0,NULL);
//调用该接口时,报上面错误
m_out_ds->RasterIO(GF_Read, rx, ry, rxsize, rysize, outDsRasterIO, wxsize, wysize, m_tiledata, m_dataBandsCount, p_band_list, 0, 0, 0);
调用gdal接口时报错,python走相同的流程不报错,python代码如下:
self.out_ds = gdal.AutoCreateWarpedVRT( self.in_ds, self.in_srs_wkt, self.out_srs.ExportToWkt() )
data = ds.ReadRaster(rx, ry, rxsize, rysize, wxsize, wysize, band_list=list(range(1,self.dataBandsCount+1)))