[postgis-devel] [PostGIS] #2077: [raster] ST_Hillshade output can be wrong

PostGIS trac at osgeo.org
Fri Nov 2 10:24:44 PDT 2012


#2077: [raster] ST_Hillshade output can be wrong
-----------------------+----------------------------------------------------
 Reporter:  dustymugs  |       Owner:  dustymugs    
     Type:  defect     |      Status:  assigned     
 Priority:  medium     |   Milestone:  PostGIS 2.0.2
Component:  raster     |     Version:  2.0.x        
 Keywords:             |  
-----------------------+----------------------------------------------------

Comment(by dustymugs):

 For -trunk, better to use the following query

 {{{
 WITH foo AS (
         SELECT ST_SetValues(
                 ST_AddBand(ST_MakeEmptyRaster(5, 5, 0, 0, 1, -1, 0, 0, 0),
 1, '32BF', 0, -9999),
                 1, 1, 1, ARRAY[
                         [1, 1, 1, 1, 1],
                         [1, 2, 2, 2, 1],
                         [1, 2, 3, 2, 1],
                         [1, 2, 2, 2, 1],
                         [1, 1, 1, 1, 1]
                 ]::double precision[][]
         ) AS rast
 ), bar AS (
         SELECT
                 ST_Slope(rast, 1, '32BF') AS slope,
                 ST_Aspect(rast, 1, '32BF') AS aspect,
                 ST_Hillshade(rast, 1, '32BF', 315, 45) AS hillshade
         FROM foo
 )
 SELECT
         ST_DumpValues(slope)
 FROM bar
 }}}

-- 
Ticket URL: <http://trac.osgeo.org/postgis/ticket/2077#comment:2>
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