Skip to content

Feature Request: Geocoding events #412

@jamesmacwhite

Description

@jamesmacwhite

We use the GeoService for geocoding/reverse geocoding lookups which works great. We have use case where we want to reduce the amount of geocoding API requests to providers like Google as it is a metered API and costs. To do this we have implemented a geocoding DB cache, where we store the result of a successful geocoding request through Simplemap into a database table with various properties like, lat, lng, postcode, address, parts. We can then do a DB query to check if that record exists and if it does return it from the DB, to save requesting the same geocoding data again.

This helps with scenarios like Feed Me when importing geocoding data, particularly in Matrix blocks.

Currently, I am wrapping my own service around the GeoService::latLngFromAddress() and GeoService::addressFromLatLng(), however it would be really awesome, if a plugin event was raised when the GeoService makes a geocoding request with the configured provider and returns data. This would allow other plugins to know when this request happens and get the geocoding response data, to do further things with it like, write it to a database or whatever.

I'd be happy to send a PR for it as it would be pretty straightforward.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions