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

Definition at line 3436 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.

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