[postgis-devel] [PostGIS] #2078: [raster] add extent parameter to ST_Slope, ST_Aspect and ST_Hillshade

PostGIS trac at osgeo.org
Fri Nov 2 11:20:10 PDT 2012


#2078: [raster] add extent parameter to ST_Slope, ST_Aspect and ST_Hillshade
-------------------------+--------------------------------------------------
 Reporter:  dustymugs    |       Owner:  dustymugs    
     Type:  enhancement  |      Status:  new          
 Priority:  medium       |   Milestone:  PostGIS 2.1.0
Component:  raster       |     Version:  trunk        
 Keywords:               |  
-------------------------+--------------------------------------------------
 This will allow passing a unioned set of tiles (of tiles intersecting tile
 of interest) into the function and constrain the extent to just the tile
 of interest.

 Something like the following would be awesome.  Exact signature is
 currently unknown.

 {{{
 WITH foo AS (
         SELECT 0 AS rid, ST_AddBand(ST_MakeEmptyRaster(2, 2, 0, 0, 1, -1,
 0, 0, 0), 1, '16BUI', 1, 0) AS rast UNION ALL
         SELECT 1, ST_AddBand(ST_MakeEmptyRaster(2, 2, 2, 0, 1, -1, 0, 0,
 0), 1, '16BUI', 2, 0) AS rast UNION ALL
         SELECT 2, ST_AddBand(ST_MakeEmptyRaster(2, 2, 4, 0, 1, -1, 0, 0,
 0), 1, '16BUI', 3, 0) AS rast UNION ALL

         SELECT 3, ST_AddBand(ST_MakeEmptyRaster(2, 2, 0, -2, 1, -1, 0, 0,
 0), 1, '16BUI', 10, 0) AS rast UNION ALL
         SELECT 4, ST_AddBand(ST_MakeEmptyRaster(2, 2, 2, -2, 1, -1, 0, 0,
 0), 1, '16BUI', 20, 0) AS rast UNION ALL
         SELECT 5, ST_AddBand(ST_MakeEmptyRaster(2, 2, 4, -2, 1, -1, 0, 0,
 0), 1, '16BUI', 30, 0) AS rast UNION ALL

         SELECT 6, ST_AddBand(ST_MakeEmptyRaster(2, 2, 0, -4, 1, -1, 0, 0,
 0), 1, '16BUI', 100, 0) AS rast UNION ALL
         SELECT 7, ST_AddBand(ST_MakeEmptyRaster(2, 2, 2, -4, 1, -1, 0, 0,
 0), 1, '16BUI', 200, 0) AS rast UNION ALL
         SELECT 8, ST_AddBand(ST_MakeEmptyRaster(2, 2, 4, -4, 1, -1, 0, 0,
 0), 1, '16BUI', 300, 0) AS rast
 )
 SELECT
         t1.rid,
         ST_Slope(
                 ST_Union(t2.rast),
                 1,
                 t1.rast,
                 '32BF'
         ) AS rast
 FROM foo t1
 CROSS JOIN foo t2
 WHERE t1.rid = 4
         AND t2.rid BETWEEN 0 AND 8
         AND ST_Intersects(t1.rast, t2.rast)
 GROUP BY t1.rid, t1.rast
 }}}

-- 
Ticket URL: <http://trac.osgeo.org/postgis/ticket/2078>
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-devel mailing list