raw-google-geocoder
v0.2.0
Published
raw google geocode any address without an api or key
Downloads
6
Readme
Raw Google Geocoder
npm i raw-google-geocoder
Lost your google maps api key? No worries, this tiny module helps you parse and serialize queries straight from google.com/search. Works good with addresses in latin.
If the build is starting to fail, that means the the schema has changed and the query/regex needs to be updated, send a pull request.
var request = require('request')
var geocoder = require('raw-google-geocoder')
//object w/ url passed to the request module.
var use_https = false
var query_object = geocoder.serialize('RUA PAULINA ISABEL DE QUEIROS,, BANGU, SANTO ANDRE, 09210260, br',use_https)
//make a request with request module
request(query,function(error,res,body){
//parse the body and extract address and gps coordinates, make sure to catch any errors for bad addresses
try{
console.log geocoder.parse(body)
}catch(error){
console.error error
}
/*
addr: 'R. Paulina Isabel de Queirós - Bangú, Santo André - SP, Brazil',
lat: -23.6418355,
lon: -46.5262411
*/
})