From 366470e538db0a4e650c396c45ae139625367aaf Mon Sep 17 00:00:00 2001 From: Regina Obe Date: Mon, 5 Apr 2010 14:12:11 +0000 Subject: [PATCH] Start adding editors, give an additional better example of ST_Value git-svn-id: http://svn.osgeo.org/postgis/trunk@5493 b70326c6-7e19-0410-871a-916f4a2858ee --- doc/reference_wktraster.xml | 143 +++++++++++++++++++++++++++++++++++- 1 file changed, 142 insertions(+), 1 deletion(-) diff --git a/doc/reference_wktraster.xml b/doc/reference_wktraster.xml index 47517807d..f1c04abca 100644 --- a/doc/reference_wktraster.xml +++ b/doc/reference_wktraster.xml @@ -609,7 +609,7 @@ FROM dummy_rast; Examples -SELECt rid, ST_UpperLeftY(rast) As uly +SELECT rid, ST_UpperLeftY(rast) As uly FROM dummy_rast; rid | uly @@ -663,6 +663,27 @@ WHERE rid=2; -----+--------+--------+-------- 2 | 253 | 78 | 70 + + + --- Get all values in bands 1,2,3 of each pixel -- +SELECT x, y, ST_Value(rast, 1, x, y) As b1val, + ST_Value(rast, 2, x, y) As b2val, ST_Value(rast, 3, x, y) As b3val +FROM dummy_rast CROSS JOIN +generate_series(1,1000) As x CROSS JOIN generate_series(1,1000) As y +WHERE rid = 2 AND x <= ST_Width(rast) AND y <= ST_Height(rast); + + x | y | b1val | b2val | b3val +---+---+-------+-------+------- + 1 | 1 | 253 | 78 | 70 + 1 | 2 | 253 | 96 | 80 + 1 | 3 | 250 | 99 | 90 + 1 | 4 | 251 | 89 | 77 + 1 | 5 | 252 | 79 | 62 + 2 | 1 | 254 | 98 | 86 + 2 | 2 | 254 | 118 | 108 + : + : + @@ -714,6 +735,126 @@ rastwidth + + Raster Editors + + + ST_SetBandNoDataValue + Sets the value for the given band that represents no data. + + + + + + integer ST_SetBandNoDataValue + raster rast + integer bandnum + double precision val + + + + + + Description + + Returns the value that represents no data for the band. This will effect ST_Polygon and ST_ConvexHull results. + + + + Examples + + -- change just first band no data value +UPDATE dummy_rast + SET rast = ST_SetBandNoDataValue(rast,1, 254) +WHERE rid = 2; + +-- change no data band value of bands 1,2,3 +UPDATE dummy_rast + SET rast = + ST_SetBandNoDataValue( + ST_SetBandNoDataValue( + ST_SetBandNoDataValue( + rast,1, 254) + ,2,99), + 3,108) + WHERE rid = 2; + + + + + + See Also + , + + + + + + ST_SetPixelSize + Sets the x and y size of pixels in units of coordinate reference system. Number units/pixel width/height + + + + + + raster ST_SetPixelSize + raster rast + float8 xy + + + + raster ST_SetPixelSize + raster rast + float8 x + float8 y + + + + + + Description + + Sets the x and y size of pixels in units of coordinate reference system. Number units/pixel width/height. If + only one unit passed in, assumed x and y are the same number. + + + + Examples + + UPDATE dummy_rast + SET rast = ST_SetPixelSize(rast,1.5) +WHERE rid = 2; + +SELECT ST_PixelSizeX(rast) As pixx, ST_PixelSizeY(rast) As pixy, ST_Box2D(rast) As newbox +FROM dummy_rast +WHERE rid = 2; + + pixx | pixy | newbox +------+------+---------------------------------------------- + 1.5 | 1.5 | BOX(3427927.75 5793244,3427935.25 5793251.5) + + UPDATE dummy_rast + SET rast = ST_SetPixelSize(rast,1.5,0.55) +WHERE rid = 2; + +SELECT ST_PixelSizeX(rast) As pixx, ST_PixelSizeY(rast) As pixy, ST_Box2D(rast) As newbox +FROM dummy_rast +WHERE rid = 2; + + pixx | pixy | newbox +------+------+-------------------------------------------- + 1.5 | 0.55 | BOX(3427927.75 5793244,3427935.25 5793247) + + + + + + See Also + , , + + + + Raster Outputs -- 2.40.0