PHPackages                             jeroen/simple-geocoder - 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. jeroen/simple-geocoder

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

jeroen/simple-geocoder
======================

Simple and minimalistic Geocoder interface with some basic implementations

1.3.1(5y ago)2175.5k↓10.9%[4 PRs](https://github.com/JeroenDeDauw/SimpleGeocoder/pulls)1GPL-2.0-or-laterPHPPHP &gt;=7.0

Since Nov 22Pushed 1y ago2 watchersCompare

[ Source](https://github.com/JeroenDeDauw/SimpleGeocoder)[ Packagist](https://packagist.org/packages/jeroen/simple-geocoder)[ GitHub Sponsors](https://github.com/JeroenDeDauw)[ Patreon](https://www.patreon.com/jeroendedauw)[ RSS](/packages/jeroen-simple-geocoder/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (12)Versions (10)Used By (1)

Simple Geocoder
===============

[](#simple-geocoder)

[![GitHub Workflow Status](https://camo.githubusercontent.com/499e9bd046591535fb59e8269c8764fafe514c3d596b64811940460141b276ee/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f4a65726f656e4465446175772f53696d706c6547656f636f6465722f63692e796d6c3f6272616e63683d6d6173746572)](https://github.com/JeroenDeDauw/SimpleGeocoder/actions?query=workflow%3ACI)[![Latest Stable Version](https://camo.githubusercontent.com/f441febd59e9b63876901a19f91471222827fca7f096d9307e2cc48bb8d096f3/68747470733a2f2f706f7365722e707567782e6f72672f6a65726f656e2f73696d706c652d67656f636f6465722f76657273696f6e2e706e67)](https://packagist.org/packages/jeroen/simple-geocoder)[![Download count](https://camo.githubusercontent.com/2e20f5f21f102d1ce129c7d6a4e5d91410c3ef50a1ace772d61d632208b4f273/68747470733a2f2f706f7365722e707567782e6f72672f6a65726f656e2f73696d706c652d67656f636f6465722f642f746f74616c2e706e67)](https://packagist.org/packages/jeroen/simple-geocoder)

PHP 7.0+ library providing a simple and minimalistic Geocoder interface with some basic implementations.

```
interface Geocoder {
	/**
	 * Returns null when no result is found or when an error occurs.
	 * @return LatLongValue|null
	 */
	public function geocode( string $address );
}
```

Geocoders using real geocoding services over HTTP:

- `GeoNamesGeocoder`
- `GoogleGeocoder`
- `NomatimGeocoder`

Adapters:

- `GeocoderPhpAdapter` - adapts to the popular PHP [Geocoder library](https://github.com/geocoder-php/Geocoder)

Trivial implementations (great for testing):

- `InMemoryGeocoder`
- `NullGeocoder`
- `StubGeocoder`

Decorators:

- `CoordinateFriendlyGeocoder`

This library is based on code extracted from the [Maps extension for MediaWiki](https://github.com/JeroenDeDauw/Maps).

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

[](#installation)

To use the Simple Geocoder library in your project, simply add a dependency on jeroen/simple-geocoder to your project's `composer.json` file. Here is a minimal example of a `composer.json`file that just defines a dependency on Simple Geocoder 1.x:

```
{
    "require": {
        "jeroen/simple-geocoder": "~1.0"
    }
}
```

Development
-----------

[](#development)

For development you need to have Docker and Docker-compose installed. Local PHP and Composer are not needed.

```
sudo apt-get install docker docker-compose

```

### Running Composer

[](#running-composer)

To pull in the project dependencies via Composer, run:

```
make composer install

```

You can run other Composer commands via `make run`, but at present this does not support argument flags. If you need to execute such a command, you can do so in this format:

```
docker run --rm --interactive --tty --volume $PWD:/app -w /app\
 --volume ~/.composer:/composer --user $(id -u):$(id -g) composer composer install -vvv

```

### Running the CI checks

[](#running-the-ci-checks)

To run all CI checks, which includes PHPUnit tests, PHPCS style checks and coverage tag validation, run:

```
make

```

### Running the tests

[](#running-the-tests)

To run just the PHPUnit tests run

```
make test

```

To run only a subset of PHPUnit tests or otherwise pass flags to PHPUnit, run

```
docker-compose run --rm app ./vendor/bin/phpunit --filter SomeClassNameOrFilter

```

Release notes
-------------

[](#release-notes)

### 1.3.1 (2020-08-19)

[](#131-2020-08-19)

- Updated attribution

### 1.3.0 (2019-01-18)

[](#130-2019-01-18)

- Installation with FileFetcher 6.x is now allowed

### 1.2.0 (2018-07-10)

[](#120-2018-07-10)

- Added `GeocoderPhpAdapter` that allows using the popular PHP [Geocoder library](https://github.com/geocoder-php/Geocoder)
- Installation with DataValues Geo 4.x is now allowed

### 1.1.0 (2018-03-20)

[](#110-2018-03-20)

- Installation with DataValues Geo 3.x is now allowed

### 1.0.0 (2017-11-02)

[](#100-2017-11-02)

Initial release as standalone component with

- FileFetcher based geocoders: `GeoNamesGeocoder`, `GoogleGeocoder`, `NomatimGeocoder`
- Trivial implementations: `InMemoryGeocoder`, `NullGeocoder`, `StubGeocoder`
- Decorators: `CoordinateFriendlyGeocoder`

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance27

Infrequent updates — may be unmaintained

Popularity35

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 84.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 ~250 days

Total

5

Last Release

2098d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/451bd4039d530fed8f9c3da91bfa519233a397d2182cdfdcad700f6cfea19b7f?d=identicon)[Jeroen De Dauw](/maintainers/Jeroen%20De%20Dauw)

---

Top Contributors

[![JeroenDeDauw](https://avatars.githubusercontent.com/u/146040?v=4)](https://github.com/JeroenDeDauw "JeroenDeDauw (43 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (7 commits)")[![kghbln](https://avatars.githubusercontent.com/u/1104078?v=4)](https://github.com/kghbln "kghbln (1 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/jeroen-simple-geocoder/health.svg)

```
[![Health](https://phpackages.com/badges/jeroen-simple-geocoder/health.svg)](https://phpackages.com/packages/jeroen-simple-geocoder)
```

###  Alternatives

[geocoder-php/google-maps-provider

Geocoder GoogleMaps adapter

18517.9M44](/packages/geocoder-php-google-maps-provider)[geocoder-php/plugin

Plugins to Geocoder providers

705.1M2](/packages/geocoder-php-plugin)[mediawiki/maps

Adds various mapping features to MediaWiki

84145.0k3](/packages/mediawiki-maps)[smile/module-store-locator

Smile Store Locator

51516.6k4](/packages/smile-module-store-locator)[mediawiki/chameleon-skin

A highly flexible MediaWiki skin using Bootstrap 4

12481.8k2](/packages/mediawiki-chameleon-skin)[geocoder-php/here-provider

Geocoder here adapter

131.2M3](/packages/geocoder-php-here-provider)

PHPackages © 2026

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