查询函数返回许多行的函数

发布于 2025-02-06 08:57:30 字数 509 浏览 3 评论 0原文

我有一个带有几何列的表。这些几何形状通常是多重法或多源,我想将它们分成其组成部分,而不复制排行中的其他数据。目前,我使用以下内容:

创建表格为SELECT INDEX,ST_DUMP(几何)作为初始尺寸的几何形状,

这无问题,并生成newtable,带有多边形和linestrings和Linestrings,以及其行的参考列中的initialtable包含其他相关信息。

但是,我想整合找到的进度跟踪,找到在这里上述语句可能需要一些时间。

因此,我想将上述语句拆分为1)创建表2)填充表

很容易,但是填充表使我逃脱了,因为一条多线行可以创建许多线条行。

任何帮助将不胜感激。

I've a table with a geometry column. Those geometries are often multipolygons or multilinestrings and I would like to split them into their constituent parts without duplicating the other data in there rows. At the moment i use the following:

CREATE TABLE newTable AS SELECT index, ST_Dump(geometry) AS geometry FROM initialTable

This works without a problem and produces newTable with polygons and linestrings and a reference column for it's row in the initialTable containing other relevent info.

I would however like to incorporate progress tracking found here as the above statement can take some time.

I would therefore like to split the above statement into 1) creating the table 2) populating the table

The first is easy, but populating the table escapes me as one multilinestring row can create many linestrings rows.

Any assistance would be greatly appreciated.

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

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

发布评论

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

评论(1

策马西风 2025-02-13 08:57:30

中使用st_dump选择,然后将结果设置为insert语句,例如:

CREATE TABLE newTable (gid int, geom geometry(linestring,4326));

INSERT INTO newtable 
SELECT (ST_Dump(geom)).path[1],(ST_Dump(geom)).geom 
FROM initialTable;

Use ST_Dump in a SELECT and redirect the result set to the INSERT statement, e.g.:

CREATE TABLE newTable (gid int, geom geometry(linestring,4326));

INSERT INTO newtable 
SELECT (ST_Dump(geom)).path[1],(ST_Dump(geom)).geom 
FROM initialTable;
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文