PHP Classes
elePHPant
Icontem

Geodesy PHP: Get distance between places with their coordinates

Recommend this page to a friend!
  Info   View files View files (66)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog (1)    
Last Updated Ratings Unique User Downloads Download Rankings
2018-05-01 (1 year ago) RSS 2.0 feedNot yet rated by the usersTotal: 193 This week: 8All time: 8,293 This week: 36Up
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.

  Performance   Level  
Name: Jericko Tejido <contact>
Classes: 2 packages by
Country: Philippines Philippines
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  
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

  Files folder image Files  /  src  
File Role Description
Files folder imageGeodesy (7 directories)

  Files folder image Files  /  src  /  Geodesy  
File Role Description
Files folder imageConversion (6 files)
Files folder imageDatum (15 files)
Files folder imageDistance (10 files)
Files folder imageLocation (3 files)
Files folder imageModels (12 files)
Files folder imageTransformer (5 files)
Files folder imageUnit (7 files)

  Files folder image Files  /  src  /  Geodesy  /  Conversion  
File Role Description
  Plain text file BaseConversion.php Class Class source
  Plain text file ConversionInterface.php Class Class source
  Plain text file ECEF2LLA.php Class Class source
  Plain text file LLA2ECEF.php Class Class source
  Plain text file LLA2WebMercator.php Class Class source
  Plain text file WebMercator2LLA.php Class Class source

  Files folder image Files  /  src  /  Geodesy  /  Datum  
File Role Description
  Plain text file BaseDatum.php Class Class source
  Plain text file DatumInterface.php Class Class source
  Plain text file ED50.php Class Class source
  Plain text file Irl1975.php Class Class source
  Plain text file LuzonA.php Class Class source
  Plain text file LuzonB.php Class Class source
  Plain text file NAD27.php Class Class source
  Plain text file NAD83.php Class Class source
  Plain text file NTF.php Class Class source
  Plain text file OSGB36.php Class Class source
  Plain text file Potsdam.php Class Class source
  Plain text file PRS92.php Class Class source
  Plain text file TokyoJapan.php Class Class source
  Plain text file WGS72.php Class Class source
  Plain text file WGS84.php Class Class source

  Files folder image Files  /  src  /  Geodesy  /  Distance  
File Role Description
  Plain text file AndoyerLambert.php Class Class source
  Plain text file BaseDistance.php Class Class source
  Plain text file DistanceInterface.php Class Class source
  Plain text file EllipticDistance.php Class Class source
  Plain text file ForsytheCorrection.php Class Class source
  Plain text file HaversineFormula.php Class Class source
  Plain text file HubenyFormula.php Class Class source
  Plain text file SphericalCosine.php Class Class source
  Plain text file ThomasFormula.php Class Class source
  Plain text file VincentyFormula.php Class Class source

  Files folder image Files  /  src  /  Geodesy  /  Location  
File Role Description
  Plain text file ECEF.php Class Class source
  Plain text file LatLong.php Class Class source
  Plain text file WebMercator.php Class Class source

  Files folder image Files  /  src  /  Geodesy  /  Models  
File Role Description
  Plain text file Airy1830.php Class Class source
  Plain text file AiryModified.php Class Class source
  Plain text file BaseModel.php Class Class source
  Plain text file Bessel1841.php Class Class source
  Plain text file Clarke1866.php Class Class source
  Plain text file Clarke1880IGN.php Class Class source
  Plain text file GRS80.php Class Class source
  Plain text file Intl1924.php Class Class source
  Plain text file ModelInterface.php Class Class source
  Plain text file PRS92Model.php Class Class source
  Plain text file WGS72Model.php Class Class source
  Plain text file WGS84Model.php Class Class source

  Files folder image Files  /  src  /  Geodesy  /  Transformer  
File Role Description
  Plain text file BaseTransformer.php Class Class source
  Plain text file HelmertTransform.php Class Class source
  Plain text file MolodenskyBadekasTransform.php Class Class source
  Plain text file MolodenskyTransform.php Class Class source
  Plain text file TransformerInterface.php Class Class source

  Files folder image Files  /  src  /  Geodesy  /  Unit  
File Role Description
  Plain text file AstronomicalUnit.php Class Class source
  Plain text file BaseUnit.php Class Class source
  Plain text file KiloMetre.php Class Class source
  Plain text file Metre.php Class Class source
  Plain text file Mile.php Class Class source
  Plain text file NauticalMile.php Class Class source
  Plain text file UnitInterface.php Class Class source

  Files folder image Files  /  tests  
File Role Description
Files folder imageGeodesy (2 directories)
  Accessible without login Plain text file bootstrap.php Aux. Auxiliary script
  Accessible without login Plain text file phpunit.xml Data Auxiliary data

  Files folder image Files  /  tests  /  Geodesy  
File Role Description
Files folder imageConversion (1 file)
Files folder imageDistance (1 file)

  Files folder image Files  /  tests  /  Geodesy  /  Conversion  
File Role Description
  Plain text file ConversionTest.php Class Class source

  Files folder image Files  /  tests  /  Geodesy  /  Distance  
File Role Description
  Plain text file DistanceTest.php Class Class source

 Version Control Unique User Downloads Download Rankings  
 100%
Total:193
This week:8
All time:8,293
This week:36Up