From: Regina Obe Date: Mon, 30 May 2011 08:27:29 +0000 (+0000) Subject: more corrections and one more example for ST_ValueCount X-Git-Tag: 2.0.0alpha1~1523 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4221bf3e1722b60ab90dc967c47fcf2436d10c16;p=postgis more corrections and one more example for ST_ValueCount git-svn-id: http://svn.osgeo.org/postgis/trunk@7291 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/doc/reference_raster.xml b/doc/reference_raster.xml index cbd096925..38ed228d7 100644 --- a/doc/reference_raster.xml +++ b/doc/reference_raster.xml @@ -3329,7 +3329,7 @@ ORDER BY value, quantile,rid ST_ValueCount - Returns a set of records containing a pixel band valuue and count of the number of pixels in a given band of a raster (or a raster coverage) that have a given set of values. If no band is specified defaults to band 1. BY default nodata value pixels are not counted. + Returns a set of records containing a pixel band value and count of the number of pixels in a given band of a raster (or a raster coverage) that have a given set of values. If no band is specified defaults to band 1. By default nodata value pixels are not counted. and all other values in the pixel are output and pixel band values are rounded to the nearest integer. @@ -3355,7 +3355,7 @@ ORDER BY value, quantile,rid double precision OUT count - record ST_ValueCount + SETOF record ST_ValueCount raster rast double precision[] searchvalues double precision roundto=0 @@ -3369,7 +3369,7 @@ ORDER BY value, quantile,rid double precision roundto=0 - record ST_ValueCount + SETOF record ST_ValueCount text rastertable text rastercolumn integer nband=1 @@ -3380,7 +3380,7 @@ ORDER BY value, quantile,rid double precision OUT count - record ST_ValueCount + SETOF record ST_ValueCount text rastertable text rastercolumn double precision[] searchvalues @@ -3394,7 +3394,8 @@ ORDER BY value, quantile,rid Description - Returns the number of pixels in a given band of a raster or raster coverage. If no band is specified nband defaults to 1. + Returns a set of records with columns value count which contain the pixel band value and count of pixels in the raster tile or raster coverage of selected band. + If no band is specified nband defaults to 1. If no searchvalues are specified, will return all pixel values found in the raster or raster coverage. If one searchvalue is given, will return an integer instead of records denoting the count of pixels having that pixel band value If exclude_nodata_value is set to false, will also count pixels with no data. Availability: 2.0.0 @@ -3471,7 +3472,23 @@ FROM (SELECT ST_ValueCount(rast,2) As pvc -------+----- 51 | 502 54 | 521 - + + + +-- Just return count of pixels in each raster tile that have value of 100 of tiles that intersect a specific geometry -- +SELECT rid, ST_ValueCount(rast,2,100) As count + FROM o_4_boston + WHERE ST_Intersects(rast, + ST_GeomFromText('POLYGON((224486 892151,224486 892200,224706 892200,224706 892151,224486 892151))',26986) + ) ; + + rid | count +-----+------- + 1 | 56 + 2 | 95 + 14 | 37 + 15 | 64 +