PHPackages                             goosfraba/gps - 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. goosfraba/gps

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

goosfraba/gps
=============

A simple wrapper for GPS coordinates

1.0.0(5y ago)022MITPHPPHP &gt;=7.1CI failing

Since Jul 8Pushed 5y ago1 watchersCompare

[ Source](https://github.com/dbojdo/gps)[ Packagist](https://packagist.org/packages/goosfraba/gps)[ RSS](/packages/goosfraba-gps/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependencies (2)Versions (2)Used By (0)

Goosfraba GPS
=============

[](#goosfraba-gps)

A simple wrapper for GPS coordinates. Provides basic functionalities like distance calculation between two givens points, interpolation of the coordinates between two givens points and antipodes calculation. It uses `bcmath` PHP extension for calculation (for eligible calculations only).

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

[](#installation)

Use `composer`

```
composer require goosfraba/gps
```

Usage
-----

[](#usage)

### Coordinates instantiation and basic usage

[](#coordinates-instantiation-and-basic-usage)

```
use Goosfraba\Gps\GpsCoordinates;
$coordinates = GpsCoordinates::createFromDegrees(38.8, -77.1);
// or
$coordinates = GpsCoordinates::createFromRadians(0.677187749773799875846392, -1.3456488532876281038081655);

// accessing coordinates in radians
$latitudeInRadians = $coordinates->latitudeInRadians();
$longitudeInRadians = $coordinates->longitudeInRadians();

// accessing coordinates in degrees
$latitudeInDegrees = $coordinates->latitudeInDegrees();
$longitudeInDegrees = $coordinates->longitudeInDegrees();
```

### Calculating distance between two givens points

[](#calculating-distance-between-two-givens-points)

```
use Goosfraba\Gps\GpsCoordinates;

$coordinate1 = GpsCoordinates::createFromDegrees(51.5, 0);
$coordinate2 = GpsCoordinates::createFromDegrees(38.8, -77.1);

$distanceInMeters = $coordinate1->disntaceTo($coordinate2);
```

### Coordinates interpolation between two givens points at given distance

[](#coordinates-interpolation-between-two-givens-points-at-given-distance)

```
use Goosfraba\Gps\GpsCoordinates;

$coordinate1 = GpsCoordinates::createFromDegrees(51.5, 0);
$coordinate2 = GpsCoordinates::createFromDegrees(38.8, -77.1);

$midPointCoordinates = $coordinate1->pointBetween($coordinate2);
$coordinatesAt10Percent = $coordinate1->pointBetween($coordinate2, $coordinate1->distanceTo($coordinate2) / 10);
```

### Antipodes calculation

[](#antipodes-calculation)

```
use Goosfraba\Gps\GpsCoordinates;

$coordinate = GpsCoordinates::createFromDegrees(51.5, 0);
$antipodes = $coordinate->antipodes();
```

### Tests

[](#tests)

```
./vendor/bin/phpunit
```

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

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

Unknown

Total

1

Last Release

2140d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/a6cc50814a7b150c2a02d719d33c6e11040a6d0d010b2f986a24794edce7f52f?d=identicon)[dbojdo](/maintainers/dbojdo)

---

Tags

calculationdistancegpscoordinates

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/goosfraba-gps/health.svg)

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

###  Alternatives

[mjaschen/phpgeo

Simple Yet Powerful Geo Library

1.6k8.6M22](/packages/mjaschen-phpgeo)[proj4php/proj4php

A PHP-Class for geographic coordinates transformation using proj4 definitions, thanks to a translation from Proj4JS

1321.7M16](/packages/proj4php-proj4php)[ballen/distical

A distance (Lat/Long) calculation library for PHP

40180.2k2](/packages/ballen-distical)[jeroendesloovere/distance

Get distance between two locations using PHP.

3462.8k](/packages/jeroendesloovere-distance)[0x13a/geodistance-php

Calculate geodistance between two points, latitude and longitude

3120.6k](/packages/0x13a-geodistance-php)[oefenweb/damerau-levenshtein

Get text similarity level with Damerau-Levenshtein distance

40265.8k4](/packages/oefenweb-damerau-levenshtein)

PHPackages © 2026

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