297 const char *bandpath;
301 bandindex = PG_GETARG_INT32(1);
302 if ( bandindex < 1 ) {
303 elog(NOTICE,
"Invalid band index (must use 1-based). Returning NULL");
308 if (PG_ARGISNULL(0)) PG_RETURN_NULL();
309 pgraster = (
rt_pgraster *)PG_DETOAST_DATUM(PG_GETARG_DATUM(0));
313 PG_FREE_IF_COPY(pgraster, 0);
314 elog(ERROR,
"RASTER_getBandPath: Could not deserialize raster");
323 "Could not find raster band of index %d when getting band path. Returning NULL",
327 PG_FREE_IF_COPY(pgraster, 0);
335 PG_FREE_IF_COPY(pgraster, 0);
339 result = cstring_to_text(bandpath);
343 PG_FREE_IF_COPY(pgraster, 0);
345 PG_RETURN_TEXT_P(result);
const char * rt_band_get_ext_path(rt_band band)
Return band's external path (only valid when rt_band_is_offline returns non-zero).
void rt_raster_destroy(rt_raster raster)
Release memory associated to a raster.
void rt_band_destroy(rt_band band)
Destroy a raster band.
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): ...