ST_Srid

更新时间:
复制 MD 格式

Returns the spatial reference identifier (SRID) of a spatial object.

SRID identifies the coordinate reference system assigned to a geometry. Verifying the SRID before running spatial operations — such as coordinate transformation — prevents mismatched coordinate system errors.

Syntax

int4 ST_Srid(meshgeom geom);
int4 ST_Srid(sfmesh sfmeshObject);

Parameters

ParameterTypeDescription
geommeshgeomThe meshgeom object to query.
sfmeshObjectsfmeshThe sfmesh object to query.

Return value

Returns an int4 value representing the SRID of the input object.

Example

The following example retrieves the SRID of a meshgeom object created with SRID 4490:

SELECT ST_Srid(
  ST_MeshGeomFromText(
    'Srid=4490;MESHGEOM(PATCH(INDEXSURFACE(VERTEX(0 0 2,0 10 3,10 10 1,10 0 1),INDEX((0,1,2),(1,2,3)))))'
  )
);

Result:

---------
    4490

What's next

  • To create a meshgeom object from WKT input, use ST_MeshGeomFromText.