如何更改几何列的SRID?
我有一个表,其中一列是具有 SRID 的多边形的几何列 the_geom
。我在同一个表中添加了一个新列,其几何数据与 the_geom
完全相同。
这个新列的名称为 the_geom4258
,因为我想将其 SRID 设置为 4258。将几何体的 SRID 更改为另一个坐标系的过程是什么?应用以下查询是否足够:
UPDATE table SET the_geom4258=ST_SetSRID(the_geom4258,4258);
I have a table where one of the columns is a geometry column the_geom
for polygons with an SRID. I added a new column in the same table with exactly the same geometry data as the_geom
.
This new column has the name the_geom4258
because I want to set its SRID to 4258. What is the procedure to change the geometry's SRID to another coordinate system? Is it enough to apply the following query:
UPDATE table SET the_geom4258=ST_SetSRID(the_geom4258,4258);
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您应该使用 ST_Transform 函数。还可以使用函数 AddGeometryColumn 创建新列,以确保所有必要的约束也都满足创建:
ST_SetSRID 只是设置投影标识符,但实际上并不转换几何图形。
You should use the ST_Transform function. Also use the function AddGeometryColumn to create your new column, to ensure all the necessary constraints are also created:
ST_SetSRID just sets the projection identifier, but does not actually transform the geometries.