raw-google-geocoder

0.2.0 • Public • Published

Raw Google Geocoder

npm tests

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
    */
})

Readme

Keywords

Package Sidebar

Install

npm i raw-google-geocoder

Weekly Downloads

1

Version

0.2.0

License

ISC

Unpacked Size

10.6 kB

Total Files

8

Last publish

Collaborators

  • arxii