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)444.2k↓43.8%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 1mo ago

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 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity31

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

4041d ago

Major Versions

0.0.0 → 1.0.02015-04-25

### Community

Maintainers

![](https://www.gravatar.com/avatar/9e19f24a709e451d9017d8748a8f42a03a3974a9ab065aeda950ec96b229d7f4?d=identicon)[ayeo](/maintainers/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

[vinicius73/seotools

A package containing SEO helpers.

245.2k](/packages/vinicius73-seotools)

PHPackages © 2026

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