From: Regina Obe Date: Fri, 10 May 2013 06:57:54 +0000 (+0000) Subject: #2290 provide visual example of color map X-Git-Tag: 2.1.0beta2~34 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1e4f44b64f55541608d3fa0a6fb6c25b9049dd21;p=postgis #2290 provide visual example of color map git-svn-id: http://svn.osgeo.org/postgis/trunk@11394 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/doc/html/images/st_colormap_grey.png b/doc/html/images/st_colormap_grey.png new file mode 100644 index 000000000..ae6bd8a6c Binary files /dev/null and b/doc/html/images/st_colormap_grey.png differ diff --git a/doc/html/images/st_colormap_orig.png b/doc/html/images/st_colormap_orig.png new file mode 100644 index 000000000..f439df093 Binary files /dev/null and b/doc/html/images/st_colormap_orig.png differ diff --git a/doc/html/images/st_colormap_pseudo.png b/doc/html/images/st_colormap_pseudo.png new file mode 100644 index 000000000..7562a05d1 Binary files /dev/null and b/doc/html/images/st_colormap_pseudo.png differ diff --git a/doc/reference_raster.xml b/doc/reference_raster.xml index f4ba7c8d3..9e2f709db 100644 --- a/doc/reference_raster.xml +++ b/doc/reference_raster.xml @@ -10878,17 +10878,83 @@ nv 0 0 0 0 Examples - + This is a junk table to play with --- needs examples - +-- setup test raster table -- +DROP TABLE IF EXISTS funky_shapes; +CREATE TABLE funky_shapes(rast raster); +INSERT INTO funky_shapes(rast) +WITH ref As ( + SELECT ST_MakeEmptyRaster( 200, 200, 0, 200, 1, -1, 0, 0) As rast + ) +SELECT ST_Union(rast) +FROM (SELECT + ST_AsRaster( + ST_Rotate(ST_Buffer( + ST_GeomFromText('LINESTRING(0 2,50 50,150 150,125 50)'), i*2 + ), pi()*i*0.125, ST_Point(50,50)) + , ref.rast, '8BUI'::text, i*5) As rast + FROM ref cross JOIN generate_series(1,10,3) As i ) As shapes ; +SELECT ST_NumBands(rast) As n_orig + , ST_NumBands(ST_ColorMap(rast, 'pseudocolor')) As npseudo + , ST_NumBands(ST_ColorMap(rast, 'greyscale')) As ngrey +FROM funky_shapes; + + n_orig | npseudo | ngrey +--------+---------+------- + 1 | 4 | 1 + + + Examples: Compare different color map looks using ST_AsPNG + SELECT ST_AsPNG(rast) As orig_png + , ST_AsPNG(ST_ColorMap(rast,'greyscale')) As grey_png + , ST_AsPNG(ST_ColorMap(rast, 'pseudocolor')) As pseudo_png +FROM funky_shapes; + + + + + + + + + + + orig_png + + + + + + + + + grey_png + + + + + + + + + pseudo_png + + + + + + + See Also , - + , + , +