PostGIS 3.7.0dev-r@@SVN_REVISION@@
Loading...
Searching...
No Matches

◆ RASTER_reclass()

Datum RASTER_reclass ( PG_FUNCTION_ARGS  )

Definition at line 3466 of file rtpg_mapalgebra.c.

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

References 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, POSTGIS_RT_DEBUG, POSTGIS_RT_DEBUGF, PT_END, 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.

Here is the call graph for this function: