I'd like to check some basic statistic of a raster in my database. How can I determine the smallest raster value found in all raster tiles (enroaching all srid's)? My code looks like:

SELECT min(ST_Value(rast)) as min, max(ST_Value(rast)) as max FROM <rastername>

Throws out: function st_value(raster) does not exist.


I figured it out on my own, here we go:

SELECT min((stats).min)
    FROM (SELECT ST_SummaryStats(rast, TRUE) 
       AS stats FROM <rastername>) foo;
| 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.