PostGIS函数将几何线连接在一起?
(注意:the_geom 是一个几何值(类型:LINESTRING),在本例中,为了可读性,我将它们随机化)
gid | kstart | kend | ctrl_sec_no | the_geom | the_sum_geom
626 | 238 | 239 | 120802 | 123456 | NULL
638 | 249 | 250 | 120802 | 234567 | NULL
4037| 239 | 249 | 120802 | 345678 | NULL
[真实实践描述] 对于那些不介意目的的人,请跳过此部分
我想做“这个”(我过去的问题中的一组查询,链接 位于本文末尾)对于表 B 中的每一行(又名。 土地库存)。这两个表通过“ctrl_sec_no”相关 (又名道路的控制路段编号),这意味着 :: 在 ONE 中 ctrl_sec_no -- 120802(实际上是一条路,相当于3 连接在一起的几何线串 (the_geom),从 kstart 238(从 238 公里开始)到 kend 250)
[PostGIS问题]
问题是如何将这3条线{aka gid(626,638,4037)从表中连接在一起并得到结果通过使用 PostGIS 函数(无论如何)在“the_sum_geom”(最初为 NULL)中。之后,我们将使用这个“the_sum_geom”来查找该几何线串上的点
(note: the_geom is a geometry value (TYPE: LINESTRING), in this case i random them for readability)
gid | kstart | kend | ctrl_sec_no | the_geom | the_sum_geom
626 | 238 | 239 | 120802 | 123456 | NULL
638 | 249 | 250 | 120802 | 234567 | NULL
4037| 239 | 249 | 120802 | 345678 | NULL
[Real Practice Description] just skip this for those who don't mind the purpose
I would like to do 'this' (a set of queries from my past question, link
located on the end of this post) for every row in Table B (aka.
land_inventory). These two tables are related by 'ctrl_sec_no'
(aka. control section number of a road) which means :: in ONE
ctrl_sec_no -- 120802 (in fact, it is a road which is equivalent to 3
geometry LINESTRINGs (the_geom) connected together, from kstart 238 (start at kilometre of 238) to kend 250)
[PostGIS question]
the question is how to connect this 3 lines {aka gid(626,638,4037) from the table} together and result in 'the_sum_geom' (initially NULL) by using PostGIS functions (whatever). after that we will use this 'the_sum_geom' to find the POINT on this geometry LINESTRING
(How calculate things from many tables by using a few queries?).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您要查找的函数是 ST_Union,您需要将其与聚合形式一起使用:
与 < a href="http://www.postgis.org/docs/ST_LineMerge.html" rel="nofollow">ST_LineMerge 您可以从多行转换为 LineString 但有一个警告,如果多行不能合并后,它将返回多行而不进行任何修改。请参阅 ST_LineMerge 文档,了解 ST_LineMerge 可以做什么或不能做什么。
The function you are looking for is ST_Union, you need to use it with the aggregate form:
With ST_LineMerge you can convert from Multiline to LineString but there is a caveat, if the multi line cant be merged it will return the multiline without any modification. See the ST_LineMerge docs to understand what ST_LineMerge can or can't do.