id summary reporter owner description type status priority milestone component version resolution keywords cc 953 [raster] ST_ValueCount Bborie Park Bborie Park "ST_Count provides the ability to count the number of times that a user-provided value is present in a raster. To handle floating point values, a rounding argument is provided. 1. ST_Count(rast raster, nband integer, hasnodata boolean, value double precision, roundto double precision) -> integer returns the number of times that value is present in the raster hasnodata: if FALSE, nodata values in band are considered in the count. if TRUE, nodata values are not considered value: the value to count in the raster roundto: the decimal position to round a pixel value to. Originally intended for use with 32BF and 64BF pixel types, it can also be used with integers when round to the tens, hundreds or higher place. examples are... {{{ roundto < 0: no rounding 0: no rounding 0.1: round to the tenths place 0.01: round to the hundredths place 0.001: round to the thousandths place 1: round to the ones place 10: round to the tens place 100: round to the hundreds place }}} {{{ ST_Count(rast, 1, TRUE, 23, 0) ST_Count(rast, 5, FALSE, 3.14, 0.01) ST_Count(rast, 2, TRUE, 100, 100) ST_Count(rast, 1, FALSE, -9999, 1) }}} 2. ST_Count(rast raster, nband integer, value double precision, roundto double precision) -> integer hasnodata is assumed to be TRUE {{{ ST_Count(rast, 5, 3.14, 0.01) ST_Count(rast, 2, 100, 100) }}} 3. ST_Count(rast raster, nband integer, value double precision) -> integer roundto is assumed to be 0, so no rounding takes place. hasnodata is assumed to be TRUE {{{ ST_Count(rast, 1, -9999) }}} 4. ST_Count(rast raster, value double precision, roundto double precision) -> integer nband is assumed to be 1. hasnodata is assumed to be TRUE. 5. ST_Count(rast raster, value double precision) -> integer nband is assumed to be 1. roundto is assumed to be 0, so no rounding takes place. hasnodata is assumed to be TRUE. A set of variations where more than one value parameter can be provided should be added. A set of variations where no value parameter is provided should be added. This results in every unique value is counted, unless a roundto parameter is provided." task closed medium PostGIS 2.0.0 raster master fixed history