ST_SetSRID — 在几何图形上设置SRID。
geometry ST_SetSRID(
geometry geom, integer srid)
;
将几何图形上的SRID设置为特定整数值。在构造查询的边界框时非常有用。
![]() | |
此函数不以任何方式转换几何图形坐标-它只是设置定义几何图形所在的空间参考系的元数据。使用 ST_Transform 如果要将几何图形转换为新投影。 |
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 long lat --
SELECT ST_SetSRID(ST_Point(-123.365556, 48.428611),4326) As wgs84long_lat; -- the ewkt representation (wrap with ST_AsEWKT) - SRID=4326;POINT(-123.365556 48.428611)
-- Mark a point as WGS 84 long lat and then transform to web mercator (Spherical Mercator) --
SELECT ST_Transform(ST_SetSRID(ST_Point(-123.365556, 48.428611),4326),3785) As spere_merc; -- the ewkt representation (wrap with ST_AsEWKT) - SRID=3785;POINT(-13732990.8753491 6178458.96425423)