[postgis-tickets] [PostGIS] #2474: [raster]: ST_Union that takes 2 rasters
PostGIS
trac at osgeo.org
Sat Sep 7 22:49:59 PDT 2013
#2474: [raster]: ST_Union that takes 2 rasters
-------------------------+--------------------------------------------------
Reporter: robe | Owner: dustymugs
Type: enhancement | Status: new
Priority: medium | Milestone: PostGIS 2.2.0
Component: raster | Version: trunk
Keywords: |
-------------------------+--------------------------------------------------
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')
}}}
--
Ticket URL: <http://trac.osgeo.org/postgis/ticket/2474>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.
More information about the postgis-tickets
mailing list