给定 PostGIS 中的 2 个接触的 LINESTRINGS,如何将它们连接在一起?

发布于 2024-12-20 17:58:42 字数 342 浏览 1 评论 0原文

我在 PostGIS & 中有一张表带有 LINESTRING 列的 PostgreSQL。我正在构建一个查询,该查询是该表与其自身连接的结果,并且我知道每个连接的几何列(称为 geom),即第一行是来自 的 LINESTRING A--B--…---K 第二行是 K--L--…--T,即第一条 LINESTRING 的最后一个点与第二点的第一点线串。

是否有一些函数/表达式将这 2 个 LINESTRING“连接”/“join”/“合并”/“扩展”为 1 个 LINESTRING,看起来像 A--B--…--K--L--… --T?

I have a table in PostGIS & PostgreSQL with a LINESTRING column. I am constructing a query that's the result of joining this table with itself, and I know that the geometry columns (call them geom) of each one connect, i.e. the first row is a LINESTRING from A--B--…---K and the second row is K--L--…--T, i.e. the last point of the first LINESTRING is the same as the first point of the second LINESTRING.

Is there some function/expression where "concatinate"/"join"/"merge"/"extend" these 2 LINESTRINGs into 1 LINESTRING that looks like A--B--…--K--L--…--T?

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

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

发布评论

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

评论(2

一抹淡然 2024-12-27 17:58:42

您可以在如下查询中使用 ST_Union

SELECT ST_Union(the_geom) from mytable;

You could use ST_Union in a query like this:

SELECT ST_Union(the_geom) from mytable;
风吹过旳痕迹 2024-12-27 17:58:42

我会看一下:

http://postgis.refractions.net/docs/ST_Union.html< /a>

它将返回两个几何图形的并集,该几何图形应该是单个线串。

I would take a look at :

http://postgis.refractions.net/docs/ST_Union.html

It would return the union of the two geometries which should be a single linestring.

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