I just study on GIS systemwhen I create the tiff file, there is no any data in tiff fileI want to make 4 channel tiff file
my code is below
void crop(const char *inputPath, const char *cropPath, double topLeftX, double topLeftY,double width, double height){
GDALDataset *pInputRaster, *pCroppedRaster;GDALDriver *pDriver;const char *pszFormat = "GTiff";pDriver = GetGDALDriverManager()->GetDriverByName(pszFormat);pInputRaster = (GDALDataset*) GDALOpen(inputPath, GA_ReadOnly);//the affine transformation information, you will need to adjust this to properly//display the clipped rasterdouble transform[6];pInputRaster->GetGeoTransform(transform);//adjust top left coordinatestransform[0] = topLeftX;transform[3] = topLeftY;//determine dimensions of the new (cropped) raster in cellsint xSize = round(width/transform[1]);int ySize = round(height/transform[1]);//create the new (cropped) dataset//printf("croppath = %s \n",cropPath);pCroppedRaster = pDriver->Create(cropPath, xSize, ySize, 1, GDT_Float32, NULL); //or something similar}
as you see above file, I can make the tiff file, but there is no any dataif you know what is wrong, please teach meThank you
أكثر...
my code is below
void crop(const char *inputPath, const char *cropPath, double topLeftX, double topLeftY,double width, double height){
GDALDataset *pInputRaster, *pCroppedRaster;GDALDriver *pDriver;const char *pszFormat = "GTiff";pDriver = GetGDALDriverManager()->GetDriverByName(pszFormat);pInputRaster = (GDALDataset*) GDALOpen(inputPath, GA_ReadOnly);//the affine transformation information, you will need to adjust this to properly//display the clipped rasterdouble transform[6];pInputRaster->GetGeoTransform(transform);//adjust top left coordinatestransform[0] = topLeftX;transform[3] = topLeftY;//determine dimensions of the new (cropped) raster in cellsint xSize = round(width/transform[1]);int ySize = round(height/transform[1]);//create the new (cropped) dataset//printf("croppath = %s \n",cropPath);pCroppedRaster = pDriver->Create(cropPath, xSize, ySize, 1, GDT_Float32, NULL); //or something similar}

as you see above file, I can make the tiff file, but there is no any dataif you know what is wrong, please teach meThank you
أكثر...