Add default country for Geopunt provider

Created on 5 June 2023, about 1 year ago
Updated 27 June 2023, 12 months ago

Problem/Motivation

Currently, the Geopunt provider isn't working, in combination with reverse geocoding the result to an address field, since this provider is only working for Flanders (a part of Belgium) and the API doesn't return a country. The address doesn't contain a country so the address module doens't save the result.

For every project using this provider and using reverse geocoding, I need to add the following hook:

function hook_geocode_country_code_alter(string &$country_code, array $geojson_array) {
  if (isset($geojson_array['properties']['providedBy']) && $geojson_array['properties']['providedBy'] === 'geopunt') {
    $country_code = 'BE';
  }
}

I was wondering if this could be part of this module? And make geopunt work out of the box.

The maintainer of geocoder-php-geopunt-provider won't make the change in the library. You can see the thread over here: https://github.com/geo6/geocoder-php-geopunt-provider/pull/7

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

✨ Feature request
Status

Fixed

Version

4.0

Component

Code

Created by

🇧🇪Belgium JeroenT 🇧🇪

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.69.0 2024