From 29f0a3e403ecfa8577faecae4f85591aa6f3da54 Mon Sep 17 00:00:00 2001 From: Paul Ramsey Date: Fri, 22 May 2015 12:51:14 +0000 Subject: [PATCH] #3123, add example using array input form of function git-svn-id: http://svn.osgeo.org/postgis/trunk@13540 b70326c6-7e19-0410-871a-916f4a2858ee --- doc/reference_output.xml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/doc/reference_output.xml b/doc/reference_output.xml index 8aa20d38e..a54c7a49a 100644 --- a/doc/reference_output.xml +++ b/doc/reference_output.xml @@ -1222,7 +1222,17 @@ SELECT ST_AsTWKB('LINESTRING(1 1,5 5)'::geometry); st_astwkb -------------------------------------------- \x02000202020808 + + +To create an aggregate TWKB object including identifiers aggregate the desired geometries and objects first, using "array_agg()", then call the appropriate TWKB function. + + +SELECT ST_AsTWKB(array_agg(geom), array_agg(gid)) FROM mytable; + st_astwkb +-------------------------------------------- +\x040402020400000202 + -- 2.40.0