如何在整体多角形中找到包含多边形的多边形
在Shapely中,一个多角形由几个不相交的多边形(除了单点交叉路口除外)。如果我有一个Moulderygon polys
和一个pt
,那么我可以测试限制
polys.contains(pt)
true
,以防该点至少在多边形之一。我认为通过使用一些R-Tree在内部有效地工作。但是,实际上,我很感兴趣,对多角形中的多边形的哪个包含了点。我想知道,是否有一个技巧可以识别它而不通过多边形列表进行测试(即polys.geoms
)?
任何提示都将受到赞赏 - 谢谢!!
In shapely, a MultiPolygon is made of several disjoint Polygons (except one-point intersections). If I have a MultiPolygon polys
and a Point pt
, then I can test for containment by
polys.contains(pt)
which gives True
in case the point is in at least one of the polygons. I assume this is working efficiently on the inside by using some R-Tree. However, actually, I am interested, in which of the Polygons in the MultiPolygon the Point is contained. I wonder, whether there is a trick to identify it without testing through the list of polygons (i.e., polys.geoms
)?
Any hint is appreciated - thanks already!!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以随时使用语法
You could always use the syntax