제목

ST_SetSRID — Set the SRID on a geometry.

요약

geometry ST_SetSRID(geometry geom, integer srid);

설명

Sets the SRID on a geometry to a particular integer value. Useful in constructing bounding boxes for queries.

[참고]

This function does not transform the geometry coordinates in any way - it simply sets the meta data defining the spatial reference system the geometry is assumed to be in. Use ST_Transform if you want to transform the geometry into a new projection.

This method implements the OGC Simple Features Implementation Specification for SQL 1.1.

This method supports Circular Strings and Curves.

예시

Mark a point as WGS 84 longitude/latitude.

Code
SELECT ST_SetSRID(ST_Point(-123.365556, 48.428611), 4326) AS wgs84long_lat;
래스터 출력
SRID=4326;POINT(-123.365556 48.428611)
Figure
Geometry figure for visual-st-setsrid-01

Mark a point as WGS 84 longitude/latitude and then transform it to Web Mercator.

Code
SELECT ST_Transform(ST_SetSRID(ST_Point(-123.365556, 48.428611), 4326), 3785) AS sphere_merc;
래스터 출력
SRID=3785;POINT(-13732990.8753491 6178458.96425423)
Figure
Geometry figure for visual-st-setsrid-02