GithubHelp home page GithubHelp logo

jsooriah / corelocationutils-1 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from 100grams/corelocationutils

0.0 1.0 0.0 125 KB

iOS CoreLocation extensions, simulator and tools

Objective-C 99.25% C 0.75%

corelocationutils-1's Introduction

Core Location Utilities#

An Objective-C library with tools and extensions for iOS CoreLocation.

Update: added support for iOS5 SDK and ARC compatibility

Features

  • Dispatching CoreLocation updates to multiple listeners.
  • Archive/Unarchive location data (play log file)
  • Calculate Direction and distance between locations and routes.
  • Dead Reckoning

Classes

CLLocationDispatch

This is a central dispatch for distributing location updates to the app. Dispatched locations include:

  • CoreLocation updates (location and heading)
  • Location data read from an archive (playing a log file)
  • Location data received from dead-reckoning service.

Locations are dispatched to any listener which registers itself with addListener. In order to receive the update, the listener must respond to CLLocationManagerDelegate protocol methods.

Serializing location data
In addition, CLLocationDispatch provides an API for archiving and unarchiving CLLocation data to a file. This way you can record GPS traces and play them over (e.g. for debugging, or as a "route demo"). To start reading locations from an archive call startDemoWithLogFile:startLocationIndex: method.

You can extend CLLocationDispatch to read location data from other file formats, (e.g. KML, NMEA) by providing a class which adheres to HGRouteProvider protocol.

Support for Dead-Reckoning
I've recently extended CLLocationDispatch to dispatch "soft-locations", i.e. locations generated by a dead-reckoning engine. For more info see CLLocationDeadReckoning below.

CLLocation(measuring)

An extension of CLLocation which provides distance and direction calculations between locations and stretches (lines), defining a bounding box from a center coordinate and radius, and validating coordinate values.

CLLocation(routeInfo)

An extension of CLLocation which provides an API to map-match a location on a given route. A route being NSArray of CLLocation objects.


- (CLLocationDistance) distanceFromRoute : (NSArray*) locations 
					    nearestNodeFound : (CLLocation**)nearestRouteNode 
				  nearestLocationOnRoute : (CLLocation**) nearestLocation 
			  nodeIndexAfterIntersection : (NSInteger*)nodeIndexAfter;

CLLocationDeadReckoning

Dead Reckoning generates location updates at fixed time intervals, defined by kDeadReckiningInterval. Since DR estimates a location based on previous locations, it may result in cumulative errors. CLLocationDeadReckoning therefore constrains DR to a given route, i.e. an NSArray containing CLLocation objects.

  • To start CLLocationDeadReckoning, call startWithRoute:. You must provide a route for the DR to stick to.

  • After CLLocationDeadReckoning starts, it listens to CoreLocation updates and generates new DR locations after no location updates are received from CoreLocation for a predefined time interval, defined by kDeadReckoningInterval.

  • You register for DR location updates by calling the addListener method of CLLocationDispatch. You must also respond to the CLLocationDeadReckoningHandler protocol messages, which will be sent to your listener by CLLocationDispatch.

How to use

  1. Clone this repo
  2. Add CoreLocationUtils folder to your project.
  3. Link with CoreLocation framework.

License

CoreLocationUtils library is released under MIT License.

Please contribute your improvements and suggestions, and raise issues if you spot them.

Thanks!

endorse

corelocationutils-1's People

Contributors

rubnov avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.