Skip to content

rickhuizinga/node-geocommons-geocoder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

node-geocommons-geocoder

Node.js wrapper for calling the geocommons/geocoder Ruby interface

Dependencies

A working ruby installation is required with the json and geocoder/us GEMs installed and available.

For the geocoder/us GEM, follow the build and installation instructions in geocommons/geocoder.

A database can be built from the TIGER/Line data source as described in geocommons/geocoder. Alternatively, a pre-built database can be found on the VM images for www.DataScienceToolkit.org (petewarden/dstk).

API Documentation

geocode(database : String, address : String, callback : function)

Asynchronously parse and geocode address.

	var geocoder = require('node-geocommons-geocoder');
	geocoder.geocode("/opt/tiger/geocoder2012.db", "12 Seahawks Way, Renton, WA, 98056", function(err, results) {
	  if (err) {
	    console.log(err.message);
	  } else {
	    console.log(JSON.stringify(results));
	  }
	});

Output:

[{"precision":"zip","city":"Renton","score":0.603,"fips_county":"53033","lon":-122.186447,"zip":"98056","lat":47.514671,"state":"WA"}]

About

Node.js wrapper for calling the geocommons/geocoder Ruby interface

Resources

License

Stars

Watchers

Forks

Packages

No packages published