refine_geocoder.json
will geocode a simple list of addresses from Open Refine using the Bing and OpenStreetMap Nominatim APIs.
It fetches JSON, which is parsed using GREL, Refine's expression language, to give columns for latitude and longitude from each service, plus the following:
bing_type
"Address" indicates geocoding to an exact address.bing_confidence
"High," "Medium," or "Low."osm_category
"Place," "amenity," "office" etc indicate geocoding to an exact address; "highway" indicates geocoding to street only.osm_type
Further detail on the entity geocoded.
Open refine_geocoder.json
in a text editor and replace BingMapsKey
with your own Bing API key. If you don't already have a Microsoft Account, you will first need to create one before requesting a Bing Maps Key. Then Sign In
at the Bing Maps Portal and select My account
from the top menu.
Create a new Open Refine project from a text file containing a simple list of addresses/locations, with the extension .tsv
and the header row address
. See sf_test_addresses.tsv
for an example.
Open the Undo/Redo
tab in Open Refine, and click the Apply...
button. Paste the contents of refine_geocoder.json
into the box, click the Perform Operations
button and wait for results to appear.
Click the Export
button to export your geocoded data in various formats.
Make sure to follow the Bing and OpenStreetMap Nominatim Terms of Use, and provide appropriate credit to each geocoding service.