PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ RASTER_reclass()

Datum RASTER_reclass ( PG_FUNCTION_ARGS  )

Definition at line 3489 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, rt_raster_serialized_t::numBands, 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.

Referenced by RASTER_clip().

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