【问题标题】:storing data for circle drawn on mapview in kml [closed]以kml存储在mapview上绘制的圆的数据[关闭]
【发布时间】:2013-12-09 06:50:06
【问题描述】:

有没有人想将覆盖在地图视图上的圆坐标存储在 kml 文件中

任何帮助都将是可观的

【问题讨论】:

    标签: ios kml geometry


    【解决方案1】:

    1.使用此iOS框架解析/生成KML文件:Simple-KML

    2.计算圆坐标

        NSMutableArray * circleCoordinates = [NSMutableArray array];
        CGPoint centerCoordinate = CGPointMake(37.422f, -122.082f);
        int steps = 1000; // bigger steps, smoother circle you get
        float radius = 10.0;
        for (int i = 0; i < steps; i++) {
            KMLCoordinate *coordinate = [KMLCoordinate new];
            coordinate.latitude = centerCoordinate.x + radius * cos(2 * M_PI * i / steps);
            coordinate.longitude = centerCoordinate.y + radius * sin(2 * M_PI * i / steps);
            [circleCoordinates addObject:coordinate];
        }
    

    3.根据你得到的circleCoordinates生成带有框架的KML文件。

    顺便说一句:您可以使用此web KML Circle Generator 了解圆形 KML 文件的外观

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-12-04
      相关资源
      最近更新 更多