ST_SetSrid

更新时间:
复制 MD 格式

Sets a spatial reference identifier (SRID) for an object.

Syntax

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

Parameters

ParameterTypeDescription
geommeshgeomThe meshgeom object to assign the SRID to.
sfmeshObjectsfmeshThe sfmesh object to assign the SRID to.
sridint4The SRID to set on the returned object.

Example

The following example creates a meshgeom object with SRID 4490, reassigns SRID 4326 using ST_SetSrid, and then reads back the SRID with ST_Srid to confirm the update.

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
  )
);

Output:

---------
    4326

See also

  • ST_Srid — Read the current SRID of a spatial object.

  • ST_MeshGeomFromText — Construct a meshgeom object from WKT.