Updates the Object Storage Service (OSS) file path reference for a trajectory object's data file.
This function is not supported in later versions. Use Cold data tiered storage instead.
Syntax
trajectory ST_SetStorageLocation(trajectory traj, text new_path, bool checkValid default true);Parameters
| Parameter | Description |
|---|---|
traj | The trajectory object. |
new_path | The OSS folder path where the trajectory data file is stored. Only OSS folders are supported. Format: 'OSS://<AccessKey ID>:<AccessKey secret>@<Endpoint>/<Bucket>/<Directory>'. The data is stored as a .gtf file in the specified folder. |
checkValid | Specifies whether to validate the path. Default value: true. If set to true, the system tests whether the specified OSS folder is accessible using your AccessKey pair. If access fails, an error is returned. |
Description
ST_SetStorageLocation updates the file path reference for the data file of a trajectory object. It does not physically move the file. Move the OSS folder containing the trajectory data to the new location before calling this function.
After the file is moved, new trajectory data may not be appendable to it. If this occurs, an error containing is not appendable is returned. To fix this, ensure the last data block is uploaded using the AppendObject operation in OSS.
Examples
SELECT ST_SetStorageLocation(traj, '<New Path>') FROM trajs;Output:
st_setstoragelocation
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
{"trajectory":{"version":1,"type":"STPOINT","leafcount":6,"start_time":"Sat Jan 01 03:15:42 2000","end_time":"Sat Jan 01 05:16:43 2000","spatial":"LINESTRING(2 2 0,33.042158099636 36.832684322819 0,47.244002354518 47.230026333034 0,64.978971942887 60.618813472986 0,77.621717839502 78.012496630661 0,80 78 0)","timeline":["Sat Jan 01 03:15:42 2000","Sat Jan 01 03:39:54 2000","Sat Jan 01 04:04:06 2000","Sat Jan 01 04:28:18 2000","Sat Jan 01 04:52:31 2000","Sat Jan 01 05:16:43 2000"]}}
{"trajectory":{"version":1,"type":"STPOINT","leafcount":6,"start_time":"Sat Jan 01 03:15:42 2000","end_time":"Sat Jan 01 05:16:43 2000","spatial":"LINESTRING(2 2 0,33.042158099636 36.832684322819 0,47.244002354518 47.230026333034 0,64.978971942887 60.618813472986 0,77.621717839502 78.012496630661 0,80 78 0)","timeline":["Sat Jan 01 03:15:42 2000","Sat Jan 01 03:39:54 2000","Sat Jan 01 04:04:06 2000","Sat Jan 01 04:28:18 2000","Sat Jan 01 04:52:31 2000","Sat Jan 01 05:16:43 2000"]}}
{"trajectory":{"version":1,"type":"STPOINT","leafcount":6,"start_time":"Sat Jan 01 03:15:42 2000","end_time":"Sat Jan 01 05:16:43 2000","spatial":"LINESTRING(2 2,33.042158099636 36.832684322819,47.244002354518 47.230026333034,64.978971942887 60.618813472986,77.621717839502 78.012496630661,80 78)","timeline":["Sat Jan 01 03:15:42 2000","Sat Jan 01 03:39:54 2000","Sat Jan 01 04:04:06 2000","Sat Jan 01 04:28:18 2000","Sat Jan 01 04:52:31 2000","Sat Jan 01 05:16:43 2000"]}}
TRAJECTORY EMPTY
(4 rows)