All Products
Search
Document Center

PolarDB:ST_TrajFromProtobuf

Last Updated:Aug 08, 2024

Converts Protocol Buffers (Protobuf) data into trajectory data

Syntax

trajectory ST_TrajFromProtobuf(bytea protobuf);

Parameters

Parameter

Description

protobuf

The Protobuf data type. For more information, see Protobuf definitions.

Return values

Trajectory data is returned. If the Protobuf data fails to be parsed, NULL is returned.

Description

This function converts Protobuf data into trajectory data.

Examples

SELECT ST_TrajFromProtobuf(ST_AsProtobuf(st_makeTrajectory('STPOINT'::leaftype, ARRAY[1::float8], ARRAY[2::float8], 4326, ARRAY['2010-01-01 11:30'::timestamp], ARRAY['velocity'], ARRAY[1::int4], NULL, NULL, NULL::anyarray)));
---
    st_trajfromprotobuf
---------------------------
 {"trajectory":{"version":1,"type":"STPOINT","leafcount":1,"start_time":"2010-01-01 11:30:00","end_time":"2010-01-01 ...