From: Regina Obe Date: Fri, 20 Jan 2012 18:14:19 +0000 (+0000) Subject: Add a plpython example for outputting raster images X-Git-Tag: 2.0.0alpha2~27 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6f6a660ffb913ad168f4b07c1154cf9eabe7f906;p=postgis Add a plpython example for outputting raster images git-svn-id: http://svn.osgeo.org/postgis/trunk@8894 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/doc/using_raster_dataman.xml b/doc/using_raster_dataman.xml index c6f6f421f..eae057332 100644 --- a/doc/using_raster_dataman.xml +++ b/doc/using_raster_dataman.xml @@ -689,5 +689,34 @@ public class SaveQueryImage { } }]]> + + + Use PLPython to dump out images via SQL + This is a plpython stored function that creates a file in the server directory for each record. + //plpython postgresql stored proc. Requires you have plpython installed + +--write out 5 images to the PostgreSQL server in varying sizes +-- note the postgresql daemon account needs to have write access to folder +-- this echos bath the file names created; + SELECT write_file(ST_AsPNG( + ST_AsRaster(ST_Buffer(ST_Point(1,5),j*5, 'quad_segs=2'),150*j, 150*j, '8BUI',100)), + 'C:/temp/slices'|| j || '.png') + FROM generate_series(1,5) As j; + + write_file +--------------------- + C:/temp/slices1.png + C:/temp/slices2.png + C:/temp/slices3.png + C:/temp/slices4.png + C:/temp/slices5.png + +