A Flatfile plugin for geocoding addresses using the Google Maps Geocoding API
npm i @flatfile/plugin-enrich-geocode
The @flatfile/plugin-enrich-geocode
plugin for geocoding addresses using the Google Maps Geocoding API. This plugin enables automatic geocoding of addresses, reverse geocoding of coordinates, and enrichment of location data within your Flatfile imports.
Event Type:
listener.on('commit:created')
The enrichGeocode
function accepts a configuration object with the following properties:
sheetSlug
(string): The slug of the sheet containing address data. Default: "addresses"addressField
(string): The field name for the address input. Default: "address"latitudeField
(string): The field name for latitude. Default: "latitude"longitudeField
(string): The field name for longitude. Default: "longitude"autoGeocode
(boolean): Whether to automatically geocode records. Default: trueTo install the plugin, use npm:
npm install @flatfile/plugin-enrich-geocode
import type { FlatfileListener } from "@flatfile/listener";
import enrichGeocode from "@flatfile/plugin-enrich-geocode";
export default function (listener: FlatfileListener) {
listener.use(
enrichGeocode(listener, {
sheetSlug: 'customer_addresses',
addressField: 'full_address',
latitudeField: 'lat',
longitudeField: 'lng'
})
);
// ... rest of your Flatfile setup
}