PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ RASTER_clip()

Datum RASTER_clip ( PG_FUNCTION_ARGS  )

Definition at line 3014 of file rtpg_mapalgebra.c.

References ovdump::band, rtpg_clip_arg_t::band, clamp_srid(), ES_NONE, ET_FIRST, ET_INTERSECTION, rtpg_clip_arg_t::extenttype, FALSE, gserialized_get_srid(), window::gt, rtpg_clip_band_t::hasnodata, lwgeom_force_2d(), lwgeom_free(), lwgeom_from_gserialized(), lwgeom_intersection(), lwgeom_is_empty(), lwgeom_ndims(), lwgeom_to_wkb(), rtpg_clip_arg_t::mask, rt_iterator_t::nband, rtpg_clip_band_t::nband, rt_iterator_t::nbnodata, rtpg_clip_band_t::nodataval, rtpg_clip_arg_t::numbands, PG_FUNCTION_INFO_V1(), POSTGIS_RT_DEBUG, POSTGIS_RT_DEBUGF, rt_iterator_t::raster, rtpg_clip_arg_t::raster, RASTER_reclass(), rt_band_get_hasnodata_flag(), rt_band_get_isnodata_flag(), rt_band_get_min_value(), rt_band_get_nodata(), rt_band_get_pixtype(), rt_raster_add_band(), rt_raster_deserialize(), rt_raster_destroy(), rt_raster_from_two_rasters(), rt_raster_gdal_rasterize(), rt_raster_generate_new_band(), rt_raster_get_band(), rt_raster_get_convex_hull(), rt_raster_get_geotransform_matrix(), rt_raster_get_num_bands(), rt_raster_get_srid(), rt_raster_has_band(), rt_raster_is_empty(), rt_raster_iterator(), rt_raster_new(), rt_raster_serialize(), rt_raster_set_srid(), rtpg_clip_arg_destroy(), rtpg_clip_arg_init(), rtpg_clip_callback(), rt_raster_serialized_t::size, rt_raster_serialized_t::srid, SRID_UNKNOWN, and WKB_SFSQL.

Referenced by rtpg_clip_callback().

3015 {
3016  rt_pgraster *pgraster = NULL;
3017  LWGEOM *rastgeom = NULL;
3018  double gt[6] = {0};
3019  int srid = SRID_UNKNOWN;
3020 
3021  rt_pgraster *pgrtn = NULL;
3022  rt_raster rtn = NULL;
3023 
3024  GSERIALIZED *gser = NULL;
3025  LWGEOM *geom = NULL;
3026  unsigned char *wkb = NULL;
3027  size_t wkb_len;
3028 
3029  ArrayType *array;
3030  Oid etype;
3031  Datum *e;
3032  bool *nulls;
3033 
3034  int16 typlen;
3035  bool typbyval;
3036  char typalign;
3037 
3038  int i = 0;
3039  int j = 0;
3040  int k = 0;
3041  rtpg_clip_arg arg = NULL;
3042  LWGEOM *tmpgeom = NULL;
3043  rt_iterator itrset;
3044 
3045  rt_raster _raster = NULL;
3046  rt_band band = NULL;
3047  rt_pixtype pixtype;
3048  int hasnodata;
3049  double nodataval;
3050  int noerr = 0;
3051 
3052  POSTGIS_RT_DEBUG(3, "Starting...");
3053 
3054  /* raster or geometry is NULL, return NULL */
3055  if (PG_ARGISNULL(0) || PG_ARGISNULL(2))
3056  PG_RETURN_NULL();
3057 
3058  /* init arg */
3059  arg = rtpg_clip_arg_init();
3060  if (arg == NULL) {
3061  elog(ERROR, "RASTER_clip: Could not initialize argument structure");
3062  PG_RETURN_NULL();
3063  }
3064 
3065  /* raster (0) */
3066  pgraster = (rt_pgraster *) PG_DETOAST_DATUM(PG_GETARG_DATUM(0));
3067 
3068  /* Get raster object */
3069  arg->raster = rt_raster_deserialize(pgraster, FALSE);
3070  if (arg->raster == NULL) {
3071  rtpg_clip_arg_destroy(arg);
3072  PG_FREE_IF_COPY(pgraster, 0);
3073  elog(ERROR, "RASTER_clip: Could not deserialize raster");
3074  PG_RETURN_NULL();
3075  }
3076 
3077  /* raster is empty, return empty raster */
3078  if (rt_raster_is_empty(arg->raster) || rt_raster_get_num_bands(arg->raster) == 0) {
3079  elog(NOTICE, "Input raster is empty or has no bands. Returning empty raster");
3080 
3081  rtpg_clip_arg_destroy(arg);
3082  PG_FREE_IF_COPY(pgraster, 0);
3083 
3084  rtn = rt_raster_new(0, 0);
3085  if (rtn == NULL) {
3086  elog(ERROR, "RASTER_clip: Could not create empty raster");
3087  PG_RETURN_NULL();
3088  }
3089 
3090  pgrtn = rt_raster_serialize(rtn);
3091  rt_raster_destroy(rtn);
3092  if (NULL == pgrtn)
3093  PG_RETURN_NULL();
3094 
3095  SET_VARSIZE(pgrtn, pgrtn->size);
3096  PG_RETURN_POINTER(pgrtn);
3097  }
3098 
3099  /* metadata */
3101  srid = clamp_srid(rt_raster_get_srid(arg->raster));
3102 
3103  /* geometry (2) */
3104  gser = PG_GETARG_GSERIALIZED_P(2);
3105  geom = lwgeom_from_gserialized(gser);
3106 
3107  /* Get a 2D version of the geometry if necessary */
3108  if (lwgeom_ndims(geom) > 2) {
3109  LWGEOM *geom2d = lwgeom_force_2d(geom);
3110  lwgeom_free(geom);
3111  geom = geom2d;
3112  }
3113 
3114  /* check that SRIDs match */
3115  if (srid != clamp_srid(gserialized_get_srid(gser))) {
3116  elog(NOTICE, "Geometry provided does not have the same SRID as the raster. Returning NULL");
3117 
3118  rtpg_clip_arg_destroy(arg);
3119  PG_FREE_IF_COPY(pgraster, 0);
3120  lwgeom_free(geom);
3121  PG_FREE_IF_COPY(gser, 2);
3122 
3123  PG_RETURN_NULL();
3124  }
3125 
3126  /* crop (4) */
3127  if (!PG_ARGISNULL(4) && !PG_GETARG_BOOL(4))
3128  arg->extenttype = ET_FIRST;
3129 
3130  /* get intersection geometry of input raster and input geometry */
3131  if (rt_raster_get_convex_hull(arg->raster, &rastgeom) != ES_NONE) {
3132 
3133  rtpg_clip_arg_destroy(arg);
3134  PG_FREE_IF_COPY(pgraster, 0);
3135  lwgeom_free(geom);
3136  PG_FREE_IF_COPY(gser, 2);
3137 
3138  elog(ERROR, "RASTER_clip: Could not get convex hull of raster");
3139  PG_RETURN_NULL();
3140  }
3141 
3142  tmpgeom = lwgeom_intersection(rastgeom, geom);
3143  lwgeom_free(rastgeom);
3144  lwgeom_free(geom);
3145  PG_FREE_IF_COPY(gser, 2);
3146  geom = tmpgeom;
3147 
3148  /* intersection is empty AND extent type is INTERSECTION, return empty */
3149  if (lwgeom_is_empty(geom) && arg->extenttype == ET_INTERSECTION) {
3150  elog(NOTICE, "The input raster and input geometry do not intersect. Returning empty raster");
3151 
3152  rtpg_clip_arg_destroy(arg);
3153  PG_FREE_IF_COPY(pgraster, 0);
3154  lwgeom_free(geom);
3155 
3156  rtn = rt_raster_new(0, 0);
3157  if (rtn == NULL) {
3158  elog(ERROR, "RASTER_clip: Could not create empty raster");
3159  PG_RETURN_NULL();
3160  }
3161 
3162  pgrtn = rt_raster_serialize(rtn);
3163  rt_raster_destroy(rtn);
3164  if (NULL == pgrtn)
3165  PG_RETURN_NULL();
3166 
3167  SET_VARSIZE(pgrtn, pgrtn->size);
3168  PG_RETURN_POINTER(pgrtn);
3169  }
3170 
3171  /* nband (1) */
3172  if (!PG_ARGISNULL(1)) {
3173  array = PG_GETARG_ARRAYTYPE_P(1);
3174  etype = ARR_ELEMTYPE(array);
3175  get_typlenbyvalalign(etype, &typlen, &typbyval, &typalign);
3176 
3177  switch (etype) {
3178  case INT2OID:
3179  case INT4OID:
3180  break;
3181  default:
3182  rtpg_clip_arg_destroy(arg);
3183  PG_FREE_IF_COPY(pgraster, 0);
3184  lwgeom_free(geom);
3185  elog(ERROR, "RASTER_clip: Invalid data type for band indexes");
3186  PG_RETURN_NULL();
3187  break;
3188  }
3189 
3190  deconstruct_array(
3191  array, etype,
3192  typlen, typbyval, typalign,
3193  &e, &nulls, &(arg->numbands)
3194  );
3195 
3196  arg->band = palloc(sizeof(struct rtpg_clip_band_t) * arg->numbands);
3197  if (arg->band == NULL) {
3198  rtpg_clip_arg_destroy(arg);
3199  PG_FREE_IF_COPY(pgraster, 0);
3200  lwgeom_free(geom);
3201  elog(ERROR, "RASTER_clip: Could not allocate memory for band arguments");
3202  PG_RETURN_NULL();
3203  }
3204 
3205  for (i = 0, j = 0; i < arg->numbands; i++) {
3206  if (nulls[i]) continue;
3207 
3208  switch (etype) {
3209  case INT2OID:
3210  arg->band[j].nband = DatumGetInt16(e[i]) - 1;
3211  break;
3212  case INT4OID:
3213  arg->band[j].nband = DatumGetInt32(e[i]) - 1;
3214  break;
3215  }
3216 
3217  j++;
3218  }
3219 
3220  if (j < arg->numbands) {
3221  arg->band = repalloc(arg->band, sizeof(struct rtpg_clip_band_t) * j);
3222  if (arg->band == NULL) {
3223  rtpg_clip_arg_destroy(arg);
3224  PG_FREE_IF_COPY(pgraster, 0);
3225  lwgeom_free(geom);
3226  elog(ERROR, "RASTER_clip: Could not reallocate memory for band arguments");
3227  PG_RETURN_NULL();
3228  }
3229 
3230  arg->numbands = j;
3231  }
3232 
3233  /* validate band */
3234  for (i = 0; i < arg->numbands; i++) {
3235  if (!rt_raster_has_band(arg->raster, arg->band[i].nband)) {
3236  elog(NOTICE, "Band at index %d not found in raster", arg->band[i].nband + 1);
3237  rtpg_clip_arg_destroy(arg);
3238  PG_FREE_IF_COPY(pgraster, 0);
3239  lwgeom_free(geom);
3240  PG_RETURN_NULL();
3241  }
3242 
3243  arg->band[i].hasnodata = 0;
3244  arg->band[i].nodataval = 0;
3245  }
3246  }
3247  else {
3249 
3250  /* raster may have no bands */
3251  if (arg->numbands) {
3252  arg->band = palloc(sizeof(struct rtpg_clip_band_t) * arg->numbands);
3253  if (arg->band == NULL) {
3254 
3255  rtpg_clip_arg_destroy(arg);
3256  PG_FREE_IF_COPY(pgraster, 0);
3257  lwgeom_free(geom);
3258 
3259  elog(ERROR, "RASTER_clip: Could not allocate memory for band arguments");
3260  PG_RETURN_NULL();
3261  }
3262 
3263  for (i = 0; i < arg->numbands; i++) {
3264  arg->band[i].nband = i;
3265  arg->band[i].hasnodata = 0;
3266  arg->band[i].nodataval = 0;
3267  }
3268  }
3269  }
3270 
3271  /* nodataval (3) */
3272  if (!PG_ARGISNULL(3)) {
3273  array = PG_GETARG_ARRAYTYPE_P(3);
3274  etype = ARR_ELEMTYPE(array);
3275  get_typlenbyvalalign(etype, &typlen, &typbyval, &typalign);
3276 
3277  switch (etype) {
3278  case FLOAT4OID:
3279  case FLOAT8OID:
3280  break;
3281  default:
3282  rtpg_clip_arg_destroy(arg);
3283  PG_FREE_IF_COPY(pgraster, 0);
3284  lwgeom_free(geom);
3285  elog(ERROR, "RASTER_clip: Invalid data type for NODATA values");
3286  PG_RETURN_NULL();
3287  break;
3288  }
3289 
3290  deconstruct_array(
3291  array, etype,
3292  typlen, typbyval, typalign,
3293  &e, &nulls, &k
3294  );
3295 
3296  /* it doesn't matter if there are more nodataval */
3297  for (i = 0, j = 0; i < arg->numbands; i++, j++) {
3298  /* cap j to the last nodataval element */
3299  if (j >= k)
3300  j = k - 1;
3301 
3302  if (nulls[j])
3303  continue;
3304 
3305  arg->band[i].hasnodata = 1;
3306  switch (etype) {
3307  case FLOAT4OID:
3308  arg->band[i].nodataval = DatumGetFloat4(e[j]);
3309  break;
3310  case FLOAT8OID:
3311  arg->band[i].nodataval = DatumGetFloat8(e[j]);
3312  break;
3313  }
3314  }
3315  }
3316 
3317  /* get wkb of geometry */
3318  POSTGIS_RT_DEBUG(3, "getting wkb of geometry");
3319  wkb = lwgeom_to_wkb(geom, WKB_SFSQL, &wkb_len);
3320  lwgeom_free(geom);
3321 
3322  /* rasterize geometry */
3324  wkb, wkb_len,
3325  NULL,
3326  0, NULL,
3327  NULL, NULL,
3328  NULL, NULL,
3329  NULL, NULL,
3330  &(gt[1]), &(gt[5]),
3331  NULL, NULL,
3332  &(gt[0]), &(gt[3]),
3333  &(gt[2]), &(gt[4]),
3334  NULL
3335  );
3336 
3337  pfree(wkb);
3338  if (arg->mask == NULL) {
3339  rtpg_clip_arg_destroy(arg);
3340  PG_FREE_IF_COPY(pgraster, 0);
3341  elog(ERROR, "RASTER_clip: Could not rasterize intersection geometry");
3342  PG_RETURN_NULL();
3343  }
3344 
3345  /* set SRID */
3346  rt_raster_set_srid(arg->mask, srid);
3347 
3348  /* run iterator */
3349 
3350  /* init itrset */
3351  itrset = palloc(sizeof(struct rt_iterator_t) * 2);
3352  if (itrset == NULL) {
3353  rtpg_clip_arg_destroy(arg);
3354  PG_FREE_IF_COPY(pgraster, 0);
3355  elog(ERROR, "RASTER_clip: Could not allocate memory for iterator arguments");
3356  PG_RETURN_NULL();
3357  }
3358 
3359  /* one band at a time */
3360  for (i = 0; i < arg->numbands; i++) {
3361  POSTGIS_RT_DEBUGF(4, "band arg %d (nband, hasnodata, nodataval) = (%d, %d, %f)",
3362  i, arg->band[i].nband, arg->band[i].hasnodata, arg->band[i].nodataval);
3363 
3364  band = rt_raster_get_band(arg->raster, arg->band[i].nband);
3365 
3366  /* band metadata */
3367  pixtype = rt_band_get_pixtype(band);
3368 
3369  if (arg->band[i].hasnodata) {
3370  hasnodata = 1;
3371  nodataval = arg->band[i].nodataval;
3372  }
3373  else if (rt_band_get_hasnodata_flag(band)) {
3374  hasnodata = 1;
3375  rt_band_get_nodata(band, &nodataval);
3376  }
3377  else {
3378  hasnodata = 0;
3379  nodataval = rt_band_get_min_value(band);
3380  }
3381 
3382  /* band is NODATA, create NODATA band and continue */
3383  if (rt_band_get_isnodata_flag(band)) {
3384  /* create raster */
3385  if (rtn == NULL) {
3386  noerr = rt_raster_from_two_rasters(arg->raster, arg->mask, arg->extenttype, &rtn, NULL);
3387  if (noerr != ES_NONE) {
3388  rtpg_clip_arg_destroy(arg);
3389  PG_FREE_IF_COPY(pgraster, 0);
3390  elog(ERROR, "RASTER_clip: Could not create output raster");
3391  PG_RETURN_NULL();
3392  }
3393  }
3394 
3395  /* create NODATA band */
3396  if (rt_raster_generate_new_band(rtn, pixtype, nodataval, hasnodata, nodataval, i) < 0) {
3397  rt_raster_destroy(rtn);
3398  rtpg_clip_arg_destroy(arg);
3399  PG_FREE_IF_COPY(pgraster, 0);
3400  elog(ERROR, "RASTER_clip: Could not add NODATA band to output raster");
3401  PG_RETURN_NULL();
3402  }
3403 
3404  continue;
3405  }
3406 
3407  /* raster */
3408  itrset[0].raster = arg->raster;
3409  itrset[0].nband = arg->band[i].nband;
3410  itrset[0].nbnodata = 1;
3411 
3412  /* mask */
3413  itrset[1].raster = arg->mask;
3414  itrset[1].nband = 0;
3415  itrset[1].nbnodata = 1;
3416 
3417  /* pass to iterator */
3418  noerr = rt_raster_iterator(
3419  itrset, 2,
3420  arg->extenttype, NULL,
3421  pixtype,
3422  hasnodata, nodataval,
3423  0, 0,
3424  NULL,
3425  NULL,
3427  &_raster
3428  );
3429 
3430  if (noerr != ES_NONE) {
3431  pfree(itrset);
3432  rtpg_clip_arg_destroy(arg);
3433  if (rtn != NULL) rt_raster_destroy(rtn);
3434  PG_FREE_IF_COPY(pgraster, 0);
3435  elog(ERROR, "RASTER_clip: Could not run raster iterator function");
3436  PG_RETURN_NULL();
3437  }
3438 
3439  /* new raster */
3440  if (rtn == NULL)
3441  rtn = _raster;
3442  /* copy band */
3443  else {
3444  band = rt_raster_get_band(_raster, 0);
3445  if (band == NULL) {
3446  pfree(itrset);
3447  rtpg_clip_arg_destroy(arg);
3448  rt_raster_destroy(_raster);
3449  rt_raster_destroy(rtn);
3450  PG_FREE_IF_COPY(pgraster, 0);
3451  elog(NOTICE, "RASTER_clip: Could not get band from working raster");
3452  PG_RETURN_NULL();
3453  }
3454 
3455  if (rt_raster_add_band(rtn, band, i) < 0) {
3456  pfree(itrset);
3457  rtpg_clip_arg_destroy(arg);
3458  rt_raster_destroy(_raster);
3459  rt_raster_destroy(rtn);
3460  PG_FREE_IF_COPY(pgraster, 0);
3461  elog(ERROR, "RASTER_clip: Could not add new band to output raster");
3462  PG_RETURN_NULL();
3463  }
3464 
3465  rt_raster_destroy(_raster);
3466  }
3467  }
3468 
3469  pfree(itrset);
3470  rtpg_clip_arg_destroy(arg);
3471  PG_FREE_IF_COPY(pgraster, 0);
3472 
3473  pgrtn = rt_raster_serialize(rtn);
3474  rt_raster_destroy(rtn);
3475 
3476  POSTGIS_RT_DEBUG(3, "Finished");
3477 
3478  if (!pgrtn)
3479  PG_RETURN_NULL();
3480 
3481  SET_VARSIZE(pgrtn, pgrtn->size);
3482  PG_RETURN_POINTER(pgrtn);
3483 }
int clamp_srid(int srid)
Return a valid SRID from an arbitrary integer Raises a notice if what comes out is different from wha...
Definition: lwutil.c:380
void * rt_raster_serialize(rt_raster raster)
Return this raster in serialized form.
Definition: rt_serialize.c:521
int rt_raster_get_num_bands(rt_raster raster)
Definition: rt_raster.c:372
static void rtpg_clip_arg_destroy(rtpg_clip_arg arg)
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
void rt_raster_get_geotransform_matrix(rt_raster raster, double *gt)
Get 6-element array of raster geotransform matrix.
Definition: rt_raster.c:706
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1099
band
Definition: ovdump.py:57
rt_errorstate rt_raster_from_two_rasters(rt_raster rast1, rt_raster rast2, rt_extenttype extenttype, rt_raster *rtnraster, double *offset)
Definition: rt_raster.c:3444
rt_raster rt_raster_gdal_rasterize(const unsigned char *wkb, uint32_t wkb_len, const char *srs, uint32_t num_bands, rt_pixtype *pixtype, double *init, double *value, double *nodata, uint8_t *hasnodata, int *width, int *height, double *scale_x, double *scale_y, double *ul_xw, double *ul_yw, double *grid_xw, double *grid_yw, double *skew_x, double *skew_y, char **options)
Return a raster of the provided geometry.
Definition: rt_raster.c:2492
gt
Definition: window.py:77
rt_pixtype
Definition: librtcore.h:185
static int rtpg_clip_callback(rt_iterator_arg arg, void *userarg, double *value, int *nodata)
int lwgeom_ndims(const LWGEOM *geom)
Return the number of dimensions (2, 3, 4) in a geometry.
Definition: lwgeom.c:899
#define WKB_SFSQL
Definition: liblwgeom.h:2075
int rt_raster_is_empty(rt_raster raster)
Return TRUE if the raster is empty.
Definition: rt_raster.c:1338
#define POSTGIS_RT_DEBUGF(level, msg,...)
Definition: rtpostgis.h:65
rt_errorstate rt_band_get_nodata(rt_band band, double *nodata)
Get NODATA value.
Definition: rt_band.c:1597
rt_errorstate rt_raster_get_convex_hull(rt_raster raster, LWGEOM **hull)
Get raster&#39;s convex hull.
Definition: rt_geometry.c:803
rt_extenttype extenttype
uint8_t * lwgeom_to_wkb(const LWGEOM *geom, uint8_t variant, size_t *size_out)
Convert LWGEOM to a char* in WKB format.
Definition: lwout_wkb.c:764
int rt_raster_generate_new_band(rt_raster raster, rt_pixtype pixtype, double initialvalue, uint32_t hasnodata, double nodatavalue, int index)
Generate a new inline band and add it to a raster.
Definition: rt_raster.c:485
#define SRID_UNKNOWN
Unknown SRID value.
Definition: liblwgeom.h:188
LWGEOM * lwgeom_intersection(const LWGEOM *geom1, const LWGEOM *geom2)
LWGEOM * lwgeom_force_2d(const LWGEOM *geom)
Strip out the Z/M components of an LWGEOM.
Definition: lwgeom.c:739
rt_band rt_raster_get_band(rt_raster raster, int bandNum)
Return Nth band, or NULL if unavailable.
Definition: rt_raster.c:381
int rt_band_get_hasnodata_flag(rt_band band)
Get hasnodata flag value.
Definition: rt_band.c:541
int rt_raster_has_band(rt_raster raster, int nband)
Return TRUE if the raster has a band of this number.
Definition: rt_raster.c:1351
void rt_raster_set_srid(rt_raster raster, int32_t srid)
Set raster&#39;s SRID.
Definition: rt_raster.c:363
int32_t rt_raster_get_srid(rt_raster raster)
Get raster&#39;s SRID.
Definition: rt_raster.c:356
void rt_raster_destroy(rt_raster raster)
Release memory associated to a raster.
Definition: rt_raster.c:82
rt_raster raster
Definition: librtcore.h:2394
rt_raster rt_raster_new(uint32_t width, uint32_t height)
Construct a raster with given dimensions.
Definition: rt_raster.c:48
uint16_t nband
Definition: librtcore.h:2395
rtpg_clip_band band
#define FALSE
Definition: dbfopen.c:168
uint8_t nbnodata
Definition: librtcore.h:2396
Struct definitions.
Definition: librtcore.h:2201
double rt_band_get_min_value(rt_band band)
Returns the minimal possible value for the band according to the pixel type.
Definition: rt_band.c:1612
rt_errorstate rt_raster_iterator(rt_iterator itrset, uint16_t itrcount, rt_extenttype extenttype, rt_raster customextent, rt_pixtype pixtype, uint8_t hasnodata, double nodataval, uint16_t distancex, uint16_t distancey, rt_mask mask, void *userarg, int(*callback)(rt_iterator_arg arg, void *userarg, double *value, int *nodata), rt_raster *rtnraster)
n-raster iterator.
static rtpg_clip_arg rtpg_clip_arg_init()
rt_pixtype rt_band_get_pixtype(rt_band band)
Return pixeltype of this band.
Definition: rt_band.c:498
int rt_raster_add_band(rt_raster raster, rt_band band, int index)
Add band data to a raster.
Definition: rt_raster.c:405
int rt_band_get_isnodata_flag(rt_band band)
Get isnodata flag value.
Definition: rt_band.c:581
#define POSTGIS_RT_DEBUG(level, msg)
Definition: rtpostgis.h:61
int lwgeom_is_empty(const LWGEOM *geom)
Return true or false depending on whether a geometry is an "empty" geometry (no vertices members) ...
Definition: lwgeom.c:1346
rt_raster rt_raster_deserialize(void *serialized, int header_only)
Return a raster from a serialized form.
Definition: rt_serialize.c:717
int32_t gserialized_get_srid(const GSERIALIZED *s)
Extract the SRID from the serialized form (it is packed into three bytes so this is a handy function)...
Definition: g_serialized.c:100
Here is the call graph for this function:
Here is the caller graph for this function: