From: Regina Obe Date: Sun, 4 Oct 2015 20:47:09 +0000 (+0000) Subject: #3315: fix typos in error messages for map algebra mask and provide more descriptive... X-Git-Tag: 2.2.0~25 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ffc47387c9f408eae3040820f0da78063154ac2c;p=postgis #3315: fix typos in error messages for map algebra mask and provide more descriptive error about dimension mismatch git-svn-id: http://svn.osgeo.org/postgis/trunk@14185 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/raster/rt_core/rt_pixel.c b/raster/rt_core/rt_pixel.c index 2ba955301..099e9098b 100644 --- a/raster/rt_core/rt_pixel.c +++ b/raster/rt_core/rt_pixel.c @@ -311,8 +311,8 @@ rt_errorstate rt_pixel_set_to_array( /* make sure that the dimx and dimy match mask */ if( mask != NULL) { - if ( dim[0] != mask-> dimx || dim[1] != mask->dimy ){ - rterror("rt_pixel_set_array: mask dimentions do not match given dims"); + if ( dim[0] != mask->dimx || dim[1] != mask->dimy ){ + rterror("rt_pixel_set_array: mask dimensions %d x %d do not match given dims %d x %d", mask->dimx, mask->dimy, dim[0], dim[1]); return ES_ERROR; } diff --git a/raster/rt_pg/rtpg_mapalgebra.c b/raster/rt_pg/rtpg_mapalgebra.c index 9dd039fcb..4908e94cc 100644 --- a/raster/rt_pg/rtpg_mapalgebra.c +++ b/raster/rt_pg/rtpg_mapalgebra.c @@ -652,14 +652,14 @@ Datum RASTER_nMapAlgebra(PG_FUNCTION_ARGS) break; default: rtpg_nmapalgebra_arg_destroy(arg); - elog(ERROR,"RASTER_nMapAlgerbra: Mask data type must be FLOAT8 or FLOAT4."); + elog(ERROR,"RASTER_nMapAlgebra: Mask data type must be FLOAT8 or FLOAT4."); PG_RETURN_NULL(); } ndims = ARR_NDIM(maskArray); if( ndims != 2 ){ - elog(ERROR, "RASTER_nMapAlgerbra: Mask Must be a 2D array."); + elog(ERROR, "RASTER_nMapAlgebra: Mask Must be a 2D array."); rtpg_nmapalgebra_arg_destroy(arg); PG_RETURN_NULL(); } @@ -668,7 +668,7 @@ Datum RASTER_nMapAlgebra(PG_FUNCTION_ARGS) if ( maskDims[0] % 2 == 0 || maskDims[1] % 2 == 0 ){ - elog(ERROR,"RASTER_nMapAlgerbra: Mask dimenstions must be odd."); + elog(ERROR,"RASTER_nMapAlgebra: Mask dimensions must be odd."); rtpg_nmapalgebra_arg_destroy(arg); PG_RETURN_NULL(); } @@ -685,7 +685,7 @@ Datum RASTER_nMapAlgebra(PG_FUNCTION_ARGS) pfree(maskElements); pfree(maskNulls); } - elog(ERROR, "RASTER_nMapAlgerbra: Could not deconstruct new values array."); + elog(ERROR, "RASTER_nMapAlgebra: Could not deconstruct new values array."); rtpg_nmapalgebra_arg_destroy(arg); PG_RETURN_NULL(); } @@ -719,7 +719,7 @@ Datum RASTER_nMapAlgebra(PG_FUNCTION_ARGS) i++; } } - /*set mask dimenstions*/ + /*set mask dimensions*/ arg->mask->dimx = maskDims[0]; arg->mask->dimy = maskDims[1]; if ( maskDims[0] == 1 && maskDims[1] == 1){ diff --git a/raster/test/regress/rt_mapalgebra_mask_expected b/raster/test/regress/rt_mapalgebra_mask_expected index ae8869a26..11c743f82 100644 --- a/raster/test/regress/rt_mapalgebra_mask_expected +++ b/raster/test/regress/rt_mapalgebra_mask_expected @@ -1,12 +1,12 @@ NOTICE: First argument (nband) of rastbandarg at index 0 is NULL. Assuming NULL raster NOTICE: All input rasters are NULL. Returning NULL -ERROR: RASTER_nMapAlgerbra: Mask dimenstions must be odd. +ERROR: RASTER_nMapAlgebra: Mask dimensions must be odd. NOTICE: First argument (nband) of rastbandarg at index 0 is NULL. Assuming NULL raster NOTICE: All input rasters are NULL. Returning NULL -ERROR: RASTER_nMapAlgerbra: Mask dimenstions must be odd. +ERROR: RASTER_nMapAlgebra: Mask dimensions must be odd. NOTICE: First argument (nband) of rastbandarg at index 0 is NULL. Assuming NULL raster NOTICE: All input rasters are NULL. Returning NULL -ERROR: RASTER_nMapAlgerbra: Mask dimenstions must be odd. +ERROR: RASTER_nMapAlgebra: Mask dimensions must be odd. NOTICE: First argument (nband) of rastbandarg at index 0 is NULL. Assuming NULL raster NOTICE: All input rasters are NULL. Returning NULL NOTICE: All input rasters do not have bands at indicated indexes. Returning empty raster @@ -52,10 +52,10 @@ NOTICE: userargs = 0100000100000000000000F03F000000000000F0BF000000000000F03F000000000000F0BF0000000000000000000000000000000000000000020002004400FFFFFFFF NOTICE: First argument (nband) of rastbandarg at index 0 is NULL. Assuming NULL raster NOTICE: All input rasters are NULL. Returning NULL -ERROR: RASTER_nMapAlgerbra: Mask Must be a 2D array. +ERROR: RASTER_nMapAlgebra: Mask Must be a 2D array. NOTICE: First argument (nband) of rastbandarg at index 0 is NULL. Assuming NULL raster NOTICE: All input rasters are NULL. Returning NULL -ERROR: RASTER_nMapAlgerbra: Mask Must be a 2D array. +ERROR: RASTER_nMapAlgebra: Mask Must be a 2D array. NOTICE: First argument (nband) of rastbandarg at index 0 is NULL. Assuming NULL raster NOTICE: All input rasters are NULL. Returning NULL NOTICE: All input rasters do not have bands at indicated indexes. Returning empty raster @@ -230,10 +230,10 @@ NOTICE: userargs = 0100000100000000000000F03F000000000000F0BF000000000000F03F000000000000F0BF0000000000000000000000000000000000000000020002004400FFFFFFFF NOTICE: First argument (nband) of rastbandarg at index 0 is NULL. Assuming NULL raster NOTICE: All input rasters are NULL. Returning NULL -ERROR: RASTER_nMapAlgerbra: Mask dimenstions must be odd. +ERROR: RASTER_nMapAlgebra: Mask dimensions must be odd. NOTICE: First argument (nband) of rastbandarg at index 0 is NULL. Assuming NULL raster NOTICE: All input rasters are NULL. Returning NULL -ERROR: RASTER_nMapAlgerbra: Mask dimenstions must be odd. +ERROR: RASTER_nMapAlgebra: Mask dimensions must be odd. NOTICE: First argument (nband) of rastbandarg at index 0 is NULL. Assuming NULL raster NOTICE: All input rasters are NULL. Returning NULL NOTICE: All input rasters do not have bands at indicated indexes. Returning empty raster @@ -279,10 +279,10 @@ NOTICE: userargs = 0100000100000000000000F03F000000000000F0BF000000000000F03F000000000000F0BF0000000000000000000000000000000000000000020002004400FFFFFFFF NOTICE: First argument (nband) of rastbandarg at index 0 is NULL. Assuming NULL raster NOTICE: All input rasters are NULL. Returning NULL -ERROR: RASTER_nMapAlgerbra: Mask Must be a 2D array. +ERROR: RASTER_nMapAlgebra: Mask Must be a 2D array. NOTICE: First argument (nband) of rastbandarg at index 0 is NULL. Assuming NULL raster NOTICE: All input rasters are NULL. Returning NULL -ERROR: RASTER_nMapAlgerbra: Mask Must be a 2D array. +ERROR: RASTER_nMapAlgebra: Mask Must be a 2D array. NOTICE: First argument (nband) of rastbandarg at index 0 is NULL. Assuming NULL raster NOTICE: All input rasters are NULL. Returning NULL NOTICE: All input rasters do not have bands at indicated indexes. Returning empty raster @@ -457,13 +457,13 @@ NOTICE: userargs = 0100000100000000000000F03F000000000000F0BF000000000000F03F000000000000F0BF0000000000000000000000000000000000000000020002004400FFFFFFFF NOTICE: First argument (nband) of rastbandarg at index 0 is NULL. Assuming NULL raster NOTICE: All input rasters are NULL. Returning NULL -ERROR: RASTER_nMapAlgerbra: Mask dimenstions must be odd. +ERROR: RASTER_nMapAlgebra: Mask dimensions must be odd. NOTICE: First argument (nband) of rastbandarg at index 0 is NULL. Assuming NULL raster NOTICE: All input rasters are NULL. Returning NULL -ERROR: RASTER_nMapAlgerbra: Mask dimenstions must be odd. +ERROR: RASTER_nMapAlgebra: Mask dimensions must be odd. NOTICE: First argument (nband) of rastbandarg at index 0 is NULL. Assuming NULL raster NOTICE: All input rasters are NULL. Returning NULL -ERROR: RASTER_nMapAlgerbra: Mask Must be a 2D array. +ERROR: RASTER_nMapAlgebra: Mask Must be a 2D array. NOTICE: First argument (nband) of rastbandarg at index 0 is NULL. Assuming NULL raster NOTICE: All input rasters are NULL. Returning NULL NOTICE: All input rasters do not have bands at indicated indexes. Returning empty raster