PHPackages                             markbaker/phpgeodetic - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. markbaker/phpgeodetic

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

markbaker/phpgeodetic
=====================

Geodetic library

2013.0k5PHP

Since Feb 22Pushed 11y ago2 watchersCompare

[ Source](https://github.com/MarkBaker/PHPGeodetic)[ Packagist](https://packagist.org/packages/markbaker/phpgeodetic)[ RSS](/packages/markbaker-phpgeodetic/feed)WikiDiscussions develop Synced 1mo ago

READMEChangelogDependenciesVersions (2)Used By (0)

PHPGeodetic - Geodetic library for PHP
======================================

[](#phpgeodetic---geodetic-library-for-php)

PHPGeodetic is a library written in PHP, providing a set of classes for the handling Geodetic of Latitude/Longitude and ECEF coordinates, and conversions between datums

This library provides methods for:

- Conversion of angles (bearings, latitudes and longitudes) between degrees, radians, minutes, seconds and gradians.
- Conversion of distance between metres and kilometres, miles, nautical miles, yards, feet, inches and astronomical units.
- Conversion of areas between square metres, kilometres, hectares, square miles, square yards, acres, etc.
- Calculation of Reference Ellipsoid derived properties such as eccentricity; mean, authalic and volumetric radii; and radius of curvature in the prime vertical and the meridian
- Conversion of positions between Latitude/Longitude and ECEF (Earth-Centred, Earth Fixed); and vice versa.
- Conversion of positions between Latitude/Longitude and UTM (Universal Transverse Mercator); and vice versa.
- Helmert Translations for conversion between datums.
- Great Circle distance calculations using either the Haversine or Vincenty formulae.
- Calculation of Initial and final bearings, and midpoint value for great circle routes.
- Calculation of destinations from a start point, initial bearing and distance.
- Calculation of perimeter, area and centrepoint for regions on an ellipsoid

Requirements
------------

[](#requirements)

- PHP version 5.3.0 or higher

Installation
------------

[](#installation)

We recommend installing this package with [Composer](https://getcomposer.org/ "Get Composer").

### Via composer

[](#via-composer)

In your project root folder, execute

```
composer require markbaker/phpgeodetic:dev-master

```

You should now have the files `composer.json` and `composer.lock` as well as the directory `vendor` in your project directory.

You can then require the Composer autoloader from your code

```
require 'vendor/autoload.php';

```

Or, if you already have a composer.json file, then require this package in that file

```
"require": {
    "markbaker/phpgeodetic": "dev-master"
}

```

and update composer.

```
composer update

```

### From Phar

[](#from-phar)

Although we strongly recommend using Composer, we also provide a [Phar archive](http://php.net/manual/en/book.phar.php "Read about Phar") builder that will create a Phar file containing all of the library code.

The phar builder script is in the repository root folder, and can be run using

```
php buildPhar.php

```

To use the archive, just require it from your script:

```
require 'Geodetic.phar';

```

### Standard Autoloader

[](#standard-autoloader)

If you want to run the code without using composer's autoloader, and don't want to build the phar, then required the `bootstrap.php` file from the repository in your code, and this will enable the autoloader for the library.

```
require 'bootstrap.php';

```

Want to contribute?
-------------------

[](#want-to-contribute)

Fork this library!

License
-------

[](#license)

PHPGeodetic is licensed under [LGPL (GNU LESSER GENERAL PUBLIC LICENSE)](https://github.com/MarkBaker/PHPGeodetic/blob/master/LICENSE.md)

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity31

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/2b8457fa3227a7e8e38f0121f1fe254ec965133df93ae5ea8352c757adb98283?d=identicon)[PHPOffice](/maintainers/PHPOffice)

---

Top Contributors

[![lopsided](https://avatars.githubusercontent.com/u/1258160?v=4)](https://github.com/lopsided "lopsided (1 commits)")

### Embed Badge

![Health badge](/badges/markbaker-phpgeodetic/health.svg)

```
[![Health](https://phpackages.com/badges/markbaker-phpgeodetic/health.svg)](https://phpackages.com/packages/markbaker-phpgeodetic)
```

###  Alternatives

[gajus/dindent

HTML indentation library for development and testing.

1781.9M50](/packages/gajus-dindent)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
