- A table on PostgreSQL/PostGIS (tested with CartoDB) with the following text fields: address, city, country, zipcode.
- Python functions are enabled.
- pygeocoder is available to the python function
Once the function has been created, the trigger must be created like this (assuming the geometry column is called the_geom
:
CREATE TRIGGER geocode_trigger BEFORE INSERT OR UPDATE OF the_geom ON your_table FOR EACH ROW EXECUTE PROCEDURE geocode();