PHPackages                             alexsawallich/zend-google-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. [HTTP &amp; Networking](/categories/http)
4. /
5. alexsawallich/zend-google-geocoder

ActiveLibrary[HTTP &amp; Networking](/categories/http)

alexsawallich/zend-google-geocoder
==================================

A Zend-Framework-Module providing a small service-class to query the Google Geocoder API. Results can optionally be cached to avoid running into the API's query limitations.

14541PHP

Since Nov 17Pushed 10y ago1 watchersCompare

[ Source](https://github.com/alexsawallich/ZendGoogleGeocoder)[ Packagist](https://packagist.org/packages/alexsawallich/zend-google-geocoder)[ RSS](/packages/alexsawallich-zend-google-geocoder/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (2)Used By (0)

What is ZendGoogleGeocoder?
===========================

[](#what-is-zendgooglegeocoder)

ZendGoogleGeocoder is a *Zend Framework 2*-Module which provides a service to query the [Google Geocoding API](https://developers.google.com/maps/documentation/geocoding/intro). The module allows you to retrieve the service from your *ServiceLocator* and use a method to retrieve the geocoordinates for the provided address/location.

The module ships with an API-Client which uses either `file_get_contents` or `cURL` to request data from Google's API.

Each step in the workflow of querying the API is documented by using `Zend\Log`. However by default logging is disabled by using the [Zend\\Log\\Writer\\Noop](http://framework.zend.com/manual/current/en/modules/zend.log.writers.html#stubbing-out-the-writer)-Writer, which you can change by overriding a certrain config key (see [Wiki](https://github.com/alexsawallich/ZendGoogleGeocoder/wiki) for more details).

To avoid running into quota-limits the responses from Google's API are being cached \[INCOMPLETE\].

Usage Example
-------------

[](#usage-example)

*More examples can be found in the [Wiki](https://github.com/alexsawallich/ZendGoogleGeocoder/wiki).*

```
// For example in an action-method
$address = $this->getRequest()->getPost('address');
$geocoderService = $this->getServiceLocator()->get('ZendGoogleGeocoderService');
$response = $geocoderService->geocodeAddress($address, $format = 'xml');

// Do something with the response here...
```

Installation
============

[](#installation)

Step 1: Getting the files
-------------------------

[](#step-1-getting-the-files)

As usual you have the typical three options to install the module.

**Step 1a: Composer**The preferred way is to use composer. The modules' name is `alexsawallich/zend-google-geocoder`. So you can either put it in the `require`-section of your composer.json like this:

```
"require": {
	// ... more here
	"alexsawallich/zend-google-geocoder": "dev-master",
	// ... more here
}

```

or you can add it in commandline like so:

```
$ php composer.phar require "alexsawallich/zend-google-geocoder"

```

When you're done with that run the composer update command:

```
$ php composer.phar update

```

**Step 1b: Git clone**

In commandline head to your `vendor`-directory of your application and run the `git clone` command:

```
$ cd /path/to/my/project/vendor
$ git clone https://github.com/alexsawallich/ZendGoogleGeocoder.git

```

% If you have an UI-based client (like GitHub for Windows) you will probably know which buttons you have to click.

**Step 1c: Manual download**

Even though it's a bit old-fashioned and you won't be able to update the module through composer you can of course manually download a ZIP-file from this GitHub-page and put the extracted folder into your `vendor` or `modules`-directory.

Step 2: Configuration
---------------------

[](#step-2-configuration)

After you've got the files you need to enable the module in your `application.config.php`-file.

```
// application.config.php
return array(
	'modules' => array(
		'ZendGoogleGeocoder'
// ...
```

Now head into the ZendGoogleGeocoder-directory and copy `config/geocoder.global.php.dist` to `root-of-your-project/config/geocoder.global.php`. Open the file and configure the available options to your needs.

Now you should be able to use the module.

Features / Todo / Roadmap
=========================

[](#features--todo--roadmap)

- Possibility to query the Google Geocoder API \[DONE\]
- Option to provide an API-Key for usage in the API requests \[DONE\]
- Query API by providing an address \[DONE\]
- Query API by providing components (defined by Google's API) \[INCOMPLETE\]
- Possibility for detailed logging \[DONE\]
- Possibility to cache the requests to avoid running into quota limits \[INCOMPLETE\]

Notice concerning Google's TOS
==============================

[](#notice-concerning-googles-tos)

If you read the docs of the Google Geocoding API you will find the following ([Source](https://developers.google.com/maps/documentation/geocoding/usage-limits#terms-of-use-restrictions)):

> The Google Maps Geocoding API may only be used in conjunction with a Google map; geocoding results without displaying them on a map is prohibited. For complete details on allowed usage, consult the Maps API Terms of Service License Restrictions.

Please keep that in mind!

###  Health Score

24

—

LowBetter than 31% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity43

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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/4184816?v=4)[Alex Sawallich](/maintainers/alexsawallich)[@alexsawallich](https://github.com/alexsawallich)

---

Top Contributors

[![alexsawallich](https://avatars.githubusercontent.com/u/4184816?v=4)](https://github.com/alexsawallich "alexsawallich (19 commits)")

### Embed Badge

![Health badge](/badges/alexsawallich-zend-google-geocoder/health.svg)

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

###  Alternatives

[php-http/cache-plugin

PSR-6 Cache plugin for HTTPlug

25126.1M82](/packages/php-http-cache-plugin)[illuminate/http

The Illuminate Http package.

11937.9M7.0k](/packages/illuminate-http)[rdkafka/rdkafka

A PHP extension for Kafka

2.2k24.3k1](/packages/rdkafka-rdkafka)[httpsoft/http-message

Strict and fast implementation of PSR-7 and PSR-17

87965.9k114](/packages/httpsoft-http-message)[mezzio/mezzio-router

Router subcomponent for Mezzio

265.4M92](/packages/mezzio-mezzio-router)[serpapi/google-search-results-php

Get Google, Bing, Baidu, Ebay, Yahoo, Yandex, Home depot, Naver, Apple, Duckduckgo, Youtube search results via SerpApi.com

69127.2k](/packages/serpapi-google-search-results-php)

PHPackages © 2026

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