PHPackages                             jeroendesloovere/geolocation-php-api - 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. [API Development](/categories/api)
4. /
5. jeroendesloovere/geolocation-php-api

ActiveLibrary[API Development](/categories/api)

jeroendesloovere/geolocation-php-api
====================================

This Geolocation PHP class connects to Google Maps API to find latitude/longitude or address.

2.1.1(2y ago)75316.8k—6.7%37[1 issues](https://github.com/jeroendesloovere/geolocation-php-api/issues)[2 PRs](https://github.com/jeroendesloovere/geolocation-php-api/pulls)4MITPHPPHP &gt;=7.1

Since Oct 3Pushed 1mo ago8 watchersCompare

[ Source](https://github.com/jeroendesloovere/geolocation-php-api)[ Packagist](https://packagist.org/packages/jeroendesloovere/geolocation-php-api)[ Docs](https://github.com/jeroendesloovere/geolocation-php-api)[ RSS](/packages/jeroendesloovere-geolocation-php-api/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (2)Versions (13)Used By (4)

Geolocation PHP class connects to Google MAPS API
=================================================

[](#geolocation-php-class-connects-to-google-maps-api)

[![Latest Stable Version](https://camo.githubusercontent.com/c937753d4c61e1afac8264c339dd6e2d414f78d818e76281f84979e4a36170b5/687474703a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6a65726f656e6465736c6f6f766572652f67656f6c6f636174696f6e2d7068702d6170692e737667)](https://packagist.org/packages/jeroendesloovere/geolocation-php-api)[![License](https://camo.githubusercontent.com/5a911ddcd16b9110e7821386ffd8d637005a8b856c14a3c0861b955e91da4eba/687474703a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d6c69676874677265792e737667)](https://github.com/jeroendesloovere/geolocation-php-api/blob/master/LICENSE)[![Build Status](https://camo.githubusercontent.com/1b1e19004f2036671bdee6f95fe84c89c01d8767c9594797338e302cad067045/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6a65726f656e6465736c6f6f766572652f67656f6c6f636174696f6e2d7068702d6170692f6261646765732f6275696c642e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/jeroendesloovere/geolocation-php-api/build-status/master)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/f90c89182455d5d073f86b936612308cf23d9ec34c87e8a4ba140eaa15eb92d0/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6a65726f656e6465736c6f6f766572652f67656f6c6f636174696f6e2d7068702d6170692f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/jeroendesloovere/geolocation-php-api/?branch=master)

> This Geolocation PHP class connects to Google Maps API to find latitude/longitude or address.

Installing
----------

[](#installing)

### Using Composer

[](#using-composer)

When using [Composer](https://getcomposer.org) you can always load in the latest version.

```
composer require jeroendesloovere/geolocation-php-api
```

Check [in Packagist](https://packagist.org/packages/jeroendesloovere/geolocation-php-api).

### Usage example

[](#usage-example)

**getCoordinates**

> Get latitude/longitude coordinates from address.

```
$street = 'Koningin Maria Hendrikaplein';
$streetNumber = '1';
$city = 'Gent';
$zip = '1';
$country = 'belgium';

$result = Geolocation::getCoordinates(
    $street,
    $streetNumber,
    $city,
    $zip,
    $country
);
```

**getAddress**

> Get address from latitude/longitude coordinates.

```
$latitude = 51.0363935;
$longitude = 3.7121008;

$result = Geolocation::getAddress(
    $latitude,
    $longitude
);
```

Check [the Geolocation class source](./src/Geolocation.php).

Symfony bundle
--------------

[](#symfony-bundle)

I've also created a Symfony bundle. View the [Geolocation bundle](https://github.com/jeroendesloovere/geolocation-bundle).

Tests
-----

[](#tests)

We have tests to make sure everything works as expected. First execute `composer install`. Then execute `vendor/bin/phpunit tests`.

### Coding Syntax

[](#coding-syntax)

We use [squizlabs/php\_codesniffer](https://packagist.org/packages/squizlabs/php_codesniffer) to maintain the code standards. Type the following to execute them:

```
# To view the code errors
vendor/bin/phpcs --standard=psr2 --extensions=php --warning-severity=0 --report=full "src"

# OR to fix the code errors
vendor/bin/phpcbf --standard=psr2 --extensions=php --warning-severity=0 --report=full "src"
```

> [Read documentation about the code standards](https://github.com/squizlabs/PHP_CodeSniffer/wiki)

Documentation
-------------

[](#documentation)

The class is well documented inline. If you use a decent IDE you'll see that each method is documented with PHPDoc.

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

[](#contributing)

It would be great if you could help us improve this class. GitHub does a great job in managing collaboration by providing different tools, the only thing you need is a [GitHub](http://github.com) login.

- Use **Pull requests** to add or update code
- **Issues** for bug reporting or code discussions
- Or regarding documentation and how-to's, check out **Wiki**More info on how to work with GitHub on help.github.com.

License
-------

[](#license)

The module is licensed under [MIT](./LICENSE). In short, this license allows you to do everything as long as the copyright statement stays present.

###  Health Score

53

—

FairBetter than 97% of packages

Maintenance59

Moderate activity, may be stable

Popularity50

Moderate usage in the ecosystem

Community26

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 96.3% 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

Every ~324 days

Recently: every ~483 days

Total

12

Last Release

1038d ago

Major Versions

1.4.1 → 2.0.02018-03-29

PHP version history (2 changes)1.0.0PHP &gt;=5.3.3

2.0.0PHP &gt;=7.1

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/588616?v=4)[Jeroen Desloovere](/maintainers/jeroendesloovere)[@jeroendesloovere](https://github.com/jeroendesloovere)

---

Top Contributors

[![jeroendesloovere](https://avatars.githubusercontent.com/u/588616?v=4)](https://github.com/jeroendesloovere "jeroendesloovere (77 commits)")[![janverton](https://avatars.githubusercontent.com/u/1068182?v=4)](https://github.com/janverton "janverton (1 commits)")[![runcom](https://avatars.githubusercontent.com/u/849915?v=4)](https://github.com/runcom "runcom (1 commits)")[![voku](https://avatars.githubusercontent.com/u/264695?v=4)](https://github.com/voku "voku (1 commits)")

---

Tags

geocodinggeolocationlatitudelongitudephpphp7phpapigooglegeolocationmaps

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/jeroendesloovere-geolocation-php-api/health.svg)

```
[![Health](https://phpackages.com/badges/jeroendesloovere-geolocation-php-api/health.svg)](https://phpackages.com/packages/jeroendesloovere-geolocation-php-api)
```

###  Alternatives

[gemini-api-php/client

API client for Google's Gemini API

216221.4k5](/packages/gemini-api-php-client)[dantsu/php-osm-static-api

PHP library to easily get static image from OpenStreetMap (OSM), add markers and draw lines.

97141.0k1](/packages/dantsu-php-osm-static-api)[gemini-api-php/laravel

Gemini API client for Laravel

8915.7k](/packages/gemini-api-php-laravel)

PHPackages © 2026

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