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

◆ RASTER_reclass()

Datum RASTER_reclass ( PG_FUNCTION_ARGS  )

Definition at line 3500 of file rtpg_mapalgebra.c.

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

Here is the call graph for this function: