All Products
Search
Document Center

PolarDB:ST_TrajFromProtobuf

Last Updated:Jan 04, 2026

Transforms a trajectory from the Protobuf format to the trajectory data type.

Syntax

trajectory ST_TrajFromProtobuf(bytea protobuf);

Parameters

Parameter

Description

protobuf

A trajectory represented in Protobuf format. For more information, see the protobuf definition.

Return value

Returns a trajectory object, or NULL if the Protobuf parsing fails.

Description

Transforms a trajectory from the Protobuf format to the trajectory data type.

Example

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 ...