916 int32_t bandindex = 1;
917 const char *outdbpathchar = NULL;
918 int32_t outdbindex = 1;
919 bool forceset =
FALSE;
923 double nodataval = 0.;
927 pgraster = (
rt_pgraster *) PG_DETOAST_DATUM(PG_GETARG_DATUM(0));
931 PG_FREE_IF_COPY(pgraster, 0);
932 elog(ERROR,
"RASTER_setBandPath: Cannot deserialize raster");
937 if (!PG_ARGISNULL(1))
938 bandindex = PG_GETARG_INT32(1);
941 elog(NOTICE,
"Invalid band index (must use 1-based). Returning original raster");
947 elog(NOTICE,
"Cannot find raster band of index %d. Returning original raster", bandindex);
949 elog(NOTICE,
"Band of index %d is not out-db. Returning original raster", bandindex);
953 if (!PG_ARGISNULL(2))
959 if (!PG_ARGISNULL(3))
960 outdbindex = PG_GETARG_INT32(3);
963 if (!PG_ARGISNULL(4))
964 forceset = PG_GETARG_BOOL(4);
981 elog(NOTICE,
"Cannot change path of band. Returning original raster");
991 PG_FREE_IF_COPY(pgraster, 0);
992 if (!pgrtn) PG_RETURN_NULL();
994 SET_VARSIZE(pgrtn, pgrtn->
size);
995 PG_RETURN_POINTER(pgrtn);
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).
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.
void * rt_raster_serialize(rt_raster raster)
Return this raster in serialized form.
rt_band rt_raster_replace_band(rt_raster raster, rt_band band, int index)
Replace band at provided index with new band.
void rt_band_destroy(rt_band band)
Destroy a raster band.
uint16_t rt_raster_get_height(rt_raster raster)
rt_errorstate rt_band_get_nodata(rt_band band, double *nodata)
Get NODATA value.
rt_band rt_band_new_offline_from_path(uint16_t width, uint16_t height, int hasnodata, double nodataval, uint8_t bandNum, const char *path, int force)
Create an out-db rt_band from path.
uint16_t rt_raster_get_width(rt_raster raster)
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): ...
char * text_to_cstring(const text *textptr)