From: Regina Obe Date: Thu, 2 Jun 2011 21:54:57 +0000 (+0000) Subject: document ST_Band X-Git-Tag: 2.0.0alpha1~1502 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5a477972e9826af10bba09892e839eed20d292ef;p=postgis document ST_Band git-svn-id: http://svn.osgeo.org/postgis/trunk@7312 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/doc/reference_raster.xml b/doc/reference_raster.xml index c3e862a82..fed4477fd 100644 --- a/doc/reference_raster.xml +++ b/doc/reference_raster.xml @@ -2055,6 +2055,82 @@ FROM (SELECT ST_MetaData(rast) As rmd + + + ST_Band + Returns one or more bands of an existing raster as a new raster. Useful for building new rasters from existing rasters. + + + + + + + raster ST_Band + raster rast + integer[] nbands = ARRAY[1] + + + raster ST_Band + raster rast + text nbands + character delimiter=',' + + + + raster ST_Band + raster rast + integer nband + + + + + + Description + + Returns a single band of an existing raster as a new raster. Useful for building new rasters from existing rasters or export of only selected + bands of a raster. If no band is specified, band 1 is assumed. Used as a helper function in various functons suc as for deleting a band. + + Availability: 2.0.0 + + + + Examples + + -- Make 2 new rasters: 1 containing band 1 of dummy, second containing band 2 of dummy and then reclassified as a 2BUI +SELECT ST_NumBands(rast1) As numb1, ST_BandPixelType(rast1) As pix1, + ST_NumBands(rast2) As numb2, ST_BandPixelType(rast2) As pix2 +FROM ( + SELECT ST_Band(rast) As rast1, ST_Reclass(ST_Band(rast,3), '100-200):1, [200-254:2', '2BUI') As rast2 + FROM dummy_rast + WHERE rid = 2) As foo; + + numb1 | pix1 | numb2 | pix2 +-------+------+-------+------ + 1 | 8BUI | 1 | 2BUI + + + -- Return bands 2 and 3. Use text to define bands +SELECT ST_NumBands(ST_Band(rast, '2,3')) As num_bands + FROM dummy_rast WHERE rid=2; + +num_bands +---------- +2 + +-- Return bands 2 and 3. Use array to define bands +SELECT ST_NumBands(ST_Band(rast, ARRAY[2,3])) As num_bands + FROM dummy_rast +WHERE rid=2; + + + + + + See Also + , , , + + + ST_BandMetaData @@ -4642,7 +4718,7 @@ col | row | ov1 | rv1 | ov2 | rv2 | ov3 | rv3 See Also - , , /para> + , , , /para>