PHPackages                             assghard/php-geocoders - 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. assghard/php-geocoders

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

assghard/php-geocoders
======================

Geocoders library for PHP project

0.2.2(3y ago)122MITPHPPHP &gt;=8.0

Since Jul 14Pushed 3y ago1 watchersCompare

[ Source](https://github.com/assghard/php-geocoders)[ Packagist](https://packagist.org/packages/assghard/php-geocoders)[ Docs](https://github.com/assghard/php-geocoders)[ RSS](/packages/assghard-php-geocoders/feed)WikiDiscussions master Synced today

READMEChangelog (4)DependenciesVersions (7)Used By (0)

assghard php-geocoders - The geocoders library for PHP project
==============================================================

[](#assghard-php-geocoders---the-geocoders-library-for-php-project)

Simple PHP library which provides geocoding and reverse geocoding features using different providers such as Nominatim (OpenStreetMap), Google, etc. Get address by coordinates and get coordinates by address

Requirements
------------

[](#requirements)

- PHP &gt;= 8.0
- PHP cURL

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

[](#installation)

Install latest release (for PHP 8+):

`composer require assghard/php-geocoders`

### For older versions of PHP

[](#for-older-versions-of-php)

If you use PHP 7+: `composer require assghard/php-geocoders:dev-php7`

If you use PHP 5.6: `composer require assghard/php-geocoders:dev-php56`

Usage
-----

[](#usage)

### Nominatim geocoder

[](#nominatim-geocoder)

Add `GeocodingService` and `NominatimGeocoderProvider` in uses section

```
use Assghard\PhpGeocoders\GeocodingService;
use Assghard\PhpGeocoders\Providers\NominatimGeocoderProvider;
```

```
$geocoder = new NominatimGeocoderProvider();
$geocodingService = new GeocodingService($geocoder);

// Get coordinates by address
$geocodeData = $geocodingService->geocode($addressAsString);

// Get address by coordinates
$reverseData = $geocodingService->reverse($latitude, $longitude);
```

You can also provide country code/codes to Geocoder provider:

```
$geocoder = new NominatimGeocoderProvider('en');
```

Multiple country codes:

```
$geocoder = new NominatimGeocoderProvider(['en', 'pl']);
```

### Google geocoder

[](#google-geocoder)

```
use Assghard\PhpGeocoders\GeocodingService;
use Assghard\PhpGeocoders\Providers\GoogleGeocoderProvider;
```

...

```
$geocoder = new GoogleGeocoderProvider('GOOGLE_MAPS_API_KEY', 'en');
/**
 * "en" - English language code. See Google documentation: https://developers.google.com/admin-sdk/directory/v1/languages
 *
 * Google Maps javascript API documentation: https://developers.google.com/maps/documentation/javascript/overview
 */
$geocodingService = new GeocodingService($geocoder);
$geocodeData = $geocodingService->geocode($addressAsString); // Get coordinates by address
$reverseData = $geocodingService->reverse($latitude, $longitude); // Get address by coordinates
```

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity47

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

Every ~95 days

Total

4

Last Release

1163d ago

### Community

Maintainers

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

---

Top Contributors

[![assghard](https://avatars.githubusercontent.com/u/11836150?v=4)](https://github.com/assghard "assghard (9 commits)")

---

Tags

phplibrarynominatimassghardgeocoders

### Embed Badge

![Health badge](/badges/assghard-php-geocoders/health.svg)

```
[![Health](https://phpackages.com/badges/assghard-php-geocoders/health.svg)](https://phpackages.com/packages/assghard-php-geocoders)
```

PHPackages © 2026

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