239 bool forcechecking =
FALSE;
240 bool bandisnodata =
FALSE;
243 bandindex = PG_GETARG_INT32(1);
244 if ( bandindex < 1 ) {
245 elog(NOTICE,
"Invalid band index (must use 1-based). Returning NULL");
250 if (PG_ARGISNULL(0)) PG_RETURN_NULL();
251 pgraster = (
rt_pgraster *)PG_DETOAST_DATUM(PG_GETARG_DATUM(0));
255 PG_FREE_IF_COPY(pgraster, 0);
256 elog(ERROR,
"RASTER_bandIsNoData: Could not deserialize raster");
263 elog(NOTICE,
"Could not find raster band of index %d when determining if band is nodata. Returning NULL", bandindex);
265 PG_FREE_IF_COPY(pgraster, 0);
269 forcechecking = PG_GETARG_BOOL(2);
271 bandisnodata = (forcechecking) ?
275 PG_FREE_IF_COPY(pgraster, 0);
277 PG_RETURN_BOOL(bandisnodata);
raster
Be careful!! Zeros function's input parameter can be a (height x width) array, not (width x height): ...
rt_band rt_raster_get_band(rt_raster raster, int bandNum)
Return Nth band, or NULL if unavailable.
int rt_band_check_is_nodata(rt_band band)
Returns TRUE if the band is only nodata values.
void rt_raster_destroy(rt_raster raster)
Release memory associated to a raster.
int rt_band_get_isnodata_flag(rt_band band)
Get isnodata flag value.
rt_raster rt_raster_deserialize(void *serialized, int header_only)
Return a raster from a serialized form.