Postgis ST_ColorMap with mode "NEAREST" does not return a raster

42 Views Asked by At

I have a color map as shown here:

 color_map := '0 0 0 0 0
    1 0 0 0 0
    10 128 0 230 255
    11 56 0 100 255
    12 0 0 0 255';

return ST_AsPNG(ST_ColorMap(raster_input, 1, color_map, 'EXACT'));

This works with the mode of 'EXACT' and returns the expected image. Now I might have additional values such as 13, 14 etc. in my raster. That is why I tried using NEAREST as mode for ST_ColorMap. Unfortunately that resulted in the PNG being always empty. So even the exactly matching values from before do no longer work.

Am I misunderstanding how the NEAREST mode is supposed to work, or is there an issue with my color map?

0

There are 0 best solutions below