getcoordinates

0.3.1 • Public • Published

getcoordinates Code Climate Test Coverage Build Status

A general geocoding module for node.js.


This module is intended to be a way to access as many geocoding services as possible. The module currently works with the APIs provided by geocoder.us and by Here.com, with plans to expand to MapQuest's open API next. Services may be selected with the options object as described below.

Use

var getcoordinates = require('getcoordinates');

getcoordinates.(location, options, callback);

options

options is an object that can be used to select the geocoding service desired and provide the necessary credentials. Presently, only options.service = 'geocoder.us' is functional.

If an API offers more than one endpoint and you have a preference, that preference can be set in options.<service>.type. For example, the geocoder.us service can return data in either csv or xml format, which can be selected with options.geocoder.type: 'csv' or 'xml'.

Authentication credentials will be passed in the options.<service>.auth namespace, as appropriate for the service. Username and password for the geocoder.us service are stored as options.geocoder.auth.username and options.geocoder.auth.password respectively. The names for authentication credentials have been kept the same as what they are called by their respective APIs. See the defaultOptions in index.js for examples.


API Keys

NB: Developers using this package will need their own API keys to use the geocoding services.

Package Sidebar

Install

npm i getcoordinates

Weekly Downloads

0

Version

0.3.1

License

MIT

Last publish

Collaborators

  • arneheggestad