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

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

cartograf/geocoder
==================

Barebones geocoder class using cUrl. Not a replacement for willdurand/geocoder

1.0.2(8y ago)020MITPHPPHP ~5.5|~7.0

Since Sep 11Pushed 8y ago1 watchersCompare

[ Source](https://github.com/timstallmann/cartograf-geocoder)[ Packagist](https://packagist.org/packages/cartograf/geocoder)[ Docs](https://github.com/timstallmann/cartograf-geocoder)[ RSS](/packages/cartograf-geocoder/feed)WikiDiscussions master Synced yesterday

READMEChangelog (1)Dependencies (3)Versions (4)Used By (0)

cartograf/geocoder
==================

[](#cartografgeocoder)

[![Latest Version on Packagist](https://camo.githubusercontent.com/22b647a9afa6e0660880525ebc6390ce9bdd155d0528a6eb0a4d0f514b609d70/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f636172746f677261662f67656f636f6465722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/cartograf/geocoder)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Total Downloads](https://camo.githubusercontent.com/10e6a3efbbfbc347688d9e8379c4b85283f0e31dfa1cc55d6e39f1e6bc2b80f1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f636172746f677261662f67656f636f6465722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/cartograf/geocoder)

This is a bare-bones geocoding framework using cUrl to make http requests. I wrote it for myself as a utility class, mainly for geocoding from the command line.

It's intended to be easily extensible for custom geocoding APIs and to get out of the way as much as possible. `willdurand/geocoder` might be a better framework for you if you want something more robust or complex.

Install
-------

[](#install)

Via Composer

```
$ composer require cartograf/geocoder
```

Usage
-----

[](#usage)

You'll need a class which extends the abstract `Geocoder` base class and defines the following methods:

- `getQueryString(Address $address)` converts an `Address` into the portion of the query string which follows the `baseUrl`. Note that for now this needs to specify JSON output as well.
- `getBaseUrl()` - defaults to `$this->baseUrl` if that is set via `setBaseUrl()`
- `getLatLngFromResult(\stdClass $result)` consumes the json-decoded result object and returns an object with `latitude` and `longitude` properties. Note that this is the final return value so you could add other properties as well if you need them.

Classes implementing MapQuest Nominatim (just set API key) and geocoding via an AWS EC2 instance of [Geolytica's geocoder](https://aws.amazon.com/marketplace/pp/B013CW6HOA) are included.

```
$ch = curl_init() or die("curl_init failed");
$geocoder = new Cartograf\Geocoder($ch);
echo $geocoder->geoCode($address);
curl_close($ch);
```

Change log
----------

[](#change-log)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Testing
-------

[](#testing)

Not yet implemented.

```
$ composer test
```

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

[](#contributing)

Feel free to extend this and submit PRs! I welcome contributions.

Credits
-------

[](#credits)

- [Tim Stallmann](https://github.com/timstallmann)

License
-------

[](#license)

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

###  Health Score

25

—

LowBetter than 35% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity60

Established project with proven stability

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 ~194 days

Total

3

Last Release

3190d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/6741938?v=4)[Tim Stallmann](/maintainers/timstallmann)[@timstallmann](https://github.com/timstallmann)

---

Tags

geocodercartograf

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

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

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

###  Alternatives

[toin0u/geocoder-laravel

Geocoder Service Provider for Laravel

7475.3M15](/packages/toin0u-geocoder-laravel)[willdurand/geocoder

Common files for PHP Geocoder

17437.1M166](/packages/willdurand-geocoder)[mostafaznv/nova-map-field

Map Field for Laravel Nova

46101.8k](/packages/mostafaznv-nova-map-field)[demouth/dmgeocoder

Geocoding library.

216.9k](/packages/demouth-dmgeocoder)

PHPackages © 2026

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