PHPackages                             1001pharmacies/geolocation-bundle - 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. 1001pharmacies/geolocation-bundle

ActiveSymfony-bundle[API Development](/categories/api)

1001pharmacies/geolocation-bundle
=================================

Provides an abstraction layer for geocoding services.

v1.1.1(8y ago)116.8k4[2 issues](https://github.com/1001Pharmacies/geolocation-bundle/issues)MITPHPPHP &gt;=5.5

Since Dec 11Pushed 7y ago14 watchersCompare

[ Source](https://github.com/1001Pharmacies/geolocation-bundle)[ Packagist](https://packagist.org/packages/1001pharmacies/geolocation-bundle)[ RSS](/packages/1001pharmacies-geolocation-bundle/feed)WikiDiscussions master Synced today

READMEChangelog (5)Dependencies (7)Versions (10)Used By (0)

GeoLocation Bundle
==================

[](#geolocation-bundle)

[![Build Status](https://camo.githubusercontent.com/7166928676fe3808eb86a5723349e79e52a5df95bfb44b1e9f0ccecfef60f3d3/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f31303031506861726d61636965732f67656f6c6f636174696f6e2d62756e646c652e7376673f6272616e63683d6d6173746572)](http://travis-ci.org/1001Pharmacies/geolocation-bundle) [![Total Downloads](https://camo.githubusercontent.com/2639796ed243bd2246d44ac1228de18d7c808397f849c011425ea119b17ead7e/68747470733a2f2f706f7365722e707567782e6f72672f31303031506861726d61636965732f67656f6c6f636174696f6e2d62756e646c652f646f776e6c6f6164732e706e67)](https://packagist.org/packages/1001Pharmacies/geolocation-bundle) [![Latest Stable Version](https://camo.githubusercontent.com/b3cb65a0d237a6b82a167eba903ec1766186243d2365a6d5e741e5e694a7a01a/68747470733a2f2f706f7365722e707567782e6f72672f31303031506861726d61636965732f67656f6c6f636174696f6e2d62756e646c652f762f737461626c652e706e67)](https://packagist.org/packages/1001Pharmacies/geolocation-bundle)

Provides an abstraction layer for geocoding services. This bundle can be also used to split geocoding's calculation between a set of external geocoding service.

### Supported providers

[](#supported-providers)

The following services are included to this bundle :

- [Google](Resources/doc/provider/google.md)
- [Bing](Resources/doc/provider/bing.md)
- [Nominatim](Resources/doc/provider/nominatim.md)
- [MapQuest](Resources/doc/provider/mapquest.md)
- [Yandex](Resources/doc/provider/yandex.md)
- [Here.com](Resources/doc/provider/heredotcom.md)

The the complete documentation to [add you own provider](Resources/doc/custom-provider.md).

Example
-------

[](#example)

### Spatial coordinates and postal address correspondence

[](#spatial-coordinates-and-postal-address-correspondence)

#### Coordinates by Address

[](#coordinates-by-address)

```
$address = $container
    ->get('meup_geo_location.address_factory')
    ->create()
    ->setFullAddress('360 rue du thor, 34000 Montpellier')
;

$coordinates = $container
    ->get('meup_geo_location.locator')
    ->locate($address)
;

printf(
    "%s,%s\n",
    $coordinates->getLatitude(),
    $coordinates->getLongitude()
);
// output : 43.6190815,3.9162419
```

The `geolocation-bundle` only provides library ands services. But you can easily [integrate it in your applications](Resources/doc/example.md).

#### Address by Coordinates

[](#address-by-coordinates)

```
$coordinates = $container
    ->get('meup_geo_location.coordinates_factory')
    ->create()
    ->setLatitude(43.6190815)
    ->setLongitude(3.9162419)
;

$address = $container
    ->get('meup_geo_location.locator')
    ->locate($coordinates)
;

print $address->getFullAddress();
// output : 640 Rue du Mas de Verchant, 34000 Montpellier
```

### Distance calculation

[](#distance-calculation)

When you found two location's coordinates you can also calculate their distance with the distance calculator.

```
$factory = $container
    ->get('meup_geo_location.coordinates_factory')
;

$paris = $factory
    ->create()
    ->setLatitude(48.856667)
    ->setLongitude(2.350987)
;
$lyon = $factory
    ->create()
    ->setLatitude(45.767299)
    ->setLongitude(4.834329)
;

$distance_paris_lyon = $container
    ->get('meup_geo_location.distance_calculator')
    ->getDistance($paris, $lyon)
;

printf('%d km', $distance_paris_lyon); # 391.613 km
```

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

[](#installation)

Install the package with [Composer](http://getcomposer.org/) :

```
composer require 1001pharmacies/geolocation-bundle
```

Or update the `composer.json` file :

```
"require": {
    "1001pharmacies/geolocation-bundle": "~1.0"
}
```

Update `app/AppKernel.php` :

```
$bundles = array(
    // ...
    new Meup\Bundle\GeoLocationBundle\MeupGeoLocationBundle(),
);
```

Setup your `app/config/parameters.yml` with your api keys :

```
parameters:
    # ...
    geo_location_google_api_key:     your_google_api_key
    geo_location_bing_api_key:       your_bing_api_key
    geo_location_nominatim_api_key:  null
    geo_location_mapquest_api_key:   your_mapquest_api_key
    geo_location_yandex_api_key:     null
    geo_location_heredotcom_api_key: your_heredotcom_api_key
```

See detailed [Google](Resources/doc/provider/google.md#create-an-api-key) and [Bing](Resources/doc/provider/bing.md#create-an-api-key) documentation to know how to retrieve api keys.

### Customization

[](#customization)

- [Model](Resources/doc/custom-model.md)
- [Hydratation](Resources/doc/custom-hydrator.md)
- [Provider](Resources/doc/custom-provider.md)
- [Provider balancer](Resources/doc/custom-balancer.md)
- [Configuration](Resources/doc/configuration.md)

###  Health Score

34

—

LowBetter than 75% of packages

Maintenance16

Infrequent updates — may be unmaintained

Popularity27

Limited adoption so far

Community21

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 61.5% 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 ~132 days

Recently: every ~262 days

Total

9

Last Release

3164d ago

PHP version history (2 changes)v1.0.0PHP &gt;=5.3.3

v1.1.0PHP &gt;=5.5

### Community

Maintainers

![](https://www.gravatar.com/avatar/fa285508dbed9fe5ac5f11db23d190a9ba47c4bf7d83331d9d7b4a528532906a?d=identicon)[1001pharmadev](/maintainers/1001pharmadev)

![](https://www.gravatar.com/avatar/16cd172214ea1f735d548d40077d69f32a3507005bb05aa3cae78e9dd440a6c4?d=identicon)[crazyball](/maintainers/crazyball)

---

Top Contributors

[![methylbro](https://avatars.githubusercontent.com/u/344994?v=4)](https://github.com/methylbro "methylbro (72 commits)")[![crazyball](https://avatars.githubusercontent.com/u/623778?v=4)](https://github.com/crazyball "crazyball (17 commits)")[![kmonmousseau](https://avatars.githubusercontent.com/u/6058090?v=4)](https://github.com/kmonmousseau "kmonmousseau (9 commits)")[![GCalmels](https://avatars.githubusercontent.com/u/5655839?v=4)](https://github.com/GCalmels "GCalmels (8 commits)")[![gbprod](https://avatars.githubusercontent.com/u/3751019?v=4)](https://github.com/gbprod "gbprod (6 commits)")[![yemM](https://avatars.githubusercontent.com/u/1481210?v=4)](https://github.com/yemM "yemM (2 commits)")[![m-naw](https://avatars.githubusercontent.com/u/1231338?v=4)](https://github.com/m-naw "m-naw (2 commits)")[![aya](https://avatars.githubusercontent.com/u/155455?v=4)](https://github.com/aya "aya (1 commits)")

---

Tags

geocodingaddressgeolocationlatitudelongitudegoogle mapsgpscoordinatesmicrosoft bingNokia Here

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/1001pharmacies-geolocation-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/1001pharmacies-geolocation-bundle/health.svg)](https://phpackages.com/packages/1001pharmacies-geolocation-bundle)
```

###  Alternatives

[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3741.3M46](/packages/tencentcloud-tencentcloud-sdk-php)[jcf/geocode

Google Geocoding API for Laravel

50162.8k](/packages/jcf-geocode)[files.com/files-php-sdk

Files.com PHP SDK

2481.1k](/packages/filescom-files-php-sdk)[jackmartin/laravel-yandex-geocode

Simply service laravel Yandex Geocoding

1117.6k](/packages/jackmartin-laravel-yandex-geocode)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

252.5k](/packages/eslazarev-wildberries-sdk)

PHPackages © 2026

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