Parse geocoder data into easily usable form
JavaScript
Switch branches/tags
Nothing to show
Latest commit c1bfd29 Jul 9, 2015 @samora update readme
Permalink
Failed to load latest commit information.
node_modules/lodash improve doc Jul 9, 2015
test improve doc Jul 9, 2015
.gitignore improve doc Jul 9, 2015
README.md update readme Jul 9, 2015
index.js improve doc Jul 9, 2015
package.json improve doc Jul 9, 2015
parse.json improve doc Jul 9, 2015
parseResult.json improve doc Jul 9, 2015

README.md

parse-geocoder

Parse geocoder data into easily usable form

Gecoder returns data in standard Google JSON output. parse-geocoder makes the results easier to manipulate.

Installation

npm install --save parse-geocoder

API

parseResult

var result = parseGeocoder.parseResult(geocoderData.results[0]);

Returns a parsed result object containing:

  • addressComponent: hash of address component types
    {
      country: {longName: 'Ghana', shortName: 'GH'},
      administrative_area_level_1: {longName: 'Greater Accra', shortName: 'Greater Accra'}
    }
  • formattedAddress: unmodified formatted_address of result
  • geometry: unmodified geometry data of result
  • addressPrecision: level to which location is accurate

See parseResult.json for sample.

parse

var result = parseGeocoder.parse(geocoderData);

Returns an array of parseResults.

See parse.json for sample.

License

MIT