/iOS-path-smooth

iOS轨迹平滑处理示例

Primary LanguageObjective-C

iOS-path-smooth

iOS轨迹平滑处理示例

本工程为基于高德地图iOS SDK进行封装,实现了定位轨迹的平滑优化处理。

前述

功能描述

基于3D地图SDK,对真实轨迹进行处理,实现去噪、平滑和抽稀。

效果展示

Screenshot Screenshot

原始轨迹和处理后轨迹

使用方法

1:配置工程

  • pod install

2:实现方法

Objective-C

- (void)initSmoothedTrace {
    MASmoothPathTool *tool = [[MASmoothPathTool alloc] init];
    tool.intensity = 3;
    tool.threshHold = 0.3;
    tool.noiseThreshhold = 10;
    self.smoothedTracePoints = [tool pathOptimize:self.origTracePoints];
    
    ...
}

swift

func initSmoothedTrace() {

let tool = MASmoothPathTool()
tool.intensity = 3
tool.threshHold = 0.3
tool.noiseThreshhold = 10

self.smoothedTracePoints = tool.pathOptimize(self.origTracePoints)

...
}