From: Regina Obe Date: Sat, 24 Jun 2017 04:57:54 +0000 (+0000) Subject: Change ST_Clip from Error to Notice when ST_Clip can compute no band X-Git-Tag: 2.4.0alpha~53 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7070338c10d00f3a5e25b231f1b05aaa34d78704;p=postgis Change ST_Clip from Error to Notice when ST_Clip can compute no band References #3730 for PostGIS 2.4 git-svn-id: http://svn.osgeo.org/postgis/trunk@15456 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/raster/rt_pg/rtpg_mapalgebra.c b/raster/rt_pg/rtpg_mapalgebra.c index c0c8ca86d..6629c9466 100644 --- a/raster/rt_pg/rtpg_mapalgebra.c +++ b/raster/rt_pg/rtpg_mapalgebra.c @@ -520,7 +520,7 @@ Datum RASTER_nMapAlgebra(PG_FUNCTION_ARGS) int num; int *maskDims; int x,y; - + int i = 0; int noerr = 0; @@ -662,7 +662,7 @@ Datum RASTER_nMapAlgebra(PG_FUNCTION_ARGS) rtpg_nmapalgebra_arg_destroy(arg); PG_RETURN_NULL(); } - + maskDims = ARR_DIMS(maskArray); if (maskDims[0] % 2 == 0 || maskDims[1] % 2 == 0) { @@ -670,7 +670,7 @@ Datum RASTER_nMapAlgebra(PG_FUNCTION_ARGS) rtpg_nmapalgebra_arg_destroy(arg); PG_RETURN_NULL(); } - + deconstruct_array( maskArray, etype, @@ -742,7 +742,7 @@ Datum RASTER_nMapAlgebra(PG_FUNCTION_ARGS) } noerr = 1; - + /* all rasters are empty, return empty raster */ if (allempty == arg->numraster) { elog(NOTICE, "All input rasters are empty. Returning empty raster"); @@ -2855,7 +2855,7 @@ Datum RASTER_union_finalfn(PG_FUNCTION_ARGS) ) { rt_raster_destroy(_raster); } - + for (j = 0; j < iwr->bandarg[i].numraster; j++) { if (iwr->bandarg[i].raster[j] == NULL) continue; @@ -3395,7 +3395,7 @@ Datum RASTER_clip(PG_FUNCTION_ARGS) rt_raster_destroy(_raster); rt_raster_destroy(rtn); PG_FREE_IF_COPY(pgraster, 0); - elog(ERROR, "RASTER_clip: Could not get band from working raster"); + elog(NOTICE, "RASTER_clip: Could not get band from working raster"); PG_RETURN_NULL(); } @@ -4272,7 +4272,7 @@ Datum RASTER_colorMap(PG_FUNCTION_ARGS) /* get the band stats */ if (arg->bandstats == NULL) { POSTGIS_RT_DEBUG(4, "Getting band stats"); - + arg->bandstats = rt_band_get_summary_stats(arg->band, 1, 1, 0, NULL, NULL, NULL); if (arg->bandstats == NULL) { pfree(_element);