PHP Classes

Geodesy PHP: Get distance between places with their coordinates

Recommend this page to a friend!
     
  Info   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not yet rated by the usersTotal: 254 All time: 7,873 This week: 455Up
Version License PHP version Categories
geodesy-php 1.0.0MIT/X Consortium ...7Algorithms, PHP 5, Geography
Description 

Author

This package can get the distance between places with their coordinates.

It takes the latitude and longitude of two points on the planet Earth and calculates the distance between them going in a straight line.

The package can also converts values between units of length, between Geographical position to Cartesian, and between different Reference Datums.

Picture of Jericko Tejido
  Performance   Level  
Innovation award
Innovation award
Nominee: 1x

Winner: 1x

 

Details

Earth

Geodesy-PHP

Geodesy-PHP is a port of some known geodesic/math functions for getting distance from a known point A to a known point B given their coordinates (good for working out distances between different latitude/longitude data provided by Google Geolocation or any RESTful APIs).

It also supports conversion between units of length, Polar position to Cartesian coordinates, and different Reference Datums.

It provides distance calculations by:

Great-circle distance

  1. Spherical Law of Cosines
  2. Haversine Formula

Ellipsoid Geodesics

  1. Vincenty's Formula
  2. Hubeny's Formula
  3. Thomas' Formula
  4. Andoyer-Lambert Formula
  5. Elliptic Distance
  6. Forsythe-Andoyer-Lambert Formula

Unit Conversion

All operations are set in Metre. But it can also convert distance (and other transformation) values to:

  1. Kilometre
  2. Mile
  3. Nautical Mile
  4. Astronomical Unit

Position Conversion

It also allows coordinate/geographical conversions between the ff:

  1. Polar to Cartesian
  2. Cartesian to Polar
  3. Polar to Web Mercator
  4. Web Mercator to Polar

Transformation Options

Reference Datums are, by default, set to WGS84. You can also transform one coordinate taken from a different source to another (see this for reference), as it also comes with some pre-built datums (though very limited in number as it has little use for me aside from WGS84, i.e. at the time of writing this).

The following are the transformer options:

  1. 3-Parameter Molodensky Transformer
  2. 7-Parameter Helmert Transformer
  3. 10-Parameter Molodensky-Badekas Transformer

Documentation

You can read about it here


  Files folder image Files (66)  
File Role Description
Files folder imagesrc (1 directory)
Files folder imagetests (2 files, 1 directory)
Accessible without login Plain text file autoload.php Aux. Auxiliary script
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file LICENSE Lic. License text
Accessible without login Plain text file README.md Doc. Documentation

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 100%
Total:254
This week:0
All time:7,873
This week:455Up