246 bool forcechecking =
FALSE;
247 bool bandisnodata =
FALSE;
250 bandindex = PG_GETARG_INT32(1);
251 if ( bandindex < 1 ) {
252 elog(NOTICE,
"Invalid band index (must use 1-based). Returning NULL");
257 if (PG_ARGISNULL(0)) PG_RETURN_NULL();
258 pgraster = (
rt_pgraster *)PG_DETOAST_DATUM(PG_GETARG_DATUM(0));
262 PG_FREE_IF_COPY(pgraster, 0);
263 elog(ERROR,
"RASTER_bandIsNoData: Could not deserialize raster");
270 elog(NOTICE,
"Could not find raster band of index %d when determining if band is nodata. Returning NULL", bandindex);
272 PG_FREE_IF_COPY(pgraster, 0);
276 forcechecking = PG_GETARG_BOOL(2);
278 bandisnodata = (forcechecking) ?
282 PG_FREE_IF_COPY(pgraster, 0);
284 PG_RETURN_BOOL(bandisnodata);
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.
int rt_band_check_is_nodata(rt_band band)
Returns TRUE if the band is only nodata values.
rt_raster rt_raster_deserialize(void *serialized, int header_only)
Return a raster from a serialized form.
rt_band rt_raster_get_band(rt_raster raster, int bandNum)
Return Nth band, or NULL if unavailable.
raster
Be careful!! Zeros function's input parameter can be a (height x width) array, not (width x height): ...