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.

Plotting from geocode consistently errors

See original GitHub issue

Running the example code gmplot.GoogleMapPlotter.from_geocode("San Francisco") used to work exactly as described.

Now it consistently errors list index out of range Swapping for lat/lon version works fine (gmplot.GoogleMapPlotter(37.766956, -122.438481, 13))

Full error


IndexError Traceback (most recent call last) <ipython-input-130-02f152c69777> in <module>() ----> 1 a_map = gmplot.GoogleMapPlotter.from_geocode(“San Francisco”)

/Users/scottieb/anaconda/envs/GDAL/lib/python3.6/site-packages/gmplot/gmplot.py in from_geocode(cls, location_string, zoom) 32 33 @classmethod —> 34 def from_geocode(cls, location_string, zoom=13): 35 lat, lng = cls.geocode(location_string) 36 return cls(lat, lng, zoom)

/Users/scottieb/anaconda/envs/GDAL/lib/python3.6/site-packages/gmplot/gmplot.py in geocode(self, location_string) 40 geocode = requests.get( 41 ‘http://maps.googleapis.com/maps/api/geocode/json?address=“%s”’ % location_string) —> 42 geocode = json.loads(geocode.text) 43 latlng_dict = geocode[‘results’][0][‘geometry’][‘location’] 44 return latlng_dict[‘lat’], latlng_dict[‘lng’]

IndexError: list index out of range

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

0reactions
frslmcommented, Apr 21, 2020

Fixed in #111.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Plotting from geocode consistently errors · Issue #82 - GitHub
Running the example code gmplot.GoogleMapPlotter.from_geocode("San Francisco") used to work exactly as described. Now it consistently errors ...
Read more >
How to geocode a table of invalid/incorrect locations in R?
I am trying to plot those data in a map in R. The problem is users have given invalid/incorrect addresses which causes geocode...
Read more >
Evaluating two freely available geocoding tools for ...
Geocoding is highly prone to error for various reasons. This paper examines the geographical inconsistencies associated with geocoding errors ...
Read more >
Fixing geocoding issues - TIBCO Product Documentation
Below are some tips of what you can do to fix some geocoding issues. ... The title of a column does not always...
Read more >
qgis - Why do I get the same error code when Geocoding?
Whenever I use the 'MMQGIS' plug in to 'Geocode' a CSV file ... to plot the locations as a layer on QGIS, it...
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