postgis使用点分割多边形
我想使用点来提取多边形部分来切割它。 我见过 ST_Dump 和 ST_Split 但它们似乎没有达到目的。我应该创建更多点来创建线段并使用 st_split 来切割它们吗?我认为这太多了,但如果有必要的话我会这样做:)
任何建议都会很好:) 干杯, 一个
I would like to extract polygon parts using points to cut it.
I have seen ST_Dump and ST_Split but they do not seem to do the trick. Should I create more points in order to create a line segment and use st_split to cut them? I think thats too much but I would do it if necessary :)
Any suggestions would be nice :)
Cheers,
A
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
那么,您想要从多边形的每个边都有一条线串吗?如果这是真的,我想我有一个答案。
首先:我将创建一个视图,其中所有多边形都作为线串。正如您所指出的,您可以使用 ST_Boundary。 (这样第二个查询就很容易编写和读取)
第二:由于它是一个线串,因此您可以使用 ST_POINTN 来获取第 n 个点,并使用 ST_MAKELINE 来制作一条两段线。
ST_MakeLine 将为您提供线串段。您可以在 python 中创建一个循环来迭代所有点。如果这是您需要经常做的事情,那么最好使用这些段创建一个新表。
另外,请访问 gis.stackexchange.com 加入我们;)这个问题与您的问题类似,并使用 SQL 来创建一系列循环遍历所有几何图形(而不是Python)。
So, you want a linestring from each edge a polygon? I think I have an answer if that is true.
First: I would create a view that has all you polygons as linestrings. As you've pointed out, you can use ST_Boundary. (So that the second query is easy to write and read)
Second: Since its a linestring you can use ST_POINTN to get the nth point and ST_MAKELINE to make a two segment line.
The ST_MakeLine will get you your linestring segment. You can make a loop in python to iterate though all the points. If this is something you need to do a lot, it would probably be best to create a new table with these segments.
Also, come join us at gis.stackexchange.com ;) This question is similiar to yours and uses SQL to create a series to loop through all the geometries (instead of python).