All Products
Search
Document Center

PolarDB:ST_SetSrid

Last Updated:Mar 28, 2026

Sets a spatial reference identifier (SRID) on a geometry object.

Syntax

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

Parameters

ParameterDescription
geomThe meshgeom object.
sfmeshObjectThe sfmesh object.
sridThe SRID to assign to the object.

Description

ST_SetSRID assigns an SRID to a meshgeom or sfmesh object.

Example

The following example assigns SRID 4326 to a meshgeom object constructed from WKT, then calls ST_Srid to confirm the value.

select ST_Srid(ST_SetSrid(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)))))'),4326));

---------
   4326