question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

EarthLocation.of_address now fails because Google maps API requires a key

See original GitHub issue

As of June 2018, the Google maps API requires a dev key. This breaks EarthLocation.of_address.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
pllimcommented, Oct 18, 2018

It is not good practice to publish the key, so if the env variable is publicly accessible when added to CI, please don’t do it. And to obtain the key, it needs to be associated to a Google Account (I guess you can use any existing project Gmail for that). I agree with @eteq that testing with the key is not worth the trouble.

1reaction
eteqcommented, Oct 18, 2018

I like @astrofrog’s suggestion of defaulting to OSM: https://wiki.openstreetmap.org/wiki/Nominatim has the info on that. From that you can do e.g.: https://nominatim.openstreetmap.org/search.php?q=3700+san+martin+dr%2C+baltimore%2C+md&format=json, and the first result indeed turns out to be the correct one (STScI). The JSON is not too different from what google provides so it Should Be A Quick Fix™️.

So I’d propose the following as a solution:

  1. default to OSM
  2. @pllim’s suggestion of introducing a google_key keyword to get back the old behavior. The docstring can provide links to the google developer console and instructions on how to get that. Not sure how to implement this in the tests, but probably just not worth it at this point?
Read more comments on GitHub >

github_iconTop Results From Across the Web

Error Messages | Maps JavaScript API - Google Developers
Go to the Billing page in the Google Cloud Console and select the project under which your API key was created. To confirm...
Read more >
This IP, site or mobile application is not authorized to use this ...
I had the same issue and I found this. On the url, it requires the server key in the end and not the...
Read more >
Breaking Down Geocoding in R: A Complete Guide
Unlike Google Maps, Nominatim does not require you to register any account and get an API key. But if you want to use...
Read more >
Google Maps Platform - Location and Mapping Solutions
Create real world and real time experiences for your customers with dynamic maps, routes & places APIs from Google Maps Platform's location solutions....
Read more >
Authenticate using API keys - Google Cloud
The API key associates the request with a Google Cloud project for billing and quota purposes. Because API keys do not identify the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found