I have a tiled raster in a PostGIS table and I would like to change the value of all pixels which have values less than 0 to -9999. How should I do this?

I suspect it involves ST_SetValue and possibly a SQL sub-statement, but I'm not sure how to put these together.


Comprehensive raster functionality is apparently rather new to PostGIS, but the official reference should be helpful:


I think this is the desired function, with examples:


And for constructing the reclassarg, the docs are a little hazier:


I think it should be something along the lines of:


| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.