PostGIS:注册“几何图形”没有 AddGeometryColumn 的列

发布于 2024-09-29 03:11:03 字数 516 浏览 0 评论 0原文

创建几何列的常用方法是 AddGeometryColumn,但是我必须使用预先存在的列,因此我无法使用该函数(据我所知)。

感谢 PostGIS 文档,我已经可以在“ Geometry_columns”表,但是AddGeometryColumn似乎不仅仅创建列在geometry_columns中添加行,例如它添加检查列。


所以我的问题是:除了在 geometry_columns 中添加一行之外,我还需要做什么来手动注册列?

(例如,是否有可与现有列配合使用的修改版本AddGeometryColumn?)

The usual way to create a geometry column is AddGeometryColumn, however I have to work with pre-existing columns, so I can't use that function (as far as I know).

Thanks to the PostGIS docs, I can already register the column in the "geometry_columns" table, however AddGeometryColumn seems to do more than create a column and add a row in geometry_columns, for example it adds checks on the column.


So my question is what: what do I need to do to register the column manually, besides adding a row in geometry_columns ?

(for example, is there a modified version AddGeometryColumn that works with an existing column ?)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

柒七 2024-10-06 03:11:03

在现有列上执行此操作的最简单方法是使用函数 Populate_Geometry_Columns:
https://postgis.net/docs/Populate_Geometry_Columns.html

换句话说:您的函数所要求的已经存在:-)

HTH
尼克拉斯

The easiest way of doing it on existing columns is using the function Populate_Geometry_Columns:
https://postgis.net/docs/Populate_Geometry_Columns.html

In other words: The function you are asking for is already there :-)

HTH
Nicklas

寒尘 2024-10-06 03:11:03

正如您所说,AddGeometryColumn 只是一个方便的快捷方式,不仅可以创建列,还可以添加类型检查和索引。当然,您可以手动将它们添加到现有列中:您只需在单个命令中执行与 AddGeometryColumn 相同的操作即可。

如果您需要将一个“常规”列传输到“gis”列,为什么不使用 SELECT INTO 来传输数据呢?

As you said, AddGeometryColumn is only a handy shortcut for creating not only the column, but adding type checks and indexes. Of course, you can add these by hand to an existing column: you simply need to do the same things that the AddGeometryColumn does for you in a single command.

If you need to transfer one "regular" column to a "gis" column, why not use SELECT INTO for transfering the data?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文