]> granicus.if.org Git - postgis/commitdiff
Change ST_Clip from Error to Notice when ST_Clip can compute no band
authorRegina Obe <lr@pcorp.us>
Sat, 24 Jun 2017 04:57:54 +0000 (04:57 +0000)
committerRegina Obe <lr@pcorp.us>
Sat, 24 Jun 2017 04:57:54 +0000 (04:57 +0000)
References #3730 for PostGIS 2.4

git-svn-id: http://svn.osgeo.org/postgis/trunk@15456 b70326c6-7e19-0410-871a-916f4a2858ee

raster/rt_pg/rtpg_mapalgebra.c

index c0c8ca86de704c42448ddb1aa18541db663525ef..6629c9466ef7feb1be4b7aa256f724a1b4c34dcf 100644 (file)
@@ -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);