- #2384, Fixed variable datatype in ST_Neighborhood
- #2454, Fix behavior of ST_PixelAsXXX functions regarding
exclude_nodata_value parameter
+ - #2493, Fix behavior of ST_DumpValues when passed an empty raster
PostGIS 2.1.0
2013/MM/DD
}
/* check that raster is not empty */
+ /*
if (rt_raster_is_empty(raster)) {
elog(NOTICE, "Raster provided is empty");
rt_raster_destroy(raster);
MemoryContextSwitchTo(oldcontext);
SRF_RETURN_DONE(funcctx);
}
+ */
/* raster has bands */
numbands = rt_raster_get_num_bands(raster);
/* get each band and dump data */
for (z = 0; z < arg1->numbands; z++) {
+ /* shortcut if raster is empty */
+ if (rt_raster_is_empty(raster))
+ break;
+
band = rt_raster_get_band(raster, arg1->nbands[z]);
if (!band) {
int nband = arg1->nbands[z] + 1;
HeapTuple tuple;
Datum result;
ArrayType *mdValues = NULL;
+ int ndim = 2;
int dim[2] = {arg2->rows, arg2->columns};
int lbound[2] = {1, 1};
/* info about the type of item in the multi-dimensional array (float8). */
get_typlenbyvalalign(FLOAT8OID, &typlen, &typbyval, &typalign);
+ /* if values is NULL, return empty array */
+ if (arg2->values[call_cntr] == NULL)
+ ndim = 0;
+
/* assemble 3-dimension array of values */
mdValues = construct_md_array(
arg2->values[call_cntr], arg2->nodata[call_cntr],
- 2, dim, lbound,
+ ndim, dim, lbound,
FLOAT8OID,
typlen, typbyval, typalign
);