Ios 使用嵌套多边形数组中的实际面积查找最里面的多边形
我有Ios 使用嵌套多边形数组中的实际面积查找最里面的多边形,ios,google-maps,cllocation,gmsmapview,Ios,Google Maps,Cllocation,Gmsmapview,我有GMSPath的数组和坐标。我想找出这个坐标的路径。我能够找出这个位置所在的多边形总数。(使用此项)到这一步为止,一切正常 当一个关闭的GMSPath与另一个关闭的GMSPath重叠,并且坐标位于重叠区域时,就会出现实际问题。根据我的要求,我只需要从这两个中取出一个GMSPath,并且面积比另一个小 请参考图片以便更好地理解。 您可以使用Google Maps iOS SDK中的以下方法找到GMSPolygon的面积,gmsgeometryrea(),它提供了给定多边形的面积。现在您有了面积
GMSPath的数组
和坐标。我想找出这个坐标的路径。我能够找出这个位置所在的多边形总数。(使用此项)到这一步为止,一切正常
当一个关闭的GMSPath
与另一个关闭的GMSPath
重叠,并且坐标位于重叠区域时,就会出现实际问题。根据我的要求,我只需要从这两个中取出一个GMSPath
,并且面积比另一个小
请参考图片以便更好地理解。
您可以使用Google Maps iOS SDK中的以下方法找到
GMSPolygon
的面积,gmsgeometryrea()
,它提供了给定多边形的面积。现在您有了面积,所以您可以比较不同的多边形并找到最里面的区域
double GMSGeometryArea(GMSPath *path);
根据谷歌提供的描述
Returns the area of a geodesic polygon defined by |path| on Earth.
The "inside" of the polygon is defined as not containing the South pole.
If |path| is not closed, it is implicitly treated as a closed path nevertheless and the result is the same.
All coordinates of the path must be valid.
If any segment of the path is a pair of antipodal points, the result is undefined -- because two antipodal points do not form a unique great circle segment on the sphere.
The polygon must be simple (not self-overlapping) and may be concave.
这个地区是什么单位?我找不到任何东西来描述什么测量单位
double gmsgeometryrea(GMSPath*path)代码>计算。结果以平方米为单位。