Code Monkey home page Code Monkey logo

geodesy's Introduction

Java Geodesy Library for GPS – Vincenty’s Formulae

BitCoin tips graciously accepted at 1FB63FYQMy7hpC2ANVhZ5mSgAZEtY1aVLf

Looking for the C# version of the Geodesy library? Click here.

This will be handy for anyone, particularly Geocachers, interested in developing software for use with a GPS receiver. The library provides two important functions:

  1. Calculate a destination given a starting point, direction, and distance traveled on Earth
  2. Calculate the distance between two points on Earth

The fancy schmancy names for these functions are the “direct geodetic problem” and the “the inverse geodetic problem”.

For a deeper discussion of the source code, I recommend reading my blog entry: Java, GPS Receivers, and Geocaching: Vincenty’s Formula.

This is the Java source code for implementations of Thaddeus Vincenty’s algorithms to solve the direct and inverse geodetic problems.

The inputs for the direct solution are the latitude and longitude of a starting point, a starting bearing, a distance to travel, and a reference model of Earth (several are provided). The outputs are the latitude and longitude of the destination and, optionally, the final bearing at the destination.

The inputs for the inverse solution are the latitude and longitude of two points and a reference model of Earth (several are provided). The outputs are 1) the distance between the points along the curve of Earth, and 2) the direction from the starting point to the ending point.

The primary classes in the library are:

org.gavaghan.geodesy (2-D calculations)

Ellipsoid – an immutable property class representing a model of Earth used for geodetic calculations. Several static instances are included that describe scientifically measured models. WGS84 (the 1984 World Geodetic System) and GRS80 (the 1980 Geodetic Reference System) are the most widely used.

GlobalCoordinates – encapsulates a location on Earth as described by two Angles: latitude and longitude.

GeodeticCurve – the outcome of an inverse geodetic calculation. It represents the path and ellipsoidal distance between two GlobalCoordinates for a specified reference Ellipsoid.

GeodeticCalculator – this is a behavior class that contains the actual implementations of Vincenty’s Formulae.

org.gavaghan.geodesy (3-D calculations)

GlobalPosition – this is similar to GlobalCoordinates, but it also includes a measurement of elevation, in meters, above or below the reference Ellipsoid.

GeodeticMeasurement – this is similar to GeodeticCurve, but it also adds a point-to-point measurement which accounts for a change in elevation between two points in addition to the ellipsoidal distance.

GeodeticCalculator – this is the same behavior class described above. It contains methods for both 2-D and 3-D calculations.

org.gavaghan.geodesy.example

This is an application project that sets up and computes a direct calculation and a 2-D and 3-D inverse calculation. This is a good starting point for figuring out how to use the library.

Maven Dependency

This is available at the Maven Central Repository using this dependency setting:

<dependency>
    <groupId>org.gavaghan</groupId>
    <artifactId>geodesy</artifactId>
    <version>1.1.3</version>
</dependency>

geodesy's People

Contributors

mgavaghan 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.