简体   繁体   English

Python包/函数使用地理坐标获取另一个多边形中一个多边形覆盖的百分比面积

[英]Python package/function to get percentage area covered by one polygon in another polygon using geo coordinates

I am looking for a solution to find the percentage area covered by a polygon inside another polygon, from geo coordinates using python.我正在寻找一种解决方案,以使用 python 从地理坐标中找到另一个多边形内的多边形覆盖的百分比区域。 The polygon can be either fully reside inside the other one or a portion of the second polygon.多边形可以完全位于另一个多边形内,也可以位于第二个多边形的一部分内。 Is there a solution to this.这个问题有方法解决吗。 Please advice.请指教。

Percentage is just area of intersection over area of the (other) polygon: area(intersection)/area(polygon2) .百分比只是(其他)多边形区域的相交面积: area(intersection)/area(polygon2)

Basically any of geometry packages should be able to compute this, as they all support area and intersection functions: I think Geopandas, SymPy, Shapely (and others I missed) should be able to do this.基本上任何几何包都应该能够计算这个,因为它们都支持区域和交叉函数:我认为 Geopandas、SymPy、Shapely(以及我错过的其他人)应该能够做到这一点。 There might be differences in supported formats.支持的格式可能存在差异。

You did not specify what Geo coordinates you use though.您没有指定您使用的地理坐标。 I think Geopandas and SymPy support only 2D maps (flat map) - meaning you need to use appropriate projection to get exact result, and Shapely works with spherical Earth model.我认为 Geopandas 和 SymPy 仅支持 2D 地图(平面地图)——这意味着您需要使用适当的投影来获得准确的结果,而 Shapely 可与球形地球模型一起使用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM