![]() ![]() localize the X,Y offset to the raster block ![]() SrcBnd->RasterIO(GDALRWFlag::GF_Read,ColOff,RowOff,ReadCols,ReadRows,RasterBlock,ReadCols,ReadRows,GDALDataType::GDT_Float32,0,0) This raster has only one band.įloat* RasterBlock = (float*)malloc(ReadRows*ReadCols*sizeof(float)) ![]() GDALRasterBand* SrcBnd = SourceRasterDS->GetRasterBand(1) // just one band - 1 based, not 0. SourceRasterDS->GetGeoTransform(GeoTransform) // from the raster dataset GDALDataset* SourceRasterDS = (GDALDataset*) GDALOpen(Raster,GA_ReadOnly) ĭouble GeoTransform // Get the geotransform object open your raster - format doesn't matter as all the drivers are registered GDALAllRegister() // register all drivers Here's just the nuts-and-bolts from some working code: #include "gdal_priv.h" ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |