id summary reporter owner description type status priority milestone component version resolution keywords cc 2474 [raster]: ST_Union that takes 2 rasters robe Bborie Park "I'm finding myself constantly needing to do a union of just two rasters. So I often end up doing ugly things like {{{ SELECT ST_Union(f.rast) FROM (SELECT rast FROM table1 INNER JOIN table2 ON ST_Intersects(table1.rast,1,table2.geom) WHERE table2.gid =1 UNION ALL SELECT ST_AsRaster(somegeom, rast,100) FROM ST_Intersects(table1.rast,1,table2.geom) WHERE table2.gid = 1) As f }}} When all I want to do is this {{{ SELECT ST_Union(rast, ST_AsRaster(somegeom,rast) ) FROM table1 INNER JOIN table2 ON ST_Intersects(rast,1, table2.geom) WHERE table2.gid = 1 }}} In theory I could use MapAlgebra but MapAlgebra blows my mind with all the permutations of it. Note geometry has an ST_Union(geom1,geom2) so it would be in line with what we do with geometry already except we'd have an optional expression type So I'm think the proto would look like {{{ ST_Union(rast1,rast2, expressiontype = 'LAST') }}} " enhancement new medium PostGIS Fund Me raster master