PHPackages                             ride/lib-geocode - 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. ride/lib-geocode

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

ride/lib-geocode
================

Geocode library of the Ride framework

1.3.1(6y ago)02.8k4MITPHP

Since May 26Pushed 6y ago8 watchersCompare

[ Source](https://github.com/all-ride/ride-lib-geocode)[ Packagist](https://packagist.org/packages/ride/lib-geocode)[ RSS](/packages/ride-lib-geocode/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (2)Versions (13)Used By (4)

Ride: Geocode Library
=====================

[](#ride-geocode-library)

Geocoding library of the PHP Ride framework.

What's In This Library
----------------------

[](#whats-in-this-library)

### GeocodeService

[](#geocodeservice)

The *GeocodeService* interface is the main workhorse of this library. The implementations of this class perform the actual looking up of addresses to other providers.

There are a couple of implementations included in this library:

#### ArcgisGeocodeService

[](#arcgisgeocodeservice)

This service uses Arcgis to perform geocoding of addresses. Check  for more information about this service.

#### FreeGeoIpGeocodeService

[](#freegeoipgeocodeservice)

This service uses freegeoip.net to get the location of an IP address or domain names. Check  for more information about this service.

#### GoogleGeocodeService

[](#googlegeocodeservice)

This service uses Google Maps to perform geocoding of addresses. Check \[[https://developers.google.com/maps/documentation/geocoding/intro\](](https://developers.google.com/maps/documentation/geocoding/intro]()[https://developers.google.com/maps/documentation/geocoding/intro\]](https://developers.google.com/maps/documentation/geocoding/intro%5D) for more information about this service.

#### ChainGeocodeService

[](#chaingeocodeservice)

Use the *ChainGeocodeService* to chain simular services together. When the first service can't handle the lookup, the following service will be polled and so on.

### GeocodeResult

[](#geocoderesult)

The *GeocodeResult* interface is used to return the result of a *GeocodeService*. A default implementation is provided by the *GenericGeocodeResult* class.

### GeocodeCoordinate

[](#geocodecoordinate)

The *GeocodeCoordinate* interface is used to obtain the found coordinates from a *GeocodeResult*. A default implementation is provided by the *GenericGeocodeCoordinate* class.

### Geocoder

[](#geocoder)

The *Geocoder* is the facade to this library. You can add different services and give them a name. This name is then used to lookup specific addresses.

Code Sample
-----------

[](#code-sample)

Check this code sample to see some possibilities of this library:

```
