rast = rt_raster_from_two_rasters(rtnrast, _param->raster[i], extenttype, &status, NULL);
rtdealloc(rtnrast);
+
if (rast == NULL || !status) {
rterror("rt_raster_iterator: Unable to compute %s extent of rasters",
extenttype == ET_UNION ? "union" : "intersection"
return NULL;
}
else if (rt_raster_is_empty(rast)) {
- rterror("rt_raster_iterator: Computed raster for %s extent is empty",
+ rtinfo("rt_raster_iterator: Computed raster for %s extent is empty",
extenttype == ET_UNION ? "union" : "intersection"
);
_rti_param_destroy(_param);
+ *noerr = 1;
return NULL;
}
+
rtnrast = rast;
rast = NULL;
}
rtpg_nmapalgebra_arg_destroy(arg);
if (!noerr) {
- elog(ERROR, "RASTER_nMapAlgebra: Unable to run raster interator function");
+ elog(ERROR, "RASTER_nMapAlgebra: Unable to run raster iterator function");
PG_RETURN_NULL();
}
+ else if (raster == NULL)
+ PG_RETURN_NULL();
pgraster = rt_raster_serialize(raster);
rt_raster_destroy(raster);
);
if (!noerr) {
- elog(ERROR, "RASTER_union_transfn: Unable to run raster interator function");
+ elog(ERROR, "RASTER_union_transfn: Unable to run raster iterator function");
pfree(itrset);
rtpg_union_arg_destroy(iwr);
);
if (!noerr) {
- elog(ERROR, "RASTER_union_finalfn: Unable to run raster interator function");
+ elog(ERROR, "RASTER_union_finalfn: Unable to run raster iterator function");
pfree(itrset);
rtpg_union_arg_destroy(iwr);
if (_rtn != NULL)
(ST_BandMetadata(rast, 1))
FROM foo;
+WITH foo AS (
+ SELECT
+ t1.rid AS rid1,
+ t2.rid AS rid2,
+ t3.rid AS rid3,
+ ST_MapAlgebra(
+ ARRAY[ROW(t1.rast, 1), ROW(t2.rast, 1), ROW(t3.rast, 1)]::rastbandarg[],
+ 'raster_nmapalgebra_test(double precision[], int[], text[])'::regprocedure
+ ) AS rast
+ FROM raster_nmapalgebra_in t1
+ CROSS JOIN raster_nmapalgebra_in t2
+ CROSS JOIN raster_nmapalgebra_in t3
+ WHERE t1.rid = 20
+ AND t2.rid = 21
+ AND t3.rid = 22
+)
+SELECT
+ rid1,
+ rid2,
+ rid3,
+ (ST_Metadata(rast)),
+ (ST_BandMetadata(rast, 1))
+FROM foo;
+
INSERT INTO raster_nmapalgebra_in
SELECT 30, ST_AddBand(ST_AddBand(ST_AddBand(ST_MakeEmptyRaster(2, 2, 0, 0, 1, -1, 0, 0, 0), 1, '16BUI', 1, 0), 2, '8BUI', 10, 0), 3, '32BUI', 100, 0) AS rast UNION ALL
SELECT 31, ST_AddBand(ST_AddBand(ST_AddBand(ST_MakeEmptyRaster(2, 2, 0, 1, 1, -1, 0, 0, 0), 1, '16BUI', 2, 0), 2, '8BUI', 20, 0), 3, '32BUI', 300, 0) AS rast
NOTICE: pos = [0:2][1:2]={{1,1},{2,2},{1,1}}
NOTICE: userargs = <NULL>
20|21|(1,-1,1,1,1,-1,0,0,0,1)|(16BUI,0,f,)
-ERROR: rt_raster_iterator: Computed raster for intersection extent is empty
+NOTICE: rt_raster_iterator: Computed raster for intersection extent is empty
+20|22||
NOTICE: value = {{{2}},{{3}}}
NOTICE: pos = [0:2][1:2]={{1,1},{1,2},{2,1}}
NOTICE: userargs = <NULL>
NOTICE: pos = [0:3][1:2]={{2,2},{2,4},{1,3},{2,2}}
NOTICE: userargs = <NULL>
20|21|22|(0,-2,2,2,1,-1,0,0,0,1)|(16BUI,0,f,)
+NOTICE: rt_raster_iterator: Computed raster for intersection extent is empty
+20|21|22||
NOTICE: value = {{{1}},{{10}},{{100}}}
NOTICE: pos = [0:3][1:2]={{1,1},{1,1},{1,1},{1,1}}
NOTICE: userargs = <NULL>