适用于 iOS 的位置、运动和活动记录框架
定位套件
适用于 iOS 的基于机器学习的位置记录和活动检测框架。
位置和运动记录
- 组合、简化的核心位置和核心运动记录
- 经过过滤、平滑和简化的位置和运动数据
- 近乎实时的静止/移动状态检测
- 自动能源使用管理,支持全天记录
- 自动停止和重新启动录制,避免浪费电池使用
活动类型检测
- 基于机器学习的活动类型检测
- 改进了对核心运动活动类型(静止、步行、跑步、骑行、
汽车)的检测 - 区分特定的运输类型(汽车、火车、公共汽车、摩托车、飞机、轮船)
记录高级别访问和路径
- (可选)生成高级和时间线项目,以在人类级别表示录制
会话。与核心位置类似,但具有更高的准确性,
更多的细节,并增加了路径(即访问之间的行程)。Path
Visit
CLVisit
- (可选)将录制的示例和时间线项目保存到基于 SQL 的本地存储中,以便在
会话之间保留。
支持项目
LocoKit 是一个 LGPL 许可的开源项目。它的持续发展得益于
其支持者对 Patreon 的支持。
如果您的应用程序使用 LocoKit 并且是创收产品,请考虑
赞助 LocoKit 开发,以确保您的产品所依赖的项目保持
健康并得到积极维护。
非常感谢您的支持!
安装
Note: Include the optional subspec if you would like to retain your samples
and timeline items in the SQL persistent store.LocoKit/LocalStore
High Level Recording
Record TimelineItems (Paths and Visits)
Low Level Recording
Record LocomotionSamples (CLLocations combined with Core Motion data)
Note: The above settings are all on by default. The above snippets are unnecessary, and just here
to show you some of the available options.
Fetching TimelineItems / Samples
If you wanted to get all timeline items between the start of today and now, you might do this:
You can also construct more complex queries, like for fetching all timeline items that overlap a certain geographic region. Or all samples of a specific activity type (eg all "car" samples). Or all timeline items that contain samples over a certain speed (eg paths containing fast driving).
Detect Activity Types
Note that if you are using a , activity type classifying is already handled
for you by the manager, on both the sample and timeline item levels. You should only need to
directly interact with clasifiers if you are either not using a TimelineManager, or are wanting
to do low level processing at the sample level.TimelineManager
Note: The above code snippets use SwiftNotes to make
the event observing code easier to read. If you're not using SwiftNotes, your observers should be
written something like this:
Background Location Monitoring
If you want the app to be relaunched after the user force quits, enable significant location change monitoring.
More details and requirements here
Examples and Screenshots
Documentation
Try the LocoKit Demo App
- Download or clone this repository
pod install
- In Xcode, change the Demo App project's "Team" to match your Apple Developer Account
- In Xcode, change the Demo App project's "Bundle Identifier" to something unique
- Build and run!
- Go for a walk, cycle, drive, etc, and see the results :)
Try Arc App on the App Store
- To see the SDK in action in a live, production app, install
Arc App
from the App Store, our free life logging app based on LocoKit