如何确定当前位置是否在KML定义的区域内?

Des*_*ond 2 iphone core-location ios

我有一些KML数据定义了地图上的区域,如下所示:

131.0764742247829,-15.80786022929951,0 132.6357700620065,-16.54895727734661,0
134.1119108999971,-17.28040233069844,0 135.8545033459996,-18.1298170074137,0 
137.7396886168202,-19.07860187595016,0 140.011948401144,-20.18462043802856,0 
142.3114600417346,-21.19369381963822,0 144.1566045495202,-22.15731684591415,0
Run Code Online (Sandbox Code Playgroud)

带有KML定义区域的地图覆盖在其上

我想在我的iOS应用程序中确定用户的当前位置是否在此定义区域内.我怎样才能做到这一点?

sos*_*orn 6

如果你知道圆的中心和半径,那就很容易了.

CLRegion *circle = [CLRegion initCircularRegionWithCenter:centerCoordinate radius:circleRadius identifier:@"myCircle"];

BOOL doesItContainMyPoint = [circle containsCoordinate:myLocation];
Run Code Online (Sandbox Code Playgroud)

根据修订后的问题更新

我从来没有试过这个,但是你不能用你的点创建一个UIBezierPath(你不必实际绘制bezier路径)然后使用UIBezierPath - (BOOL)containsPoint:(CGPoint)point来测试包含?