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

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

juliangut/gps
=============

GPS coordinates manipulation

0.1(11y ago)0361BSD-3-ClausePHPPHP &gt;=5.3.3

Since Mar 28Pushed 11y ago1 watchersCompare

[ Source](https://github.com/juliangut/gps)[ Packagist](https://packagist.org/packages/juliangut/gps)[ Docs](http://github.com/juliangut/gps)[ RSS](/packages/juliangut-gps/feed)WikiDiscussions master Synced 1mo ago

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

[![Build Status](https://camo.githubusercontent.com/ebd0361e94301c198830268b1d13b341d8e982561281e0825997a2b7a68adb2b/68747470733a2f2f7472617669732d63692e6f72672f6a756c69616e6775742f6770732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/juliangut/gps)[![Code Climate](https://camo.githubusercontent.com/60f2295ca439ef7ec4838c03571178470df5e5129b19c21b2779994b5d09e482/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f6a756c69616e6775742f6770732f6261646765732f6770612e737667)](https://codeclimate.com/github/juliangut/gps)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/38f996502574ff83516bffc12d4e784bbc09f8b98229149364c000efb0da3809/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6a756c69616e6775742f6770732f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/juliangut/gps/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/d60ec992ad2f80e2a376ab6aeb3a7318c4537f9d4b9ff47efc0732da6bdc2d32/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6a756c69616e6775742f6770732f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/juliangut/gps/?branch=master)[![Latest Stable Version](https://camo.githubusercontent.com/f500478a5cf4ed5a1dada60f5af735802c76f0f0a7568a506af93b534de18fb0/68747470733a2f2f706f7365722e707567782e6f72672f6a756c69616e6775742f6770732f762f737461626c652e737667)](https://packagist.org/packages/juliangut/gps)[![Total Downloads](https://camo.githubusercontent.com/6ae51cb0d5b6e4749be062ad2c2854384ab5216b10d2e0df7873041b7bc7775a/68747470733a2f2f706f7365722e707567782e6f72672f6a756c69616e6775742f6770732f646f776e6c6f6164732e737667)](https://packagist.org/packages/juliangut/gps)

Juliangut GPS coordinates manipulation
======================================

[](#juliangut-gps-coordinates-manipulation)

GPS coordination handler and manipulation library.

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

[](#installation)

Best way to install is using [Composer](https://getcomposer.org/):

```
php composer.phar require juliangut/gps

```

Then require\_once the autoload file:

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

Usage
-----

[](#usage)

```
// Create a point with or without coordinates
$gpsPoint = new Point();
$gpsPoint = new Point('48° 0.858277778N, 2°0.2945 E'); // Eiffel tower

// Set coordinates together
$gpsPoint->set('41.9, 12.5'); // Rome

// Set separated coordinates for Empire State Building
$this->point->setLatitude('40°44′ 54.3″N');
$this->point->setLongitude('73° 59′9″ W');

echo $gpsPoint->get(Point::FORMAT_DD); // Default if none especified
echo $gpsPoint->get(Point::FORMAT_DM);
echo $gpsPoint->get(Point::FORMAT_DMS);
```

### Available formats

[](#available-formats)

Any of the following formats can be used to set and retrieve GPS coordinates:

- Decimal Degrees (DD) `Point::FORMAT_DD`, eg: '41.9,12.5'
- Decimal Minutes (DM) `Point::FORMAT_DM`, eg: '48°0.858277778N 2°0.2945E'
- Degrees Minutes Seconds (DMS) `Point::FORMAT_DMS`, eg: '40°44′54.3″N,73°59′9″W'

### Considerations

[](#considerations)

When setting coordinates spaces and comma are completely optional, there is no difference between , `40° 44′ 54.3″ N, 73° 59′ 9″ W` and `40°44′54.3″N73°59′9″W`

When setting coordinates you can use `′` or `'` for minutes and `″` or `"` for seconds (review raw document to see the difference between them)

When retrieving coordinates won't have any spaces

When retrieving coordinates `'` and `"` will be used for minutes and seconds. Coordinates will be comma separated

Contributing
------------

[](#contributing)

Found a bug or have a feature request? [Please open a new issue](https://github.com/juliangut/gps/issues). Have a look at existing issues before

See file [CONTRIBUTING.md](https://github.com/juliangut/gps/blob/master/CONTRIBUTING.md)

License
-------

[](#license)

### Release under BSD-3-Clause License.

[](#release-under-bsd-3-clause-license)

See file [LICENSE](https://github.com/juliangut/gps/blob/master/LICENSE) included with the source code for a copy of the license terms

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity48

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.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

4070d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4c50421f1ab4148354dc2dd5dcaba168656b17ea913b310d112deb39a6f73ca1?d=identicon)[juliangut](/maintainers/juliangut)

---

Top Contributors

[![juliangut](https://avatars.githubusercontent.com/u/1104131?v=4)](https://github.com/juliangut "juliangut (6 commits)")

---

Tags

gpscoordinates

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

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

```
[![Health](https://phpackages.com/badges/juliangut-gps/health.svg)](https://phpackages.com/packages/juliangut-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)[data-values/geo

Geographical value objects, parsers and formatters

20631.0k18](/packages/data-values-geo)[jeroendesloovere/distance

Get distance between two locations using PHP.

3462.8k](/packages/jeroendesloovere-distance)[vojtech-dobes/nette-forms-gpspicker

Google Maps based picker of coordinates for Nette Framework.

2456.6k](/packages/vojtech-dobes-nette-forms-gpspicker)

PHPackages © 2026

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