Giter VIP home page Giter VIP logo

node-geocoder's Introduction

node-geocoder

Test Status npm version

Node library for geocoding and reverse geocoding. Can be used as a nodejs library

Installation (nodejs library)

npm install node-geocoder

Usage example

const NodeGeocoder = require('node-geocoder');

const options = {
  provider: 'google',

  // Optional depending on the providers
  fetch: customFetchImplementation,
  apiKey: 'YOUR_API_KEY', // for Mapquest, OpenCage, APlace, Google Premier
  formatter: null // 'gpx', 'string', ...
};

const geocoder = NodeGeocoder(options);

// Using callback
const res = await geocoder.geocode('29 champs elysée paris');

// output :
[
  {
    latitude: 48.8698679,
    longitude: 2.3072976,
    country: 'France',
    countryCode: 'FR',
    city: 'Paris',
    zipcode: '75008',
    streetName: 'Champs-Élysées',
    streetNumber: '29',
    administrativeLevels: {
      level1long: 'Île-de-France',
      level1short: 'IDF',
      level2long: 'Paris',
      level2short: '75'
    },
    provider: 'google'
  }
];

Advanced usage (only google, here, mapquest, locationiq, and opencage providers)

const res = await geocoder.geocode({
  address: '29 champs elysée',
  country: 'France',
  zipcode: '75008'
});

// OpenCage advanced usage example
const res = await geocoder.geocode({
  address: '29 champs elysée',
  countryCode: 'fr',
  minConfidence: 0.5,
  limit: 5
});

// Reverse example

const res = await geocoder.reverse({ lat: 45.767, lon: 4.833 });

// Batch geocode

const results = await geocoder.batchGeocode([
  '13 rue sainte catherine',
  'another address'
]);

// Set specific http request headers:
const nodeFetch = require('node-fetch');

const geocoder = NodeGeocoder({
  provider: 'google',
  fetch: function fetch(url, options) {
    return nodeFetch(url, {
      ...options,
      headers: {
        'user-agent': 'My application <[email protected]>',
        'X-Specific-Header': 'Specific value'
      }
    });
  }
});

Geocoder Providers (in alphabetical order)

  • agol : ArcGis Online Geocoding service. Supports geocoding and reverse. Requires a client_id & client_secret
  • aplace : APlace.io Geocoding service. Supports geocoding and reverse. Requires an access token (read about access tokens here) using options.apiKey
    • For geocode you can use simple string parameter or an object containing the different parameters (type, address, zip, city, country, countryCode and countries). See available values for type and countries parameters here
    • For reverse, you can pass over {lat, lon}
    • For both methods, use options.language (either fr or en) to specify the language of the results
  • datasciencetoolkit : DataScienceToolkitGeocoder. Supports IPv4 geocoding and address geocoding. Use options.host to specify a local instance
  • freegeoip : FreegeoipGeocoder. Supports IP geocoding
  • geocodio: Geocodio, Supports address geocoding and reverse geocoding (US only)
  • google : GoogleGeocoder. Supports address geocoding and reverse geocoding. Use options.clientIdand options.apiKey(privateKey) for business licence. You can also use options.language and options.region to specify language and region, respectively.
  • here : HereGeocoder. Supports address geocoding and reverse geocoding. You must specify options.apiKey with your Here API key. You can also use options.language, options.politicalView (read about political views here), options.country, and options.state.
  • locationiq : LocationIQGeocoder. Supports address geocoding and reverse geocoding just like openstreetmap but does require only a locationiq api key to be set.
    • For geocode you can use simple q parameter or an object containing the different parameters defined here: http://locationiq.org/#docs
    • For reverse, you can pass over {lat, lon} and additional parameters defined in http://locationiq.org/#docs
    • No need to specify referer or email addresses, just locationiq api key, note that there are rate limits!
  • mapbox : MapBoxGeocoder. Supports address geocoding and reverse geocoding. Needs an apiKey
  • mapquest : MapQuestGeocoder. Supports address geocoding and reverse geocoding. Needs an apiKey
  • nominatimmapquest: Same geocoder as openstreetmap, but queries the MapQuest servers. You need to specify options.apiKey
  • opencage: OpenCage Geocoder. Aggregates many different open geocoder. Supports address and reverse geocoding with many optional parameters. You need to specify options.apiKey which can be obtained at OpenCage.
  • opendatafrance: OpendataFranceGeocoder supports forward and reverse geocoding in France; for more information, see OpendataFrance API documentation
  • openmapquest : Open MapQuestGeocoder (based on OpenStreetMapGeocoder). Supports address geocoding and reverse geocoding. Needs an apiKey
  • openstreetmap : OpenStreetMapGeocoder. Supports address geocoding and reverse geocoding. You can use options.language and options.email to specify a language and a contact email address.
  • pickpoint: PickPoint Geocoder. Supports address geocoding and reverse geocoding. You need to specify options.apiKey obtained at PickPoint.
    • As parameter for geocode function you can use a string representing an address like "13 rue sainte catherine" or an object with parameters described in Forward Geocoding Reference.
    • For geocode function you should use an object where {lat, lon} are required parameters. Additional parameters like zoom are available, see details in Reverse Geocoding Reference.
  • smartyStreet: Smarty street geocoder (US only), you need to specify options.auth_id and options.auth_token
  • teleport: Teleport supports city and urban area forward and reverse geocoding; for more information, see Teleport API documentation
  • tomtom: TomTomGeocoder. Supports address geocoding. You need to specify options.apiKey and can use options.language to specify a language
  • virtualearth: VirtualEarthGeocoder (Bing maps). Supports address geocoding. You need to specify options.apiKey
  • yandex: Yandex support address geocoding, you can use options.language to specify language

Fetch option

With the options.fetch you can provide your own method to fetch data. This method should be compatible with the Fetch API.

This allow you to specify a proxy to use, a custom timeout, specific headers, ...

Formatter

  • gpx : format result using GPX format
  • string : format result to an String array (you need to specify options.formatterPattern key)
    • %P country
    • %p country code
    • %n street number
    • %S street name
    • %z zip code
    • %T State
    • %t state code
    • %c City

More

Playground

You can try node-geocoder here http://node-geocoder.herokuapp.com/

Command line tools

node-geocoder-cli You can use node-geocoder-cli to geocode in shell

Extending node geocoder

You can add new geocoders by implementing the two methods geocode and reverse:

const geocoder = {
    geocode: function(value, callback) { ... },
    reverse: function(query, callback) { var lat = query.lat; var lon = query.lon; ... }
}

You can also add formatter implementing the following interface

const formatter = {
  format: function(data) {
    return formattedData;
  }
};

Contributing

You can improve this project by adding new geocoders.

To run tests just npm test.

To check code style just run npm run lint.

node-geocoder's People

Contributors

andrewlively avatar avin avatar bramzor avatar brandonaaron avatar charly22 avatar croweman avatar delianides avatar dhritzkiv avatar dippi avatar enniel avatar ephigenia avatar fabricecolas avatar hramezani avatar jtemps avatar keeganlow avatar kevinfarrell avatar kwiky avatar laurynas-karvelis avatar magnushiie avatar malayladu avatar mattkrick avatar mlucool avatar mtmail avatar nchaulet avatar nini-os avatar nisaacson avatar ohnnyj avatar pbihler avatar skimmmer avatar walling avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

node-geocoder's Issues

Geocoder Commandline Problems

The command-line version of the application is returning an error:

JoeUser@DeathStar sudo geocoder --provider google 'Fornino, 187 Bedford Ave, Brooklyn, NY 11211'
/usr/bin/env: node: No such file or directory

I am running in Ubuntu. My only guess is that the package is called nodejs, not node, which is the legacy. Thoughts?

Url query string parsing for Google

In your http adapter you use this.url.format({query : params}) for your query string, which is generally totally fine, but Google uses commas in their query strings, which this function turns to %2C-

Unparsed Params: {"sensor":false,"key":"MY_API_KEY","latlng":"-71.120448,48.8698679"}

After parsing:
{"host":"maps.googleapis.com","path":"/maps/api/geocode/json?sensor=false&key=MY_API_KEY&latlng=-71.120448%2C48.8698679"}

Result:
[ { latitude: -75.250973, longitude: -0.071389, country: 'Antarctica', city: null, state: null, stateCode: null, zipcode: null, streetName: null, streetNumber: null, countryCode: 'AQ' } ]

OpenCage is missing from the factory

Error: No geocoder provider find for : opencage
    at Object.GeocoderFactory._getGeocoder (.../node_modules/node-geocoder/lib/geocoderfactory.js:88:10)
    at Object.GeocoderFactory.getGeocoder (.../node_modules/node-geocoder/lib/geocoderfactory.js:130:28)
    at Object.<anonymous> (.../server/fetch.js:21:26)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10)
    at startup (node.js:119:16)
    at node.js:906:3

If 1 batch query fails, the whole batch fails

When using the google adapter and the following set of data:

[ '19 Atuaroa Ave, Te Puke, New Zealand',
  '1235 ddetunf, no lamllf, New Zealand',
  '42 Puketapu Road , Taradale, Napier, New Zealand',
  'Pakuranga, Manukau, New Zealand',
  'flat 4/1broadfoot place, tekuiti, New Zealand',
  '25/15 Jickell St Hokowhitu , PalmerstonNorth, New Zealand',
  'Ruapehu Alpine Lifts Workshop Old Station Road, Ohakune, New Zealand',
  '20 Furlong Steert , Hawera 4610, New Zealand',
  '2 Rodney street, Levin, New Zealand',
  '31 Monro Street, Blenheim, New Zealand' ]

I get the following error:

[Error: Status is ZERO_RESULTS.]

When I ensure that the data is all valid addresses such as:

[ '19 Atuaroa Ave, Te Puke, New Zealand',
  '42 Puketapu Road , Taradale, Napier, New Zealand']

All is well.

Is this expected behaviour? Shouldn't it return all successful results rather than failing everything if one fails?

v 2.17.0 dont work with google geocode

I test this with the README example and i get non response, debug some more and in the googlegeocoder its returning the response, but some point in the middle get lost. I was forced to go back to 2.16.0

Abstract GeoCoder Add Error Objects [LOW PRIORITY]

If a location string is malformed or has special characters, it will occasionally trigger a ipv4 error (specified in /lib/geocoder/abstractgeocoder.js:57). As a matter of simplicity, it would be great if that class threw error objects as opposed to just error strings, so that it is more easily caught and handled by the user.

Thanks!

I would like to ask how to operate geocoder.geocode function

I would like to ask how to operate geocoder.geocode function, sorry I just started learning nodejs.

In geocoder.geocode (geoLocation, function (err, res) {} I know res can parse out the latitude and longitude, but my problem is I have no way to operate outside geocoder.geocode res obtain the latitude and longitude information.
Probably my code structure is as follows:

function forLoop (finput) {
        // Body ... 

    for (var i = 0; i <finput.length; i ++) {
        searchGeo (finput [i] ["address"], finput [i], function (getGeo) {
         }); 
    } 
    console.log (getGeo); 
    //able to post here, I want to be able to complete the loop all the latitude and longitude information, I can only display a sum loop in for, but I hope 
} 

function searchGeo (geoLocation, inputfile, putGeo) {
    geocoder.geocode (geoLocation, function (err, res) {
    geoItem = {
        address: inputfile ["address"], 
        lat: res [0] ["latitude"], 
        lon: res [0] ["longitude"] 
    } 
    geoList.push (geoItem); 
    putGeo (geoList); 
    }); 
}

TypeError: Cannot call method 'indexOf' of undefined

Sometime, using 'openmapquest' provider I have the folling error:

TypeError: Cannot call method 'indexOf' of undefined
    at IncomingMessage.<anonymous> (/root/server-node/node_modules/node-geocoder/lib/httpadapter/httpadapter.js:42:29)
    at IncomingMessage.emit (events.js:117:20)
    at _stream_readable.js:944:16
    at process._tickCallback (node.js:448:13)

It is because some time the 'content-type' is not in the header.

API limit reached quickly

I am using this module and specifying the API key for Google Geocode. I am quickly reaching the API limit (within 50 requests) despite the API limit being 2500 daily.

On Google's API page I see my quota for the Geocode API is at 0% though.

Any ideas?

TypeError: Cannot call method 'indexOf' of undefined

Seeing this intermittently with the "datasciencetoolkit" provider and 'http'. It happens in bunches so I'm guessing this is due to the provider being down? Can this be captured and returned as an error?

TypeError: Cannot call method 'indexOf' of undefined
at IncomingMessage.HttpAdapter.get (/data/knack/Server/node_modules/node-geocoder/lib/httpadapter/httpadapter.js:33:33)
at IncomingMessage.EventEmitter.emit (events.js:126:20)
at IncomingMessage._emitEnd (http.js:367:10)
at HTTPParser.parserOnMessageComplete as onMessageComplete
at Socket.socketOnData as ondata
at TCP.onread (net.js:404:27)

Check for mistyped/invalid properties

Neither getGeocoder (extra parameter) nor the geocode function of the resulting object validate the input option. It is easy to mistake "apiKey" with "apikey" or add a completely unsupported parameter. It should not fail silently when property is not recognised.

Add Filelds

Hi,

can you please add the following fields:

'village' : result.address.village,
'hamlet' : result.address.hamlet,

in the ._formatResult function of nominatimmapquestgeocoder.js and openstreetmapgeocoder.js

Or you can simply modify:
'city' : result.address.city || result.address.town with
'city' : result.address.city || result.address.town || result.address.village || result.address.hamlet.

This happened because sometimes, for example here in Italy, there are really small town classified like village or hamlet but in fact they are towns.

Thank you!

TypeError: Cannot read property '0' of undefined

Sometime I get the following error. I think it is because OpenMapQuest is returning an empty response.

TypeError: Cannot read property '0' of undefined
    at /root/server-node/node_modules/node-geocoder/lib/geocoder/openmapquestgeocoder.js:105:37
    at IncomingMessage.<anonymous> (/root/server-node/node_modules/node-geocoder/lib/httpadapter/httpadapter.js:49:17)
    at IncomingMessage.emit (events.js:117:20)
    at _stream_readable.js:944:16
    at process._tickCallback (node.js:448:13)

No exception handling for socket hang ups

I'm using openstreetmap and currently getting:

Error: socket hang up
at createHangUpError (http.js:1373:15)
at Socket.socketCloseListener (http.js:1424:23)
at Socket.EventEmitter.emit (events.js:126:20)
at Socket._destroy.destroyed (net.js:358:10)
at process.startup.processNextTick.process._tickCallback

openstreetmap typically works but we see these fairly regularly.

Can exception handling catch those so we can try another service?

Proposal: Dependency monitoring.

Hello,

I have used your module in my study assignment and noticed that you have continuous integration in place but you are not using any dependency monitoring service. Dependency monitoring service follows changes in your dependencies, so if there are changes in them you will get a notification. I tried VersionEye, so if you are interested monitoring dependencies then follow these steps.

  1. Go to https://www.versioneye.com/
  2. Sign up (it is possible with your GitHub account).
  3. Select which project you want to monitor.
  4. Copy the dependencies badge and paste it in your README.md

Open Mapquest "Error Refused"

The openmapquest provider returns the following error:

events.js:72
throw er; // Unhandled 'error' event
^
Error: connect ECONNREFUSED
at errnoException (net.js:901:11)
at Object.afterConnect as oncomplete

All of the other providers (Mapquest, Google, OpenStreetMap) seem to work fine, as does the HTTP (inputting a query string into the browser) API for OpenMapQuest Any thoughts?

bad api key

Status is REQUEST_DENIED. This API project is not authorized to use this API. Please ensure that this API is activated in the APIs Console: Learn more: https://code.google.com/apis/console

Not sure why this is happening, not using an API key works fine.

I generated a server api key in the google console.

What format is the error response in?

Thanks for this library!

I don't know if it's just me, but I'm having difficulty understanding the error returned.

I am using the promise syntax:

geocoder.geocode(addressText)
          .then(function(res) {
            return res[0];
          })
          .catch(function(err) {
            console.log("Geocode error 1",err, typeof err, Object.keys(err), err.length);

Output from console.log:

"Geocode error 1 [Error: Status is OVER_QUERY_LIMIT. You have exceeded your daily request quota for this API.] object [] undefined"

"err" looks like an array but has no length, has typeof object but no keys. What is this thing and how do I extract the status? :)

I'll appreciate any help.

OpenStreetMaps and MapQuest State Code

Both OpenStreetMaps and MapQuest return "undefined" for the StateCode attribute, although their APIs seem to be outputting that data. Perhaps a mapping issue between the node library and their APIs?

openstreetmapgeocoder throws error instead of callback (error)

Hi,

Im using node-geocoder/lib/geocoder/openstreetmapgeocoder.js
line 108 has throw err; so instead of calling passed callback it throws an error.
If you dont want to crash the app you need to put geocoder.reverse() in try catch.
Defeats the purpose of callback.

Can you set it to call callback (err, null)

Incompatible with Browserify

I believe Browserify does not detect require() calls inside functions, and therefore cannot include modules that are only required at runtime.

Trying to invoke the factory therefore fails with:

Error: Cannot find module './httpadapter/httpadapter.js'

If one adds a global require for these files, it works. However, there is no way to do this at the application level, since the paths would be different, and Browserify does not normalize paths.

The callback is called twice when error happens

In the geocoder.js:

Geocoder.prototype._format = function (err, data, callback) {
if (err) {
callback(err, data);
}
if (this._formatter && this._formatter !== 'undefined') {
data = this._formatter.format(data);
}
callback(err, data);
};

notice that if err is not null, then callback will be called twice. This will cause issue, for example, when I use this as part of server to response the request, and the server will send response twice, causing "Can't set headers after they are sent." error.

Isn't this a violation of Google Maps ToS?

Just curious, but isn't using the Geocoder this way violating Google's terms of service?

https://developers.google.com/maps/documentation/geocoding/#api_key

Specifically:

The Geocoding API may only be used in conjunction with a Google map; geocoding results without displaying them on a map is prohibited. For complete details on allowed usage, consult the Maps API Terms of Service License Restrictions.

Obviously if you are using this with a google map then there's no problem.

2.9 datasciencetoolkit not throwing error

Seeing datasciencetoolkit just stall and not throw an error. Same address throwing an error in openstreetmap and working with google.

Can any unsuccessful geocodes throw an error?

Thanks!
-Brandon

opencage geocoder doesnt work for 49.0068901,8.403652700000066

for the latlng mentioned above, the geocoder for opencage doesnt give me the city. The city field is not returned also from direct API invocation at opencage, but the county is returned. Unfortunately there is no county represenatation within the node-geocoder library. So i'm stuck with having no city name there.

Promise should not be rejected if address is not found

Promise should be only rejected when something unexpected happens, e.g. remote service does not respond or responds with status code indicating server error.

When there are no results, promise should be resolved with an empty result.

It is easy to check whether a scenario should be rejected by asking yourself if you would throw an error if you weren't using promises.

Proxy

Doesn't seem to work behind a corporate proxy.

is there a limit on the reverse?

Hi,
Firstly, thanks for a superb module. Well done!

I am trying to use your package for reverse geocoding my coords. I am basically using it inside a " async.filter() " function to reverse geocode the coordinates.
What I observe is that, the " geocoder.reverse " returns " res = undefined and err = {} " for some valid coordinates. When i try reversing just this one separately from the node REPL, it returns correctly.

Code:

async.filter(rws, function(row, cb){
if(!(row.lat && row.long)) { return cb(false); }
geocoder.reverse(row.lat, row.long, function(err, res){
if(!res) { return cb(false); }
if(err) { return cb(false); }
});
}, function(filteredresults){
});

What could be the issue?

Failed to Parse Json Installation error

npm ERR! Failed to parse json
npm ERR! Unexpected end of input
npm ERR! File: /home/webonise/.npm/debug/1.0.4/package/package.json
npm ERR! Failed to parse package.json data.
npm ERR! package.json must be actual JSON, not just JavaScript.
npm ERR!
npm ERR! This is not a bug in npm.
npm ERR! Tell the package author to fix their package.json file. JSON.parse

npm ERR! System Linux 3.2.0-39-generic-pae
npm ERR! command "/home/webonise/.nvm/v0.10.20/bin/node" "/home/webonise/.nvm/v0.10.20/bin/npm" "install" "-g" "node-geocoder"
npm ERR! cwd /home/webonise/CurrentProject/warehouse/WarehouseApp/server
npm ERR! node -v v0.10.20
npm ERR! npm -v 1.3.11
npm ERR! file /home/webonise/.npm/debug/1.0.4/package/package.json
npm ERR! code EJSONPARSE
npm http GET https://registry.npmjs.org/buster-core/0.6.4
npm http 200 https://registry.npmjs.org/mkdirp/-/mkdirp-0.3.5.tgz
npm ERR! addPlacedTarball Could not remove "/home/webonise/.npm/mkdirp/0.3.5/package"
npm http 304 https://registry.npmjs.org/type-detect/0.1.1
npm http 304 https://registry.npmjs.org/buster-core/0.6.4
n

Geocoding intersections with `&` returns incorrect address

For geocoding addresses that are intersections of two streets, the address is written as:
Man O' War Blvd & Polo Club Blvd Lexington, Kentucky, 40509

When sent through the library the & needs to be replaced with a URI encoded character %26, otherwise both Google and ArcGIS will return an incorrect address since it is getting parsed as a query parameter.

I'm not sure the best location where this replace would happen and for what adapters this would be necessary.

ArcGIS provider adapter missing stateCode and streetNumber

When using the ArcGIS provider, the adapter always returns null for stateCode and an empty string for the streetNumber when geocoding an address.

i.e. when geocoding 187 Bedford Ave, Brooklyn, NY 11211, the google adapter returns:

{
    latitude: 40.7175439,
    longitude: -73.95771119999999,
    country: 'United States',
    city: null,
    state: 'New York',
    stateCode: 'NY',
    zipcode: '11211',
    streetName: 'Bedford Avenue',
    streetNumber: '187',
    countryCode: 'US'
}

and the ArcGIS adapter returns:

{
    latitude: -73.95785917316152,
    longitude: 40.71766805993411,
    country: 'USA',
    city: 'Brooklyn',
    state: 'New York',
    stateCode: null,
    zipcode: '11211',
    streetName: ' Bedford Ave',
    streetNumber: '',
    countryCode: 'USA'
}

geocoder-reverse south hemisphere

There's an error if trying to reverse geocode a southern hemisphere coordinate like this:
geocoder-reverse -37.1387194 175.5419382
getting:
error: unknown option -3'`

Malformed components string when providing post_code without a country code

https://github.com/nchaulet/node-geocoder/blob/master/lib/geocoder/googlegeocoder.js#L41-L53

if (value.address && value.address != 'undefinded') {
    var components = '';

    if (value.country && value.country != 'undefinded') {
        components += 'country:'+ value.country;
    }

    if (value.zipcode && value.zipcode != 'undefinded') {
        components += '|postal_code:'+ value.zipcode;
    }

    params.components = components;
    params.address = value.address;
}

Providing just zipcode would format invalid components parameter ("|postcal_code:...").

Consider adding a license.

Consider adding a license so that users can have a better understanding of the legal consequences of including this in their projects.

Supplying an apikey to the Google Geocoder API

I'm not a Google "Maps for Business" user, but it looks like I'm still supposed to generate an API key to use the geocoder service:

https://developers.google.com/maps/documentation/geocoding/#Limits

I have an API key generated through the developer console for the free version, but it looks like this library doesn't allow me to use it in the request.

I think Google are responding to requests without an API key, but throttling much more heavily. I'm throttling my requests to less than the 10 a second that's specified, and all but the first few are getting rejected.

Where to place Google API Client ID?

First of all thank you for creating this package!

As someone who is heavily using this module, I've recently hit a wall with Google API requests and now will need to add a client ID and url signature to my requests to continue using this. According to the documentation, Business clients need to add the following to their query (I've cut it up to make it more readable):

http://maps.googleapis.com/maps/api/geocode/json
  ?address=1600+Amphitheatre+Parkway,+Mountain+View,+CA
  &sensor=true_or_false
  &client=gme-YOUR_CLIENT_ID
  &signature=YOUR_URL_SIGNATURE

In your googleGeocoder.js file I think all I have to do is go to line 35 and 126 and add to the object the extra params of the request. If so, just let me know and please add that bit to the documentation. If not tell me what needs to modify in order to successfully add these params to your queries.

THANK YOU!

return the original response from google geocoder

First, I want say "Thank You!". This is really nice piece of work!

This is more like a favorite or enhancement. If you can return the original response from google, or other provider, that will be very nice. Lots of time, we need know how "confident" google feel about the result, then we need look at the "partial match" flag in the original result.

One way is to just attach the original response as a node under current returned result.

Thanks

Michael

Remove requestify requirement for ArcGIS use

I could not get requestify working with ArcGIS. Using https as the httpAdapter should be sufficient. The Changelog specifies that the requestify httpAdapter was removed at 2.0, but it is required to use the ArcGIS provider

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.