JSON to geocode list of addresses in Open Refine, using Bing and MapQuest Open APIs
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
README.md
refine_geocoder.json
sf_test_addresses.tsv

README.md

refine-geocoder

refine_geocoder.json will geocode a simple list of addresses from Open Refine using the Bing and MapQuest Open 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, see here for other possibilities.
  • bing_confidence "High," "Medium," or "Low." Explanation here.
  • mapquest_type "Place," "amenity," "shop" etc indicate geocoding to an exact address; "highway" indicates geocoding to street only.
  • mapquest_class Further detail on the entity geocoded.

How to use

Open refine_geocoder.json in a text editor and replace BingMapsKey with your own Bing API key, and MapQuestKey with your MapQuest API key. Obtain your MapQuest Key here. 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>Create or view keys 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 MapQuest Open Terms of Use, and provide appropriate credit to each geocoding service (also to OpenStreetMap for MapQuest Open).