362 bandindex = PG_GETARG_INT32(1);
363 if ( bandindex < 1 ) {
364 elog(NOTICE,
"Invalid band index (must use 1-based). Returning NULL");
368 if (PG_ARGISNULL(0)) PG_RETURN_NULL();
369 pgraster = (
rt_pgraster *)PG_DETOAST_DATUM(PG_GETARG_DATUM(0));
373 PG_FREE_IF_COPY(pgraster, 0);
374 elog(ERROR,
"RASTER_getFileSize: Could not deserialize raster");
383 "Could not find raster band of index %d when getting band path. Returning NULL",
387 PG_FREE_IF_COPY(pgraster, 0);
392 elog(NOTICE,
"Band of index %d is not out-db.", bandindex);
395 PG_FREE_IF_COPY(pgraster, 0);
403 PG_FREE_IF_COPY(pgraster, 0);
405 PG_RETURN_INT64(fileSize);
void rt_raster_destroy(rt_raster raster)
Release memory associated to a raster.
uint64_t rt_band_get_file_size(rt_band band)
Return file size in bytes.
void rt_band_destroy(rt_band band)
Destroy a raster band.
int rt_band_is_offline(rt_band band)
Return non-zero if the given band data is on the filesystem.
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): ...