Skip to content

Commit

Permalink
gdalenhance: Use GDALDataset::FromHandle
Browse files Browse the repository at this point in the history
  • Loading branch information
dbaston committed Nov 4, 2024
1 parent a503cdc commit f83e9be
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions apps/gdalenhance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -643,16 +643,15 @@ CPLErr WriteEnhanced(GDALDatasetH hDataset, int **papanLUTs, int nLUTBins,
GDALGetGCPProjection(hDataset));
}

poVDS->SetMetadata(static_cast<GDALDataset *>(hDataset)->GetMetadata());
poVDS->SetMetadata(GDALDataset::FromHandle(hDataset)->GetMetadata());

for (int iBand = 0; iBand < nBandCount; iBand++)
{
VRTSourcedRasterBand *poVRTBand;
GDALRasterBand *poSrcBand;
GDALDataType eBandType;

poSrcBand =
static_cast<GDALDataset *>(hDataset)->GetRasterBand(iBand + 1);
poSrcBand = GDALDataset::FromHandle(hDataset)->GetRasterBand(iBand + 1);

/* ---------------------------------------------------------------- */
/* Select output data type to match source. */
Expand Down

0 comments on commit f83e9be

Please sign in to comment.