This topic describes the ST_AsGeobuf function. This function returns a Geobuf string that represents a collection of rows.

Syntax

bytea  ST_AsGeobuf(anyelement set  row);
bytea  ST_AsGeobuf(anyelement  row , text  geomName);

Parameters

Parameter Description
row The rows whose Geobuf representation you want to obtain. The rows must include the data of at least one geometry column.
geomName The name of the geometry column in the row data. If the value is NULL, this function uses the first geometry column that is found.

Description

Geobuf strings cannot be transmitted as streams.

Examples

SELECT ST_AsGeobuf(q) FROM ( select ST_GeomFromText('POINT(116 40)',4326)) as q;
           st_asgeobuf
----------------------------------
 \x1800220b0a090a0708001a03e80150
(1 row)