This module is a Drupal wrapper/implementation for the Geocoder PHP library: "The most featured Geocoder library written in PHP, which helps you build geo-aware applications by providing a powerful abstraction layer for geocoding manipulations".
It is commonly used to automatically Geocode string/text Point addresses and WKT Geometries into Geofield, as well as to Reverse Geocode Geofield Points into String/Text Point addresses, and other Geocoder PHP library formats.
hook_geocoder_address_values_alter() to alter address values before geocoding takes place;The following submodules are bundled with the Geocoder package and provide extended integration capabilities:
geocoder_field): Adds the ability to configure Geocode and Reverse Geocode operations on Entity fields (on insert/edit) and as field Geo formatters, leveraging all available Geocoder Provider Plugins and output formats (via Dumpers);geocoder_geofield): Provides integration with the Geofield module/field type — use it as the target of Geocode operations or as the source for Reverse Geocoding;geocoder_address): Provides integration with the Address module/field type — use it as the target of Reverse Geocode operations or as the source for Geocoding;All you need to do is install the geoPHP module, which is required by geocoder.
There's a nice video tutorial on using geocoder, addressfield, and geofield here.
Find detailed documentation in the README.md file.
This is a complete rewrite of the Geocoder module, based on the Geocoder PHP library — Version 3.x.
This is an evolution of the Geocoder 2.x module (deprecated), based on the Geocoder PHP library — Version 4.x.
Starting with this version the Geocoder providers are config entities, whereas in earlier versions the provider settings were stored in simple configuration. An upgrade path is provided but any code that was relying on the old simple config will need to be updated to use the config entities instead.
An upgrade path is provided but any code that was relying on the 2.x simple config will need to be updated to use the config entities instead.
willdurand/geocoder.$ composer require geocoder-php/google-maps-provider/admin/config/system/geocoder.)
When upgrading to the new Geocoder 8.x-3.x branch you would need to:
$ composer remove drupal/geocoder), and make sure its dependency willdurand/geocoder: "^3.0" library is also removed.$ composer require drupal/geocoder).update.php or running $ drush updb.Further detailed documentation and APIs are provided in the Geocoder 3.x README.md file.
This is the current stable and recommended branch. It is a parallel evolution of the Geocoder 3.x branch, requiring php-http/guzzle7-adapter and therefore compatible with Guzzle 7 (a requirement for Drupal 10+). It also supports the willdurand/geocoder v5 library, which introduces PHP 8.4 compatibility and a range of upstream bug fixes.
Further detailed documentation and APIs are provided in the Geocoder 4.x README.md file.
When preparing for an upgrade to Drupal 10 we recommend that you widen your Composer version constraints to allow either 3.x or 4.x.
Edit composer.json the following way:
"require": {
...
"drupal/geocoder": "^3.20 || ^4.0",
...
}
This will allow the module to be automatically upgraded when you upgrade Drupal core (refer to this Issue comment for more info).