地理:使用环将每个多边形与GeodataFrame之前的每个多边形区分开来?
我有一个带有许多多边形的GeodataFrame。我想通过循环自动化差异,以每个先前的每个和polygon进行此操作,然后将它们添加到新的gdf:
new_gdf = polygon [0:1] .overlay(polygon [1:2],如何='差异')
我一次可以做到这一点,但是我想找到一种更有效的方法,尤其是当我(某天)有很多多边形时。
有人会想知道我怎么做吗?我正在尝试使用iterrows(),但是在确切的语法上失败了。
先感谢您。
I have a geodataframe with many polygons. I'd like to automate differencing with a loop, to do this with each preceding and following polygon and add them to a new gdf:
new_gdf = polygon[0:1].overlay(polygon[1:2], how='difference')
I am able to do this one at a time, but I'd like to find a more efficient way, especially when I will (someday) have a lot of polygons.
Would anyone have an idea of how I might do this? I'm trying to use iterrows(), but am failing on the exact syntax.
Thank you in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
而不是
覆盖()
您可能正在寻找geoseries.differenies.difference()
可能是这样的:
示例
polys
geodataframe:结果
diffs
geodataseries:Instead of
overlay()
you might be looking forGeoSeries.difference()
Would be something like this:
Sample
polys
GeoDataFrame:Resulting
diffs
GeoDataSeries: