From: Regina Obe Date: Fri, 27 May 2011 06:46:05 +0000 (+0000) Subject: preliminary documentation for ST_Count X-Git-Tag: 2.0.0alpha1~1549 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8b86077d6d3ef34d43fbc49c0d1f26c034dbda02;p=postgis preliminary documentation for ST_Count git-svn-id: http://svn.osgeo.org/postgis/trunk@7265 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/doc/reference_raster.xml b/doc/reference_raster.xml index 89a10d6ba..977e38d35 100644 --- a/doc/reference_raster.xml +++ b/doc/reference_raster.xml @@ -865,6 +865,69 @@ FROM (SELECT rid, ST_MetaData(rast) As md Raster Accessors + + + ST_Count + Returns the number of pixels in a given band of a raster or raster coverage. If no band is specified defaults to band 1. If hasnodata is set to true, will also count pixels with no data. + + + + + + text ST_Count + raster rast + integer nband=1 + boolean hasnodata=true + + + text ST_Count + raster rast + boolean hasnodata + + + text ST_Count + text rastertable + text rastercolumn + integer nband=1 + boolean hasnodata=true + + + text ST_Count + text rastertable + text rastercolumn + boolean hasnodata + + + + + + 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. + If hasnodata is set to true, will also count pixels with no data. Set hasnodata to false to get only pixels with data + Availability: 2.0.0 + This currently does the opposite of what I just said. Will be fixed to agree with the documentation or the documentation will be fixed to agee with the behavior. + + + + Examples + + + --example will count all pixels not 249 and one will count all pixels. Note this behavior may be reversed -- + SELECT rid, ST_Count(ST_SetBandNoDataValue(rast,249)) As exclude_nodata, ST_Count(ST_SetBandNoDataValue(rast,249),false) As include_nodata + FROM dummy_rast WHERE rid=2; + +rid | exclude_nodata | include_nodata +-----+----------------+---------------- + 2 | 23 | 25 + + + + + See Also + + + ST_GeoReference @@ -3347,30 +3410,28 @@ FROM dummy_rast WHERE rid=2; bytea ST_AsTIFF raster rast - - text[] options'' - text srssameassource - + text[] options='' + text srs=sameassource bytea ST_AsTIFF raster rast - text [compression=''] - text [srs=sameassource] + text compression='' + text srs=sameassource bytea ST_AsTIFF raster rast integer[] nbands - text [compression=''] - text [srs=sameassource] + text compression='' + text srs=sameassource bytea ST_AsTIFF raster rast integer[] nbands text[] options - text [srs=sameassource] + text srs=sameassource