RASTER_DEBUG(3, "Setting nodata mapping");
numBands = rt_raster_get_num_bands(raster);
wopts = GDALCreateWarpOptions();
+ wopts->nBandCount = numBands;
wopts->padfSrcNoDataReal = (double *) CPLMalloc(numBands * sizeof(double));
wopts->padfDstNoDataReal = (double *) CPLMalloc(numBands * sizeof(double));
wopts->padfSrcNoDataImag = (double *) CPLMalloc(numBands * sizeof(double));
RASTER_DEBUG(3, "Raster reprojected");
if (NULL == dst_ds) {
rterror("rt_raster_transform: Unable to transform raster\n");
- if (NULL != wopts) GDALDestroyWarpOptions(wopts);
+ GDALDestroyWarpOptions(wopts);
GDALClose(src_ds);
GDALDeregisterDriver(src_drv);
GDALDestroyDriver(src_drv);
RASTER_DEBUG(3, "Converting GDAL dataset to raster");
rast = rt_raster_from_gdal_dataset(dst_ds);
- if (NULL != wopts) GDALDestroyWarpOptions(wopts);
+ GDALDestroyWarpOptions(wopts);
GDALClose(dst_ds);
GDALClose(src_ds);
GDALDeregisterDriver(src_drv);