[postgis-tickets] [PostGIS] #2454: [raster] ST_PixelAsPolygons does not obey exclude_nodata_value=TRUE

PostGIS trac at osgeo.org
Fri Aug 30 06:46:04 PDT 2013


#2454: [raster] ST_PixelAsPolygons does not obey exclude_nodata_value=TRUE
--------------------+-------------------------------------------------------
 Reporter:  alfred  |       Owner:  dustymugs    
     Type:  defect  |      Status:  new          
 Priority:  medium  |   Milestone:  PostGIS 2.1.1
Component:  raster  |     Version:  2.1.x        
 Keywords:          |  
--------------------+-------------------------------------------------------

Comment(by dustymugs):

 When '''exclude_nodata_value''' = true, the value for NODATA pixels are
 returned as NULL. When '''exclude_nodata_value''' = false, the value for
 NODATA pixels are returned as the number designated the NODATA value.

 You can get rid of those NULL values by adding a where clause...

 {{{
 SELECT (gv).x, (gv).y, (gv).val, ST_AsText((gv).geom) geom
 FROM (SELECT ST_PixelAsPolygons(
                  ST_SetValue(ST_SetValue(ST_AddBand(ST_MakeEmptyRaster(2,
 2, 0, 0, 0.001, -0.001, 0.001, 0.001, 4269),
                                                     '8BUI'::text, 1, 0),
                                          2, 2, 10),
                              1, 1, NULL), 1, true
 ) gv
 ) foo
 WHERE (gv).val IS NOT NULL
 }}}

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