PHPackages                             ayeo/geo - 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. ayeo/geo

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

ayeo/geo
========

Calculate distance between two coordinates

1.0.0(11y ago)445.4k↓55%1MITPHPPHP &gt;=5.4

Since Apr 25Pushed 11y ago4 watchersCompare

[ Source](https://github.com/ayeo/geo)[ Packagist](https://packagist.org/packages/ayeo/geo)[ RSS](/packages/ayeo-geo/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (1)Versions (4)Used By (1)

[![Build Status](https://camo.githubusercontent.com/49a8b57200bbe7ff953390e5c14c79f1b6978cd186b5de6289ebcd0d49bf8db9/68747470733a2f2f7472617669732d63692e6f72672f6179656f2f67656f2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/ayeo/geo)

Geo Distance
============

[](#geo-distance)

Simply way to calculate distance between two geo coordinates. There is [Vincenty's formula](http://en.wikipedia.org/wiki/Vincenty%27s_formula) used to do the calculations.

Install by Composer
===================

[](#install-by-composer)

```
require: "ayeo/geo": "1.0.*"

```

Example use
===========

[](#example-use)

```
use Ayeo\Geo\Coordinate;
use Ayeo\Geo\DistanceCalculator;

//London: 51°30′N 0°07′W
$london = new Coordinate\Degree();
$london->setLatitude(51, 30, 00, 'N');
$london->setLongitude(00, 07, 00, 'W');

//Buenos Aires: 34°35′S 58°55′W
$buenosAires = new Coordinate\Degree();
$buenosAires->setLatitude(34, 35, 00, 'S');
$buenosAires->setLongitude(58, 55, 00, 'W');

$calculator = new DistanceCalculator();
$calculator->getDistance($london, $buenosAires); //result in meters
```

You can also use decimal coordinates

```
$example = new Coordinate\Decimal(53.2311, 18.1222);
```

DistanceCalculator allows to set radius, precision and multiplier. Default radius is set to Earth.

```
$calculator = new DistanceCalculator();

$calculator->setMultiplier(1); //default value, returns distance in meters
$calculator->setMultiplier(1/1000); //kilometers
$calculator->setMultiplier(1/1000000); //thousands of kilometers

$calculator->setRadius(1737100); //Moon radius :)

$calculator->setPrecision(0); //returns integers
```

###  Health Score

34

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity32

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity60

Established project with proven stability

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.

###  Release Activity

Cadence

Every ~0 days

Total

3

Last Release

4088d ago

Major Versions

0.0.0 → 1.0.02015-04-25

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/60191?v=4)[ayeo](/maintainers/ayeo)[@ayeo](https://github.com/ayeo)

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/ayeo-geo/health.svg)

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

###  Alternatives

[flexihash/flexihash

Flexihash is a small PHP library which implements consistent hashing

367725.2k5](/packages/flexihash-flexihash)[jbzoo/data

An extended version of the ArrayObject object for working with system settings or just for working with data arrays

851.6M23](/packages/jbzoo-data)[atrox/haikunator

Generate Heroku-like random names to use in your php applications.

112266.1k](/packages/atrox-haikunator)[yoast/yoast-seo-for-neos

Yoast SEO for Neos CMS

24172.2k](/packages/yoast-yoast-seo-for-neos)[matthiasnoback/php-parser-instantiation-printer

14163.5k](/packages/matthiasnoback-php-parser-instantiation-printer)

PHPackages © 2026

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