I am trying to run ST_RECLASS on a raster to retain certain pixel values while setting others to NoData(0). I have a function that creates a lookup table and then I embed the lookup table within the UPDATE query using ST_RECLASS to try to reassign the output pixel valuese.
The raster, before relcass attempt, has these values: (BEC_ZONE_CLIP_RASTER_RASTER)
My lookup table contains the following values: (ZZ_TMP_LOOKUP)
When I execute the following line of code:
UPDATE BEC_ZONE_CLIP_RASTER_RASTER SET rast = ST_Reclass(rast, ROW(1, (SELECT string_agg(concat('[', val, ']:', out_val), ',') FROM zz_tmp_lookup), '4BUI', 0)::reclassarg);
I end up with the pixels that represent 17 and 21 values reclassed, but they are set to value 15. Can somebody help me to understand why this is happening?