【问题标题】:Find Inner most Polygon using actual Area from array of nested Polygon使用嵌套多边形数组中的实际区域查找最内部的多边形
【发布时间】:2016-08-08 10:29:38
【问题描述】:

我有 GMSPath 数组并有坐标。我想找出这个坐标所在的路径。我能够找出该位置所在的总多边形。 (使用https://stackoverflow.com/a/38826411/2225439)到这一步为止一切正常。

当一个关闭的GMSPath 与另一个关闭的GMSPath 重叠并且坐标位于重叠区域时,就会出现实际问题。根据我的要求,我只需要从这两个中得到一个GMSPath,并且面积比另一个小。

请参考图片以获得更好的理解。

【问题讨论】:

    标签: ios google-maps cllocation gmsmapview


    【解决方案1】:

    您可以使用 Google Maps iOS SDK 中的以下方法找出GMSPolygon 的面积,GMSGeometryArea(),它提供给定多边形的面积。现在你有了面积,所以你可以比较不同的多边形并找到最里面的面积。

    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 GMSGeometryArea(GMSPath *path); 计算的度量单位的信息。
    • 结果以平方米为单位。
    猜你喜欢
    • 2015-09-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-05-13
    • 2018-02-12
    相关资源
    最近更新 更多