给定 PostGIS 中的 2 个接触的 LINESTRINGS,如何将它们连接在一起?
我在 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以在如下查询中使用 ST_Union :
You could use ST_Union in a query like this:
我会看一下:
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.