Giter VIP home page Giter VIP logo

greatcircle's Introduction

GreatCircle

GreatCircle is an iOS framework that provides a set of extensions to the CLLocation class.

The Problem

The CLLocation class provides only one method:

- (CLLocationDistance)distanceFromLocation:(const CLLocation *)location

For calculating the distance between two GPS locations. Because of this, iOS developers must "roll their own" to solve more complex GPS location calculation problems.

The Solution

GreatCircle - which is based on the amazing work of Chris Veness, the owner of the Geodesy functions project - provides a comprehensive set of extension methods to the CLLocation class that make working with GPS locations and performing calculations on then simple and easy.

(For a more general introduction, see: Movable Type Scripts Latitude / Longitude Calculations Reference)

Status

Thus far, I have worked on porting the spherical-earth model, which provides simple formulae covering the accuracy requirements of most use cases.

Quick Links

Getting Started

GreatCircle should be used via Carthage dependency manager. (Why no Cocoapod? I've switched my work to Carthage. Here's why.)

Add GreatCircle to your Cartfile

github "softwarenerd/GreatCircle" "master"

(Until GreatCircle is released, there are no tagged versions, so please use the master branch.)

Update Carthage

carthage update

Add GreatCircle.framework to Linked Frameworks and Libraries

Add Framework

Add Copy Frameworks Run Script

Add a run script that uses the carthage copy-frameworks command to copy the GreatCircle.framework

Run Script

Documentation

Extension Methods

-crossTrackDistanceToStartLocation:endLocation:
Returns the cross track distance (in meters) of this location relative to the specified start location and end location.

-crossTrackLocationToStartLocation:endLocation:
Returns a location representing the cross track point of this location relative to the specified start location and end location.

CrossTrackMethods

-distanceToOtherLocation:
Returns the distance (in meters) between this location and the other location.

DistanceMethod

-finalBearingToOtherLocation:
Returns the final bearing (in degrees) between this location and the other location. The final bearing is the initial bearing from the other location to this location reversed 180°. The final bearing will differ from the initial bearing by varying degrees according to distance and latitude.

-initialBearingToOtherLocation:
Returns the initial bearing (in degrees) between this location and the other location.

+intersectionOfLocation:andBearing:withLocation:andBearing:
Returns a location representing the point of intersection of two paths, each specified by a location and bearing. Returns nil if the two paths do not cross.

Intersection

-isEqualToOtherLocation:
Compares this location to the other location for equality.

-locationWithBearing:distance:
Returns a location representing the point that lies at the specified bearing and distance from this location.

BearingDistance

-midpointToOtherLocation:
Returns a location representing the midpoint between this location and the other location.

Midpoint

Contributing

GreatCircle is a work in progress and your contributions are most welcome. Feel free to fork the repo and submit PR's.

License

GreatCircle is released under the MIT License.

greatcircle's People

Contributors

softwarenerd avatar

Watchers

James Cloos 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.