I have raster data stored in a PostgreSQL/PostGIS database. I need to create a summed raster from certain rasters.
select sum(raw_data) as image from data where rid > 2 AND rid < 5;
But this is not the correct function. What is?
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It only takes a minute to sign up.Sign up to join this community
Use ST_Union(rast, 'SUM')
Overlapping pixels will be summed into a new raster. Note there are also FIRST, MIN, MAX, COUNT, MEAN, RANGE options for the uniontype paramter.