Convertit les données binaires Protocol Buffers (Protobuf) en objet trajectory.
Syntaxe
trajectory ST_TrajFromProtobuf(bytea protobuf)
Paramètres
| Paramètre | Description |
|---|---|
protobuf |
Valeur bytea contenant les données de trajectoire encodées au format Protobuf. Pour le schéma attendu, consultez les . |
Valeurs de retour
Renvoie un objet trajectory. Renvoie NULL si l'entrée est impossible à analyser.
Exemple
La requête suivante effectue un aller-retour d'une trajectoire via l'encodage et le décodage Protobuf : st_makeTrajectory construit la trajectoire, ST_AsProtobuf la sérialise en bytea, puis ST_TrajFromProtobuf la désérialise pour retrouver un objet trajectory.
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)));
Résultat :
st_trajfromprotobuf
---------------------------
{"trajectory":{"version":1,"type":"STPOINT","leafcount":1,"start_time":"2010-01-01 11:30:00","end_time":"2010-01-01 ...