Geocoding in the terminal with Mapbox

2015-12-20

In need of geocoding a number of addresses in a CSV file for some mapping work, I created a module mbgeocode that ingests a CSV and outputs a GeoJSON file of all successfull addresses geocoded. This project relies on the Mapbox geocoding API, which allows for requests sent via HTTPS and returns geocoded information in the form of a Carmen GeoJSON.

This is a Node.js module, so you’ll have to have Node installed on your computer. You can install mbgeocode via the npm registry, which gives you global access to using the mbgeocode on your machine.

npm install -g mbgeocode

Usage

Geocoding requires two inputs:

  1. CSV file with appropriately named colums
  2. A Mapbox API token
mbgeocode file.csv <mapbox_token>

Here’s an example of it in action.

terminal example

There are a number of features that I’d like to add over time, including:

You can find the project on Github.