Latest 0.0.1
Homepage https://github.com/pablasso/JPGeodesy
License Attribution 3.0
Authors ,

An Objective-C port of the Latitude/longitude spherical geodesy formulae & scripts by Chris Veness. Read more about it here: http://www.movable-type.co.uk/scripts/latlong.html

This is only a partial port. Feel free to fork and add more.

This is a fork of BJ Basañes original SLatLong. I wanted a different coding style, hence, this repo.

Examples

  • Get the distance from one point to another with the earth radius.
JPCoordinate pointA = {37.30, -121.91};
JPCoordinate pointB = {57.30, -120.91};
double distance = [JPGeodesy distanceFromPoint:pointA toPoint:pointB radius:6371];
  • Find the bearing (direction) between two points
JPCoordinate pointA = {37.30, -121.91};
JPCoordinate pointB = {57.30, -120.91};
double bearing = [JPGeodesy bearingFromPoint:pointA toPoint:pointB];
  • Finding the destination point based on a origin, distance, radius (from earth) and bearing (direction).
JPCoordinate pointA = {37.30, -121.91};
JPCoordinate pointB = [JPGeodesy destinationPointFromPoint:pointA withBearing:180.0 distance:1900 radius:6371];
NSLog("latitude:%f longitude:%f", pointB.latitude, pointB.longitude);

Install

You can just drag the source files, but you get extra points for being awesome and using CocoaPods.

License

Attribution 3.0

Latest podspec

{
    "name": "JPGeodesy",
    "version": "0.0.1",
    "summary": "An Objective-C port of the Latitude/longitude spherical geodesy formulae & scripts by Chris Veness.",
    "homepage": "https://github.com/pablasso/JPGeodesy",
    "license": "Attribution 3.0",
    "authors": {
        "BJ Basau00f1es": "[email protected]",
        "Juan Pablo Ortiz Arechiga": "[email protected]"
    },
    "source": {
        "git": "https://github.com/pablasso/JPGeodesy.git",
        "tag": "0.0.1"
    },
    "source_files": "JPGeodesy",
    "requires_arc": false
}

Pin It on Pinterest

Share This