There are two versions of this module for Drupal 7. When Geocoder 2.x will be stable, the old Geocoder 1.x will be deprecated. The API has changed between those two modules, so please, if you use this module, get ready to update your code.

Geocoder 1.x

This module will geocode just about anything you throw at it including addresses, GPX files, geo-tagged images, and KML files. It is commonly used to automatically geocode Addressfield addresses into Geofield points for display on Openlayers Maps. It also supports the geolocation, and location modules. This module also makes available an API to convert the information you already have into geographic information. It support a variety of input formats and runs them through pluggable backends to produce geographic information. In addition to Latitude / Longitude points, this API also supports more complex geographies such as lines and polygons. If you'd like to help improve the module your patches and co-maintenance are welcome!

Features

Compatible modules

Installation

All you need to do is install the geoPHP module, which is required by geocoder.

Tutorial

There's a nice video tutorial on using geocoder, addressfield, and geofield here: http://vimeo.com/38558646

API

In addition to the GUI-based widget, geocoder also provides a nice general API for doing geocoding. Here's an example: out('json'); // List all available handlers $handlers = geocoder_handler_info(); dpm($handlers); ?> New geocoder handlers as easy to define. Simply create a new ctools plugin of the type "geocoder_handler".

Geocoder 2.x

This is a complete rewrite of the Geocoder module, based on the Geocoder PHP library - Version 3.x.

Features

Requirements for D8

Installation for D8

  1. Download the module running the following shell command from you project root (at the composer.json file level): $ composer require "drupal/geocoder" Note: this will also download the Geocoder PHP library as vendor/willdurand/geocoder
  2. Enable the module via Drush $ drush en geocoder or the website back-end/administration interface;
  3. Eventually enable also the submodules: geocoder_field and geocoder_geofield / geocoder_address;

Installation for D7

  1. drush dl composer_manager
  2. drush dl service_container
  3. drush dl composer-8.x-1.x
  4. drush dl geocoder-7.x-2.x
  5. drush en geocoder -y
  6. Eventually enable also the submodules: geocoder_field and geocoder_geofield / geocoder_address

API

Find the documentation on the API in the README.md file.

Modules using Geocoder 2.x