Skip to content
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

can't seem to get elevation from google #462

Open
dotysan opened this issue Sep 25, 2023 · 3 comments · May be fixed by #463
Open

can't seem to get elevation from google #462

dotysan opened this issue Sep 25, 2023 · 3 comments · May be fixed by #463

Comments

@dotysan
Copy link

dotysan commented Sep 25, 2023

Using the example straight out of the documentation.

$ geocode '45.15, -75.14' --provider google --method elevation
null

@dotysan
Copy link
Author

dotysan commented Sep 25, 2023

So there appears to be a new API for this.

curl "https://maps.googleapis.com/maps/api/elevation/json?locations=45.15,-75.14&key=$GOOGLE_API_KEY"

{
   "error_message" : "This API key is not authorized to use this service or API.",
   "results" : [],
   "status" : "REQUEST_DENIED"
}

And after enabling the Maps Elevation API and adding it to my key:
curl "https://maps.googleapis.com/maps/api/elevation/json?locations=45.15,-75.14&key=$GOOGLE_API_KEY"

{
   "results" : 
   [
      {
         "elevation" : 70.44151306152344,
         "location" : 
         {
            "lat" : 45.15,
            "lng" : -75.14
         },
         "resolution" : 38.17580795288086
      }
   ],
   "status" : "OK"
}

@dotysan
Copy link
Author

dotysan commented Sep 25, 2023

Further poking around reveals that method='elevation' isn't passing the API key onto the params dict.

@dotysan
Copy link
Author

dotysan commented Sep 25, 2023

Duplicate of #376. I guess this project is dead.

@dotysan dotysan linked a pull request Sep 26, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant