Giter Site home page Giter Site logo

geodesy's Introduction

geodesy

Libraries of geodesy functions implemented in JavaScript – intended to serve as examples or starting-points for people wanting to develop geodesy applications (in JavaScript or other languages), though they can also be used as-is.

latlon.js

This is a library of geodesy functions for working with points and paths on (a spherical model of) the earth’s surface, including (orthodromic) great-circle geodesics and (loxodromic) rhumb lines. All calculations are done using spherical trigonometry.

The library includes the following functions:

  • distanceTo destination point (using haversine formulation)
  • bearingTo destination point
  • finalBearingTo destination point
  • midpointTo destination point
  • destinationPoint following initial bearing for given distance
  • intersection of two paths
  • rhumbDistanceTo destination point
  • rhumbBearingTo destination point
  • rhumbDestinationPoint following given bearing for given distance
  • rhumbMidpointTo destination point

Full details are available at www.movable-type.co.uk/scripts/latlong.html.

latlon-vincenty.js

Vincenty’s formulae for ‘direct and inverse solutions of geodesics on the ellipsoid’; these give distances and bearings on an ellipsoidal earth model accurate to within 0.5mm distance, 0.000015″ bearing.

The library includes the following wrapper functions:

  • distanceTo destination point
  • initialBearingTo destination point
  • finalBearingTo destination point
  • destinationPoint following initial bearing for given distance
  • finalBearingOn initial bearing for given distance

The heaving lifting is done in two routines:

  • direct (implementing the direct solution of geodesics on the ellipsoid)
  • inverse (implementing the inverse solution of geodesics on the ellipsoid)

Full details are available at www.movable-type.co.uk/scripts/latlong-vincenty.html.

latlon-ellipsoid.js

Geodesy tools for an ellipsoidal earth model.

The LatLonE object incorporates not just latitude & longitude coordinates, but also the datum the lat/lon point is defined on.

LatLonE also holds ellipsoid parameters and Helmert transform parameters for translating between different datums (e.g. between OSGB36 & WGS-84).

The convertDatum function performs such translations between datums.

The library includes:

  • ellipsoid parameters
  • datum parameters (reference ellipsoid & Helmert transform parameters)
  • convertDatum: convert lat/lon point to new datum
  • toCartesian: convert lat/lon point to ECEF 3-d vector
  • toLatLon: convert ECEF 3-d vector to lat/lon point

More information at www.movable-type.co.uk/scripts/latlong-convert-coords.html.

latlon-vectors.js

This is a library of functions for working with points and paths on (a spherical model of) the earth’s surface using a vector-based approach using ‘n-vectors’ (rather than the more common spherical trigonometry; a vector-based approach makes most calculations much simpler, and easier to follow, compared with trigonometric equivalents).

The library includes:

  • distanceTo destination point
  • bearingTo destination point
  • midpointTo destination point
  • destinationPoint following initial bearing for given distance
  • intersection of two paths
  • crossTrackDistanceTo great circle path
  • enclosedBy polygon
  • meanOf set of points

More information at www.movable-type.co.uk/scripts/latlong-vectors.html.

osgridref.js

Routines for converting between Ordnance Survey grid references and (OSGB-36) latitude/longitude coordinates, based on Ordnance Survey formulae.

The library includes:

  • latLonToOsGrid: convert (OSGB) latitude/longitude to (numeric) OS grid reference
  • osGridToLatLon: convert (numeric) OS grid reference to (OSGB) latitude/longitude
  • parse standard format grid reference to numeric grid reference
  • toString: convert numeric grid reference to standard format

More information at www.movable-type.co.uk/scripts/latlong-gridref.html.

utm.js, mgrs.js

Routines for converting between UTM (Universal Transverse Mercator) coordinates and latitude/longitude coordinates (WGS84 or any other ellipsoid datum), and between UTM and MGRS (Military Grid Reference System) grid references. Based on Karney 2011 ‘Transverse Mercator with an accuracy of a few nanometers’.

The libraries include:

  • LatLonE.toUtm: convert (WGS84) latitude/longitude to UTM coordinate
  • Utm.toLatLon: convert UTM coordinate to (WGS84) latitude/longitude
  • Utm.toMgrs convert UTM coordinate to MGRS grid reference (including Norway and Svalbard exceptions)
  • Mgrs.toUtm: convert MGRS grid reference to UTM coordinate

More information at www.movable-type.co.uk/scripts/latlong-utm-mgrs.html.

geo.js

Tools for converting between numeric degrees and degrees / minutes / seconds.

The library includes the following functions:

  • parseDMS: parse string representing degrees/minutes/seconds into numeric degrees
  • toLat: convert decimal degrees to latitude
  • toLon: convert decimal degrees to longitude
  • toBrng: convert decimal degrees to bearing

geohash.js

Geohash is now moved to its own repository, as this one is becoming bloated.

Documentation

Documentation for all these methods is available at www.movable-type.co.uk/scripts/js/geodesy/docs.

geodesy's People

Contributors

chrisveness avatar qcz avatar

Watchers

Gilles Danjou avatar 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.