Skip to content

Of API keys and large batches #9

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Forbin opened this issue Feb 13, 2014 · 2 comments
Closed

Of API keys and large batches #9

Forbin opened this issue Feb 13, 2014 · 2 comments

Comments

@Forbin
Copy link

Forbin commented Feb 13, 2014

  1. Not sure where to put the api keys in the Laravel version of geocoder. I do not see how in the config, so I am placing them in the willdurand provider files directly. That does not seem right. With the API keys in those files I am not getting anything back for MapQuest and CloudMade.

  2. I am trying to process about 300,000 addresses for a database. Which provider would be best for that?

@toin0u
Copy link
Member

toin0u commented Feb 14, 2014

Hi @Forbin

  1. This is related to Laravel 4.1 Missing argument 2 for Geocoder\Provider\CloudMadeProvider::__construct() #5 - we need to make a fix to accept constructor argument in configuration. But note that this Laravel version is very much like the Silex version. But a lot of person ask to make it more easier to use by using cofiguration..

But it's possible to do the job without configuration - here is a basic example:

// ...
$adapter = App::make('geocoder.adapter';)
$providers = array(
    new \Geocoder\Provider\CloudMadeProvider($adapter, 'api-key'),
    new \Geocoder\Provider\MapQuestProvider($adapter, 'api-key', 'my-locale'),
);

try {
    // maybe the chain provider is better here :)
    Geocoder::registerProviders($providers);
    Geocoder::using('cloudmade');
    $geocode = Geocoder::geocode('10 rue Gambetta, Paris, France');
    var_dump($geocode);
} catch (\Exception $e) {
    echo $e->getMessage();
}
// ...

Yes it's more work but why not to define your own service ?

  1. I'll use GeoipProvider or MaxMindBinaryProvider. It will be much faster :)

@toin0u
Copy link
Member

toin0u commented May 12, 2014

Version 0.3 should now fix this as well :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants