iOS轨迹平滑处理示例
本工程为基于高德地图iOS SDK进行封装,实现了定位轨迹的平滑优化处理。
基于3D地图SDK,对真实轨迹进行处理,实现去噪、平滑和抽稀。
原始轨迹和处理后轨迹
- pod install
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)
...
}