gpt4 book ai didi

python - Arcgis 从不规则网格中选择多边形以移除孤立的单元格

转载 作者:行者123 更新时间:2023-12-04 10:08:21 28 4
gpt4 key购买 nike

我在一个多边形 shapefile 中有一个不规则的三角形网格。这些单元格的主题是仅显示高于我的“兴趣”阈值水平的三角形。可见的相邻三角形被认为是真实的。需要删除空间隔离的三角形,因为它们可能是虚假的。

我可以使用定义查询进行过滤以删除低于阈值的三角形,但我无法弄清楚如何删除隔离三角形。

我知道我可能需要使用多边形邻居

screenshot from Arcgis

请发送帮助!

最佳答案

我遇到了类似的问题,所以我做了解决方法并设置了适当的阈值

from shapely.geometry import Polygon

coords1 = [(54.950899, 60.169158), (54.953492, 60.169158), (54.950958, 60.169990)]
poly1 = Polygon(coords1)

coords2 = [(24.950899, 60.169158), (24.953492, 60.169158), (24.950958, 60.169990)]
poly2 = Polygon(coords2)


poly1.distance(poly2)

# 29.997407

poly1.distance(poly1)

#0.0

您可以设置阈值来识别空间上孤立的三角形

附言这个解决方法对我有用。这是解决方案供您引用。这里采用随机多边形。

引用:
https://automating-gis-processes.github.io/site/index.html

关于python - Arcgis 从不规则网格中选择多边形以移除孤立的单元格,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61460077/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com