PostGIS  2.3.7dev-r@@SVN_REVISION@@
Datum RASTER_reclass ( PG_FUNCTION_ARGS  )

Definition at line 3439 of file rtpg_mapalgebra.c.

References ovdump::band, rt_reclassexpr_t::dst, rt_reclassexpr_t::rt_reclassrange::exc_max, rt_reclassexpr_t::rt_reclassrange::exc_min, FALSE, rt_reclassexpr_t::rt_reclassrange::inc_max, rt_reclassexpr_t::rt_reclassrange::inc_min, rt_reclassexpr_t::rt_reclassrange::max, rt_reclassexpr_t::rt_reclassrange::min, pixval::nband, POSTGIS_RT_DEBUG, POSTGIS_RT_DEBUGF, PT_END, rtrowdump::raster, rt_band_destroy(), rt_band_reclass(), rt_pixtype_index_from_name(), rt_raster_deserialize(), rt_raster_destroy(), rt_raster_get_band(), rt_raster_get_num_bands(), rt_raster_replace_band(), rt_raster_serialize(), rtpg_chartrim(), rtpg_removespaces(), rtpg_strrstr(), rtpg_strsplit(), rt_raster_serialized_t::size, rt_reclassexpr_t::src, and TRUE.

3439  {
3440  rt_pgraster *pgraster = NULL;
3441  rt_pgraster *pgrtn = NULL;
3442  rt_raster raster = NULL;
3443  rt_band band = NULL;
3444  rt_band newband = NULL;
3445  uint32_t numBands = 0;
3446 
3447  ArrayType *array;
3448  Oid etype;
3449  Datum *e;
3450  bool *nulls;
3451  int16 typlen;
3452  bool typbyval;
3453  char typalign;
3454  int n = 0;
3455 
3456  int i = 0;
3457  int j = 0;
3458  int k = 0;
3459 
3460  int a = 0;
3461  int b = 0;
3462  int c = 0;
3463 
3464  rt_reclassexpr *exprset = NULL;
3465  HeapTupleHeader tup;
3466  bool isnull;
3467  Datum tupv;
3468  uint32_t nband = 0;
3469  char *expr = NULL;
3470  text *exprtext = NULL;
3471  double val = 0;
3472  char *junk = NULL;
3473  int inc_val = 0;
3474  int exc_val = 0;
3475  char *pixeltype = NULL;
3476  text *pixeltypetext = NULL;
3477  rt_pixtype pixtype = PT_END;
3478  double nodataval = 0;
3479  bool hasnodata = FALSE;
3480 
3481  char **comma_set = NULL;
3482  int comma_n = 0;
3483  char **colon_set = NULL;
3484  int colon_n = 0;
3485  char **dash_set = NULL;
3486  int dash_n = 0;
3487 
3488  POSTGIS_RT_DEBUG(3, "RASTER_reclass: Starting");
3489 
3490  /* pgraster is null, return null */
3491  if (PG_ARGISNULL(0))
3492  PG_RETURN_NULL();
3493  pgraster = (rt_pgraster *) PG_DETOAST_DATUM(PG_GETARG_DATUM(0));
3494 
3495  /* raster */
3496  raster = rt_raster_deserialize(pgraster, FALSE);
3497  if (!raster) {
3498  PG_FREE_IF_COPY(pgraster, 0);
3499  elog(ERROR, "RASTER_reclass: Could not deserialize raster");
3500  PG_RETURN_NULL();
3501  }
3502  numBands = rt_raster_get_num_bands(raster);
3503  POSTGIS_RT_DEBUGF(3, "RASTER_reclass: %d possible bands to be reclassified", numBands);
3504 
3505  /* process set of reclassarg */
3506  POSTGIS_RT_DEBUG(3, "RASTER_reclass: Processing Arg 1 (reclassargset)");
3507  array = PG_GETARG_ARRAYTYPE_P(1);
3508  etype = ARR_ELEMTYPE(array);
3509  get_typlenbyvalalign(etype, &typlen, &typbyval, &typalign);
3510 
3511  deconstruct_array(array, etype, typlen, typbyval, typalign, &e,
3512  &nulls, &n);
3513 
3514  if (!n) {
3515  elog(NOTICE, "Invalid argument for reclassargset. Returning original raster");
3516 
3517  pgrtn = rt_raster_serialize(raster);
3518  rt_raster_destroy(raster);
3519  PG_FREE_IF_COPY(pgraster, 0);
3520  if (!pgrtn)
3521  PG_RETURN_NULL();
3522 
3523  SET_VARSIZE(pgrtn, pgrtn->size);
3524  PG_RETURN_POINTER(pgrtn);
3525  }
3526 
3527  /*
3528  process each element of reclassarg
3529  each element is the index of the band to process, the set
3530  of reclass ranges and the output band's pixeltype
3531  */
3532  for (i = 0; i < n; i++) {
3533  if (nulls[i]) continue;
3534 
3535  /* each element is a tuple */
3536  tup = (HeapTupleHeader) DatumGetPointer(e[i]);
3537  if (NULL == tup) {
3538  elog(NOTICE, "Invalid argument for reclassargset. Returning original raster");
3539 
3540  pgrtn = rt_raster_serialize(raster);
3541  rt_raster_destroy(raster);
3542  PG_FREE_IF_COPY(pgraster, 0);
3543  if (!pgrtn)
3544  PG_RETURN_NULL();
3545 
3546  SET_VARSIZE(pgrtn, pgrtn->size);
3547  PG_RETURN_POINTER(pgrtn);
3548  }
3549 
3550  /* band index (1-based) */
3551  tupv = GetAttributeByName(tup, "nband", &isnull);
3552  if (isnull) {
3553  elog(NOTICE, "Invalid argument for reclassargset. Missing value of nband for reclassarg of index %d . Returning original raster", i);
3554 
3555  pgrtn = rt_raster_serialize(raster);
3556  rt_raster_destroy(raster);
3557  PG_FREE_IF_COPY(pgraster, 0);
3558  if (!pgrtn)
3559  PG_RETURN_NULL();
3560 
3561  SET_VARSIZE(pgrtn, pgrtn->size);
3562  PG_RETURN_POINTER(pgrtn);
3563  }
3564  nband = DatumGetInt32(tupv);
3565  POSTGIS_RT_DEBUGF(3, "RASTER_reclass: expression for band %d", nband);
3566 
3567  /* valid band index? */
3568  if (nband < 1 || nband > numBands) {
3569  elog(NOTICE, "Invalid argument for reclassargset. Invalid band index (must use 1-based) for reclassarg of index %d . Returning original raster", i);
3570 
3571  pgrtn = rt_raster_serialize(raster);
3572  rt_raster_destroy(raster);
3573  PG_FREE_IF_COPY(pgraster, 0);
3574  if (!pgrtn)
3575  PG_RETURN_NULL();
3576 
3577  SET_VARSIZE(pgrtn, pgrtn->size);
3578  PG_RETURN_POINTER(pgrtn);
3579  }
3580 
3581  /* reclass expr */
3582  tupv = GetAttributeByName(tup, "reclassexpr", &isnull);
3583  if (isnull) {
3584  elog(NOTICE, "Invalid argument for reclassargset. Missing value of reclassexpr for reclassarg of index %d . Returning original raster", i);
3585 
3586  pgrtn = rt_raster_serialize(raster);
3587  rt_raster_destroy(raster);
3588  PG_FREE_IF_COPY(pgraster, 0);
3589  if (!pgrtn)
3590  PG_RETURN_NULL();
3591 
3592  SET_VARSIZE(pgrtn, pgrtn->size);
3593  PG_RETURN_POINTER(pgrtn);
3594  }
3595  exprtext = (text *) DatumGetPointer(tupv);
3596  if (NULL == exprtext) {
3597  elog(NOTICE, "Invalid argument for reclassargset. Missing value of reclassexpr for reclassarg of index %d . Returning original raster", i);
3598 
3599  pgrtn = rt_raster_serialize(raster);
3600  rt_raster_destroy(raster);
3601  PG_FREE_IF_COPY(pgraster, 0);
3602  if (!pgrtn)
3603  PG_RETURN_NULL();
3604 
3605  SET_VARSIZE(pgrtn, pgrtn->size);
3606  PG_RETURN_POINTER(pgrtn);
3607  }
3608  expr = text_to_cstring(exprtext);
3609  POSTGIS_RT_DEBUGF(4, "RASTER_reclass: expr (raw) %s", expr);
3610  expr = rtpg_removespaces(expr);
3611  POSTGIS_RT_DEBUGF(4, "RASTER_reclass: expr (clean) %s", expr);
3612 
3613  /* split string to its components */
3614  /* comma (,) separating rangesets */
3615  comma_set = rtpg_strsplit(expr, ",", &comma_n);
3616  if (comma_n < 1) {
3617  elog(NOTICE, "Invalid argument for reclassargset. Invalid expression of reclassexpr for reclassarg of index %d . Returning original raster", i);
3618 
3619  pgrtn = rt_raster_serialize(raster);
3620  rt_raster_destroy(raster);
3621  PG_FREE_IF_COPY(pgraster, 0);
3622  if (!pgrtn)
3623  PG_RETURN_NULL();
3624 
3625  SET_VARSIZE(pgrtn, pgrtn->size);
3626  PG_RETURN_POINTER(pgrtn);
3627  }
3628 
3629  /* set of reclass expressions */
3630  POSTGIS_RT_DEBUGF(4, "RASTER_reclass: %d possible expressions", comma_n);
3631  exprset = palloc(comma_n * sizeof(rt_reclassexpr));
3632 
3633  for (a = 0, j = 0; a < comma_n; a++) {
3634  POSTGIS_RT_DEBUGF(4, "RASTER_reclass: map %s", comma_set[a]);
3635 
3636  /* colon (:) separating range "src" and "dst" */
3637  colon_set = rtpg_strsplit(comma_set[a], ":", &colon_n);
3638  if (colon_n != 2) {
3639  elog(NOTICE, "Invalid argument for reclassargset. Invalid expression of reclassexpr for reclassarg of index %d . Returning original raster", i);
3640  for (k = 0; k < j; k++) pfree(exprset[k]);
3641  pfree(exprset);
3642 
3643  pgrtn = rt_raster_serialize(raster);
3644  rt_raster_destroy(raster);
3645  PG_FREE_IF_COPY(pgraster, 0);
3646  if (!pgrtn)
3647  PG_RETURN_NULL();
3648 
3649  SET_VARSIZE(pgrtn, pgrtn->size);
3650  PG_RETURN_POINTER(pgrtn);
3651  }
3652 
3653  /* allocate mem for reclass expression */
3654  exprset[j] = palloc(sizeof(struct rt_reclassexpr_t));
3655 
3656  for (b = 0; b < colon_n; b++) {
3657  POSTGIS_RT_DEBUGF(4, "RASTER_reclass: range %s", colon_set[b]);
3658 
3659  /* dash (-) separating "min" and "max" */
3660  dash_set = rtpg_strsplit(colon_set[b], "-", &dash_n);
3661  if (dash_n < 1 || dash_n > 3) {
3662  elog(NOTICE, "Invalid argument for reclassargset. Invalid expression of reclassexpr for reclassarg of index %d . Returning original raster", i);
3663  for (k = 0; k < j; k++) pfree(exprset[k]);
3664  pfree(exprset);
3665 
3666  pgrtn = rt_raster_serialize(raster);
3667  rt_raster_destroy(raster);
3668  PG_FREE_IF_COPY(pgraster, 0);
3669  if (!pgrtn)
3670  PG_RETURN_NULL();
3671 
3672  SET_VARSIZE(pgrtn, pgrtn->size);
3673  PG_RETURN_POINTER(pgrtn);
3674  }
3675 
3676  for (c = 0; c < dash_n; c++) {
3677  /* need to handle: (-9999-100 -> "(", "9999", "100" */
3678  if (
3679  c < 1 &&
3680  strlen(dash_set[c]) == 1 && (
3681  strchr(dash_set[c], '(') != NULL ||
3682  strchr(dash_set[c], '[') != NULL ||
3683  strchr(dash_set[c], ')') != NULL ||
3684  strchr(dash_set[c], ']') != NULL
3685  )
3686  ) {
3687  junk = palloc(sizeof(char) * (strlen(dash_set[c + 1]) + 2));
3688  if (NULL == junk) {
3689  for (k = 0; k <= j; k++) pfree(exprset[k]);
3690  pfree(exprset);
3691  rt_raster_destroy(raster);
3692  PG_FREE_IF_COPY(pgraster, 0);
3693 
3694  elog(ERROR, "RASTER_reclass: Could not allocate memory");
3695  PG_RETURN_NULL();
3696  }
3697 
3698  sprintf(junk, "%s%s", dash_set[c], dash_set[c + 1]);
3699  c++;
3700  dash_set[c] = repalloc(dash_set[c], sizeof(char) * (strlen(junk) + 1));
3701  strcpy(dash_set[c], junk);
3702  pfree(junk);
3703 
3704  /* rebuild dash_set */
3705  for (k = 1; k < dash_n; k++) {
3706  dash_set[k - 1] = repalloc(dash_set[k - 1], (strlen(dash_set[k]) + 1) * sizeof(char));
3707  strcpy(dash_set[k - 1], dash_set[k]);
3708  }
3709  dash_n--;
3710  c--;
3711  pfree(dash_set[dash_n]);
3712  dash_set = repalloc(dash_set, sizeof(char *) * dash_n);
3713  }
3714 
3715  /* there shouldn't be more than two in dash_n */
3716  if (c < 1 && dash_n > 2) {
3717  elog(NOTICE, "Invalid argument for reclassargset. Invalid expression of reclassexpr for reclassarg of index %d . Returning original raster", i);
3718  for (k = 0; k < j; k++) pfree(exprset[k]);
3719  pfree(exprset);
3720 
3721  pgrtn = rt_raster_serialize(raster);
3722  rt_raster_destroy(raster);
3723  PG_FREE_IF_COPY(pgraster, 0);
3724  if (!pgrtn)
3725  PG_RETURN_NULL();
3726 
3727  SET_VARSIZE(pgrtn, pgrtn->size);
3728  PG_RETURN_POINTER(pgrtn);
3729  }
3730 
3731  /* check interval flags */
3732  exc_val = 0;
3733  inc_val = 1;
3734  /* range */
3735  if (dash_n != 1) {
3736  /* min */
3737  if (c < 1) {
3738  if (
3739  strchr(dash_set[c], ')') != NULL ||
3740  strchr(dash_set[c], ']') != NULL
3741  ) {
3742  exc_val = 1;
3743  inc_val = 1;
3744  }
3745  else if (strchr(dash_set[c], '(') != NULL){
3746  inc_val = 0;
3747  }
3748  else {
3749  inc_val = 1;
3750  }
3751  }
3752  /* max */
3753  else {
3754  if (
3755  strrchr(dash_set[c], '(') != NULL ||
3756  strrchr(dash_set[c], '[') != NULL
3757  ) {
3758  exc_val = 1;
3759  inc_val = 0;
3760  }
3761  else if (strrchr(dash_set[c], ']') != NULL) {
3762  inc_val = 1;
3763  }
3764  else {
3765  inc_val = 0;
3766  }
3767  }
3768  }
3769  POSTGIS_RT_DEBUGF(4, "RASTER_reclass: exc_val %d inc_val %d", exc_val, inc_val);
3770 
3771  /* remove interval flags */
3772  dash_set[c] = rtpg_chartrim(dash_set[c], "()[]");
3773  POSTGIS_RT_DEBUGF(4, "RASTER_reclass: min/max (char) %s", dash_set[c]);
3774 
3775  /* value from string to double */
3776  errno = 0;
3777  val = strtod(dash_set[c], &junk);
3778  if (errno != 0 || dash_set[c] == junk) {
3779  elog(NOTICE, "Invalid argument for reclassargset. Invalid expression of reclassexpr for reclassarg of index %d . Returning original raster", i);
3780  for (k = 0; k < j; k++) pfree(exprset[k]);
3781  pfree(exprset);
3782 
3783  pgrtn = rt_raster_serialize(raster);
3784  rt_raster_destroy(raster);
3785  PG_FREE_IF_COPY(pgraster, 0);
3786  if (!pgrtn)
3787  PG_RETURN_NULL();
3788 
3789  SET_VARSIZE(pgrtn, pgrtn->size);
3790  PG_RETURN_POINTER(pgrtn);
3791  }
3792  POSTGIS_RT_DEBUGF(4, "RASTER_reclass: min/max (double) %f", val);
3793 
3794  /* strsplit removes dash (a.k.a. negative sign), compare now to restore */
3795  if (c < 1)
3796  junk = strstr(colon_set[b], dash_set[c]);
3797  else
3798  junk = rtpg_strrstr(colon_set[b], dash_set[c]);
3800  4,
3801  "(colon_set[%d], dash_set[%d], junk) = (%s, %s, %s)",
3802  b, c, colon_set[b], dash_set[c], junk
3803  );
3804  /* not beginning of string */
3805  if (junk != colon_set[b]) {
3806  /* prior is a dash */
3807  if (*(junk - 1) == '-') {
3808  /* prior is beginning of string or prior - 1 char is dash, negative number */
3809  if (
3810  ((junk - 1) == colon_set[b]) ||
3811  (*(junk - 2) == '-') ||
3812  (*(junk - 2) == '[') ||
3813  (*(junk - 2) == '(')
3814  ) {
3815  val *= -1.;
3816  }
3817  }
3818  }
3819  POSTGIS_RT_DEBUGF(4, "RASTER_reclass: min/max (double) %f", val);
3820 
3821  /* src */
3822  if (b < 1) {
3823  /* singular value */
3824  if (dash_n == 1) {
3825  exprset[j]->src.exc_min = exprset[j]->src.exc_max = exc_val;
3826  exprset[j]->src.inc_min = exprset[j]->src.inc_max = inc_val;
3827  exprset[j]->src.min = exprset[j]->src.max = val;
3828  }
3829  /* min */
3830  else if (c < 1) {
3831  exprset[j]->src.exc_min = exc_val;
3832  exprset[j]->src.inc_min = inc_val;
3833  exprset[j]->src.min = val;
3834  }
3835  /* max */
3836  else {
3837  exprset[j]->src.exc_max = exc_val;
3838  exprset[j]->src.inc_max = inc_val;
3839  exprset[j]->src.max = val;
3840  }
3841  }
3842  /* dst */
3843  else {
3844  /* singular value */
3845  if (dash_n == 1)
3846  exprset[j]->dst.min = exprset[j]->dst.max = val;
3847  /* min */
3848  else if (c < 1)
3849  exprset[j]->dst.min = val;
3850  /* max */
3851  else
3852  exprset[j]->dst.max = val;
3853  }
3854  }
3855  pfree(dash_set);
3856  }
3857  pfree(colon_set);
3858 
3859  POSTGIS_RT_DEBUGF(3, "RASTER_reclass: or: %f - %f nr: %f - %f"
3860  , exprset[j]->src.min
3861  , exprset[j]->src.max
3862  , exprset[j]->dst.min
3863  , exprset[j]->dst.max
3864  );
3865  j++;
3866  }
3867  pfree(comma_set);
3868 
3869  /* pixel type */
3870  tupv = GetAttributeByName(tup, "pixeltype", &isnull);
3871  if (isnull) {
3872  elog(NOTICE, "Invalid argument for reclassargset. Missing value of pixeltype for reclassarg of index %d . Returning original raster", i);
3873 
3874  pgrtn = rt_raster_serialize(raster);
3875  rt_raster_destroy(raster);
3876  PG_FREE_IF_COPY(pgraster, 0);
3877  if (!pgrtn)
3878  PG_RETURN_NULL();
3879 
3880  SET_VARSIZE(pgrtn, pgrtn->size);
3881  PG_RETURN_POINTER(pgrtn);
3882  }
3883  pixeltypetext = (text *) DatumGetPointer(tupv);
3884  if (NULL == pixeltypetext) {
3885  elog(NOTICE, "Invalid argument for reclassargset. Missing value of pixeltype for reclassarg of index %d . Returning original raster", i);
3886 
3887  pgrtn = rt_raster_serialize(raster);
3888  rt_raster_destroy(raster);
3889  PG_FREE_IF_COPY(pgraster, 0);
3890  if (!pgrtn)
3891  PG_RETURN_NULL();
3892 
3893  SET_VARSIZE(pgrtn, pgrtn->size);
3894  PG_RETURN_POINTER(pgrtn);
3895  }
3896  pixeltype = text_to_cstring(pixeltypetext);
3897  POSTGIS_RT_DEBUGF(3, "RASTER_reclass: pixeltype %s", pixeltype);
3898  pixtype = rt_pixtype_index_from_name(pixeltype);
3899 
3900  /* nodata */
3901  tupv = GetAttributeByName(tup, "nodataval", &isnull);
3902  if (isnull) {
3903  nodataval = 0;
3904  hasnodata = FALSE;
3905  }
3906  else {
3907  nodataval = DatumGetFloat8(tupv);
3908  hasnodata = TRUE;
3909  }
3910  POSTGIS_RT_DEBUGF(3, "RASTER_reclass: nodataval %f", nodataval);
3911  POSTGIS_RT_DEBUGF(3, "RASTER_reclass: hasnodata %d", hasnodata);
3912 
3913  /* do reclass */
3914  band = rt_raster_get_band(raster, nband - 1);
3915  if (!band) {
3916  elog(NOTICE, "Could not find raster band of index %d. Returning original raster", nband);
3917  for (k = 0; k < j; k++) pfree(exprset[k]);
3918  pfree(exprset);
3919 
3920  pgrtn = rt_raster_serialize(raster);
3921  rt_raster_destroy(raster);
3922  PG_FREE_IF_COPY(pgraster, 0);
3923  if (!pgrtn)
3924  PG_RETURN_NULL();
3925 
3926  SET_VARSIZE(pgrtn, pgrtn->size);
3927  PG_RETURN_POINTER(pgrtn);
3928  }
3929  newband = rt_band_reclass(band, pixtype, hasnodata, nodataval, exprset, j);
3930  if (!newband) {
3931  for (k = 0; k < j; k++) pfree(exprset[k]);
3932  pfree(exprset);
3933 
3934  rt_raster_destroy(raster);
3935  PG_FREE_IF_COPY(pgraster, 0);
3936 
3937  elog(ERROR, "RASTER_reclass: Could not reclassify raster band of index %d", nband);
3938  PG_RETURN_NULL();
3939  }
3940 
3941  /* replace old band with new band */
3942  if (rt_raster_replace_band(raster, newband, nband - 1) == NULL) {
3943  for (k = 0; k < j; k++) pfree(exprset[k]);
3944  pfree(exprset);
3945 
3946  rt_band_destroy(newband);
3947  rt_raster_destroy(raster);
3948  PG_FREE_IF_COPY(pgraster, 0);
3949 
3950  elog(ERROR, "RASTER_reclass: Could not replace raster band of index %d with reclassified band", nband);
3951  PG_RETURN_NULL();
3952  }
3953 
3954  /* old band is in the variable band */
3955  rt_band_destroy(band);
3956 
3957  /* free exprset */
3958  for (k = 0; k < j; k++) pfree(exprset[k]);
3959  pfree(exprset);
3960  }
3961 
3962  pgrtn = rt_raster_serialize(raster);
3963  rt_raster_destroy(raster);
3964  PG_FREE_IF_COPY(pgraster, 0);
3965  if (!pgrtn)
3966  PG_RETURN_NULL();
3967 
3968  POSTGIS_RT_DEBUG(3, "RASTER_reclass: Finished");
3969 
3970  SET_VARSIZE(pgrtn, pgrtn->size);
3971  PG_RETURN_POINTER(pgrtn);
3972 }
char ** rtpg_strsplit(const char *str, const char *delimiter, int *n)
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
struct rt_reclassexpr_t::rt_reclassrange dst
tuple band
Definition: ovdump.py:57
tuple raster
Be careful!! Zeros function's input parameter can be a (height x width) array, not (width x height): ...
Definition: rtrowdump.py:121
rt_pixtype
Definition: librtcore.h:197
void rt_band_destroy(rt_band band)
Destroy a raster band.
Definition: rt_band.c:242
#define POSTGIS_RT_DEBUGF(level, msg,...)
Definition: rtpostgis.h:57
struct rt_reclassexpr_t::rt_reclassrange src
tuple nband
Definition: pixval.py:52
rt_pixtype rt_pixtype_index_from_name(const char *pixname)
Definition: rt_pixel.c:80
rt_band rt_raster_get_band(rt_raster raster, int bandNum)
Return Nth band, or NULL if unavailable.
Definition: rt_raster.c:381
void rt_raster_destroy(rt_raster raster)
Release memory associated to a raster.
Definition: rt_raster.c:82
rt_band rt_raster_replace_band(rt_raster raster, rt_band band, int index)
Replace band at provided index with new band.
Definition: rt_raster.c:1502
char * rtpg_chartrim(const char *input, char *remove)
#define FALSE
Definition: dbfopen.c:168
char * rtpg_removespaces(char *str)
Struct definitions.
Definition: librtcore.h:2213
rt_band rt_band_reclass(rt_band srcband, rt_pixtype pixtype, uint32_t hasnodata, double nodataval, rt_reclassexpr *exprset, int exprcount)
Returns new band with values reclassified.
Definition: rt_mapalgebra.c:50
#define POSTGIS_RT_DEBUG(level, msg)
Definition: rtpostgis.h:53
char * rtpg_strrstr(const char *s1, const char *s2)
#define TRUE
Definition: dbfopen.c:169
rt_raster rt_raster_deserialize(void *serialized, int header_only)
Return a raster from a serialized form.
Definition: rt_serialize.c:717

Here is the call graph for this function: