geocodify

geocode spreadsheet files

geocodify

Geocode streaming CSV data, producing CSV or GeoJSON.

npm install -g geocodify

mapbox: Mapbox Web Services API

  • Worldwide
  • Requires mapid

census: US Census

  • US-Only

mapquestopen: MapQuest Open Nominatim

  • Worldwide

twofishes: Twofishes

  • Worldwide
  • Coarse (not street-level)

geogratis: Geogratis

The input is either the first positional argument, like

geocodify input.csv

Or a stream, like

cat input.csv | geocodify

The output is always stdout. To write to a file, just

geocodify input.csv > output.csv

The only currently supported input format is CSV

--format={csv}

The input method will attempt to automatically choose fields that are geographic. You can specify manual fields if you want:

--addressfields [ afieldname anotherfield ]

Selecting --output=geojson encodes results as GeoJSON

--output={csv,geojson}

See geocoders above for details

--source={census,mapbox,mapquestopen,twofishes,geogratis}

Use the US Census (USA only)

geocodify --source=census < file.csv > geocoded.csv

CSV to geocoded CSV

geocodify < file.csv > geocoded.csv

CSV to GeoJSON to geojson.io

npm install -g geojsonio-cli
geocodify --output=geojson < file.csv | geojsonio

CSV to GeoJSON to KML

npm install -g tokml
geocodify --output=geojson < file.csv | tokml

Manually specify address fields

geocodify --addressfields [ columnname othercolumn ] < atypical.csv

Returns a transform stream. Source is a geocoder, addressFields is an array of fields, mapid is a Mapbox map id. Transforms JSON objects into geocoded JSON objects.