0.2.0 • Published 7 years ago

raw-google-geocoder v0.2.0

Weekly downloads
2
License
ISC
Repository
github
Last release
7 years ago

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

7 years ago

0.1.6

7 years ago

0.1.5

7 years ago

0.1.3

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago