From 07e0193feddd5aaa47f0c9aa67bfc6d3dbcd4fd0 Mon Sep 17 00:00:00 2001 From: Regina Obe Date: Mon, 5 Apr 2010 02:28:54 +0000 Subject: [PATCH] more accessors git-svn-id: http://svn.osgeo.org/postgis/trunk@5485 b70326c6-7e19-0410-871a-916f4a2858ee --- doc/reference_wktraster.xml | 249 ++++++++++++++++++++++++++++++------ 1 file changed, 212 insertions(+), 37 deletions(-) diff --git a/doc/reference_wktraster.xml b/doc/reference_wktraster.xml index a97cfdd7f..b9baa779e 100644 --- a/doc/reference_wktraster.xml +++ b/doc/reference_wktraster.xml @@ -12,9 +12,9 @@ For more information about WKT Raster, please refer to PostGIS WKT Raster Home Page. For the examples in this reference we will be using a raster table of dummy rasters - Formed with the following code -CREATE TABLE dummy_rast(rast raster); -INSERT INTO dummy_rast(rast) -VALUES( +CREATE TABLE dummy_rast(rid integer, rast raster); +INSERT INTO dummy_rast(rid, rast) +VALUES(1, ('01' -- little endian (uint8 ndr) || '0000' -- version (uint16 0) @@ -33,7 +33,7 @@ VALUES( || '0000000000000000' -- skewY (float64 0) || -'0A000000' -- SRID (int32 10) +'00000000' -- SRID (int32 0) || '0A00' -- width (uint16 10) || @@ -43,7 +43,7 @@ VALUES( - Raster Accessorts + Raster Accessors ST_Height @@ -69,7 +69,7 @@ VALUES( Examples SELECT ST_Height(rast) As rastheight -FROM dummy_rast LIMIT 1; +FROM dummy_rast WHERE rid=1; rastheight ---------------- @@ -84,6 +84,129 @@ rastheight + + + + ST_NumBands + Returns the number of bands in the raster object. + + + + + + integer ST_NumBands + raster rast + + + + + + Description + + Returns the number of bands in the raster object. + + + + Examples + + SELECT ST_NumBands(rast) As numbands +FROM dummy_rast WHERE rid=1; + +numbands +---------------- +0 + + + + + + See Also + + + + + + + ST_PixelSizeX + Returns the x size of pixels in units of coordinate reference system? + + + + + + float8 ST_PixelSizeX + raster rast + + + + + + Description + + Returns the x size of pixels in units of coordinate reference system? + + + + Examples + + SELECT ST_PixelSizeX(rast) As rastpixwidth +FROM dummy_rast WHERE rid=1; + +rastpixwidth +---------------- +2 + + + + + + + See Also + + + + + + + ST_PixelSizeY + Returns the y size of pixels in units of coordinate reference system? + + + + + + float8 ST_PixelSizeY + raster rast + + + + + + Description + + Returns the y size of pixels in units of coordinate reference system? + + + + Examples + + SELECT ST_PixelSizeY(rast) As rastpixheight +FROM dummy_rast WHERE rid=1; + +rastpixheight +---------------- +3 + + + + + + + See Also + + + + ST_Width @@ -109,7 +232,7 @@ rastheight Examples SELECT ST_Width(rast) As rastwidth -FROM dummy_rast LIMIT 1; +FROM dummy_rast WHERE rid=1; rastwidth ---------------- @@ -124,6 +247,86 @@ rastwidth + + + + ST_SRID + Returns the spatial reference identifier of the raster as defined in spatial_ref_sys table. + + + + + + integer ST_SRID + raster rast + + + + + + Description + + Returns the spatial reference identifier of the raster object as defined in the spatial_ref_sys table. + From PostGIS 2.0+ the srid of a non-georeferenced raster/geometry is 0 instead of the prior -1. + + + + Examples + + SELECT ST_SRID(rast) As srid +FROM dummy_rast WHERE rid=1; + +srid +---------------- +0 + + + + + + See Also + , + + + + + + ST_Value + Returns the value of a given band in a given columnx, rowy pixel. Band numbers start at 1. + + + + + + integer ST_Value + raster rast + integer bandnum + integer columnx + integer rowy + + + + + + Description + + Returns the value of a given band in a given columnx, rowy pixel. Band numbers start at 1. + + + + Examples + + + + + + + + + See Also + + + @@ -156,36 +359,8 @@ rastwidth Examples - CREATE TABLE dummy_rast(rast raster); -INSERT INTO dummy_rast(rast) -VALUES( -('01' -- little endian (uint8 ndr) -|| -'0000' -- version (uint16 0) -|| -'0000' -- nBands (uint16 0) -|| -'0000000000000040' -- scaleX (float64 2) -|| -'0000000000000840' -- scaleY (float64 3) -|| -'000000000000E03F' -- ipX (float64 0.5) -|| -'000000000000E03F' -- ipY (float64 0.5) -|| -'0000000000000000' -- skewX (float64 0) -|| -'0000000000000000' -- skewY (float64 0) -|| -'0A000000' -- SRID (int32 10) -|| -'0A00' -- width (uint16 10) -|| -'1400' -- height (uint16 20) -)::raster -); -SELECT ST_AsBinary(rast) As rastbin -FROM dummy_rast LIMIT 1; + SELECT ST_AsBinary(rast) As rastbin +FROM dummy_rast WHERE rid=1; rastbin --------------------------------------------------------------------------------- -- 2.40.0