189 if (PG_ARGISNULL(0)) PG_RETURN_NULL();
190 pgraster = (
rt_pgraster *)PG_DETOAST_DATUM(PG_GETARG_DATUM(0));
193 bandindex = PG_GETARG_INT32(1);
194 if ( bandindex < 1 ) {
195 elog(NOTICE,
"Invalid band index (must use 1-based). Returning NULL");
196 PG_FREE_IF_COPY(pgraster, 0);
202 PG_FREE_IF_COPY(pgraster, 0);
203 elog(ERROR,
"RASTER_getBandNoDataValue: Could not deserialize raster");
210 elog(NOTICE,
"Could not find raster band of index %d when getting band nodata value. Returning NULL", bandindex);
212 PG_FREE_IF_COPY(pgraster, 0);
219 PG_FREE_IF_COPY(pgraster, 0);
226 PG_FREE_IF_COPY(pgraster, 0);
228 PG_RETURN_FLOAT8(nodata);
raster
Be careful!! Zeros function's input parameter can be a (height x width) array, not (width x height): ...
rt_errorstate rt_band_get_nodata(rt_band band, double *nodata)
Get NODATA value.
rt_band rt_raster_get_band(rt_raster raster, int bandNum)
Return Nth band, or NULL if unavailable.
int rt_band_get_hasnodata_flag(rt_band band)
Get hasnodata flag value.
void rt_raster_destroy(rt_raster raster)
Release memory associated to a raster.
rt_raster rt_raster_deserialize(void *serialized, int header_only)
Return a raster from a serialized form.