ST_SRID

更新时间:
复制 MD 格式

Returns the spatial reference identifier (SRID) of a trajectory. Use this function to verify which coordinate system a trajectory uses before performing spatial operations or joining it with other spatial datasets.

Syntax

int ST_SRID(trajectory traj);

Parameters

ParameterDescription
trajThe trajectory to query.

Usage notes

  • The geographic coordinate system and projection information for each SRID are stored in the spatial_ref_sys system table. PolarDB for PostgreSQL uses this table to look up spatial reference details when performing coordinate-based calculations.

  • The default SRID is 0.

Example

This example queries the SRID of a trajectory that has no assigned coordinate system. The function returns 0, the default value.

SELECT ST_SRID(
  '{"trajectory":{"version":1,"type":"STPOINT","leafcount":2,"start_time":"2007-05-27 00:00:00","end_time":"2007-05-28 08:36:47.846","spatial":"LINESTRING(13.43593 52.41721,13.43593 52.41721)","timeline":["2007-05-27 00:00:00","2007-05-28 08:36:47.846"]}}'::trajectory
);

Result:

 st_srid
---------
       0
(1 row)