From 5399f6502d80040812700f17efaf5a602198ae6f Mon Sep 17 00:00:00 2001 From: Bborie Park Date: Fri, 10 Jun 2011 18:14:51 +0000 Subject: [PATCH] Explicitly set GDALWarpOptions element padfSrcNoDataImag as it seems some folks are having regression error. Based upon the GDAL code, explicitly setting padfSrcNoDataImag and padfDstNoDataImag should eliminate the error message that is occurring. Associated tickets are #925 and #1015. git-svn-id: http://svn.osgeo.org/postgis/trunk@7364 b70326c6-7e19-0410-871a-916f4a2858ee --- raster/rt_core/rt_api.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/raster/rt_core/rt_api.c b/raster/rt_core/rt_api.c index dccedbebe..81ebeb068 100644 --- a/raster/rt_core/rt_api.c +++ b/raster/rt_core/rt_api.c @@ -5940,7 +5940,9 @@ rt_raster_transform(rt_raster raster, char *src_srs, char *dst_srs, numBands = rt_raster_get_num_bands(raster); wopts = GDALCreateWarpOptions(); wopts->padfSrcNoDataReal = (double *) CPLMalloc(numBands * sizeof(double)); + wopts->padfSrcNoDataImag = (double *) CPLMalloc(numBands * sizeof(double)); wopts->padfDstNoDataReal = (double *) CPLMalloc(numBands * sizeof(double)); + wopts->padfDstNoDataImag = (double *) CPLMalloc(numBands * sizeof(double)); if (NULL == wopts->padfSrcNoDataReal || NULL == wopts->padfDstNoDataReal) { rterror("rt_raster_transform: Out of memory allocating nodata mapping\n"); GDALDestroyWarpOptions(wopts); @@ -5964,7 +5966,6 @@ rt_raster_transform(rt_raster raster, char *src_srs, char *dst_srs, the problem is that there is a chance that this number is a legitamate value */ wopts->padfSrcNoDataReal[i] = -123456.789; - ; } else { hasnodata = 1; @@ -5973,6 +5974,7 @@ rt_raster_transform(rt_raster raster, char *src_srs, char *dst_srs, } wopts->padfDstNoDataReal[i] = wopts->padfSrcNoDataReal[i]; + wopts->padfDstNoDataImag[i] = wopts->padfSrcNoDataImag[i] = 0.0; } if (!hasnodata) { RASTER_DEBUG(3, "No nodata mapping found"); -- 2.50.1