[postgis-devel] [PostGIS] #985: [raster] ST_Count

PostGIS trac at osgeo.org
Fri May 27 11:58:49 PDT 2011


#985: [raster] ST_Count
-----------------------------+----------------------------------------------
  Reporter:  dustymugs       |       Owner:  dustymugs    
      Type:  task            |      Status:  reopened     
  Priority:  medium          |   Milestone:  PostGIS 2.0.0
 Component:  postgis raster  |     Version:  trunk        
Resolution:                  |    Keywords:  history      
-----------------------------+----------------------------------------------

Comment(by robe):

 Yah I prefer include_nodata.  I think the hasnodata is too confusing and
 used in one too many ways.

 As I recall I think there was a bit flag that would tell you if a raster
 had nodata so that was hasnodata (then we changed this to just check if
 bandnodata is null) and if you knew that you would know you could use the
 envelope for intersect checks instead of the convex hull and then we
 started to use it for more than a fast check too which is when it became
 really confusing.  So by saying hasnodata you were overriding the behavior
 of what the default raster told you it had and if you didn't pass it in,
 it meant read it from the meta data (which ends up being the same thing if
 you think about it)

 So the default meant read the hasnodata property from the raster meta data
 and setting it to anything meant override whatever it said to (hasnodata =
 true and hasnodata = false).  Anyrate after Pierre's explanations I still
 don't get it and its so confusing to be worse than useless.

 I say we go with include_nodata -- if you set to true then it doesn't
 matter if the raster has a nodata value or does not have a nodata value
 cause you'll be counting all or excluding it if it does.

 For ST_ValueCount -- I would simply get rid of that flag entirely unless
 it results in speed improvement.  If I'm going to pass a set of pixel
 values, does it really matter the hasnodata.  Am I really saving anything?
 If one of the pixels I pass in the array happens to be the nodata value,
 then of course I want to count it and if it isn't, then I wouldn't be
 counting it anyway.

-- 
Ticket URL: <https://trac.osgeo.org/postgis/ticket/985#comment:8>
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