3

I have raster data stored in a PostgreSQL/PostGIS database. I need to create a summed raster from certain rasters.

Something like:

select sum(raw_data) as image from data where rid > 2 AND rid < 5; 

But this is not the correct function. What is?

0

1 Answer 1

6

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.

1
  • Good to know. There was me thinking you needed MapAlgebra, hugely overcomplicating things as always. Mar 9, 2016 at 8:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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