Fail on basemap.drawcounties() Python 3.5.2
See original GitHub issuePlatform:
Python 3.5.2 |Continuum Analytics, Inc.| (default, Jul 2 2016, 17:53:06)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux
Throws error on basemap.drawcounties() (over Illinois)
Traceback (most recent call last):
File "animate_aws.py", line 171, in <module>
writer='imagemagick', fps=5)
File "/home/scollis/anaconda/envs/pyart35/lib/python3.5/site-packages/matplotlib/animation.py", line 832, in save
anim._init_draw()
File "/home/scollis/anaconda/envs/pyart35/lib/python3.5/site-packages/matplotlib/animation.py", line 1221, in _init_draw
self._draw_frame(next(self.new_frame_seq()))
File "/home/scollis/anaconda/envs/pyart35/lib/python3.5/site-packages/matplotlib/animation.py", line 1243, in _draw_frame
self._drawn_artists = self._func(framedata, *self._args)
File "animate_aws.py", line 166, in animate
display.basemap.drawcounties()
File "/home/scollis/anaconda/envs/pyart35/lib/python3.5/site-packages/mpl_toolkits/basemap/__init__.py", line 1980, in drawcounties
default_encoding='latin-1',drawbounds=drawbounds)
File "/home/scollis/anaconda/envs/pyart35/lib/python3.5/site-packages/mpl_toolkits/basemap/__init__.py", line 2146, in readshapefile
for shprec in shf.shapeRecords():
File "/home/scollis/anaconda/envs/pyart35/lib/python3.5/site-packages/mpl_toolkits/basemap/shapefile.py", line 543, in shapeRecords
for rec in zip(self.shapes(), self.records())]
File "/home/scollis/anaconda/envs/pyart35/lib/python3.5/site-packages/mpl_toolkits/basemap/shapefile.py", line 515, in records
r = self.__record()
File "/home/scollis/anaconda/envs/pyart35/lib/python3.5/site-packages/mpl_toolkits/basemap/shapefile.py", line 491, in __record
value = u(value)
File "/home/scollis/anaconda/envs/pyart35/lib/python3.5/site-packages/mpl_toolkits/basemap/shapefile.py", line 58, in u
return v.decode('utf-8')
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xf1 in position 2: invalid continuation byte
Issue Analytics
- State:
- Created 7 years ago
- Reactions:3
- Comments:23 (13 by maintainers)
Top Results From Across the Web
python 3.x - Matplotlib Basemap drawcounties having issues
I have looked in previous issues with other users about the Matplotlib basemap function "draw counties", but it has not resolved my issue....
Read more >Basemap tutorial Documentation - Read the Docs
Basemap is a great tool for creating maps using python in a simple way. It's a matplotlib extension, so it has got all...
Read more >matplotlib - Bountysource
I use PyCharm but can't install error basemap. Please check installation. ... Python : 2.7 ... Throws error on basemap.drawcounties() (over Illinois)
Read more >Basemap Customization with Matplotlib
In this Matplotlib tutorial, we continue with the Basemap geographic plotting ... m.drawcounties(color='darkred') plt.title('Basemap Tutorial') plt.show().
Read more >basemap - PyPI
python -m pip install basemap. If you need to install from source, please visit the GitHub repository for a step-by-step description.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I have the same problem. I’ve solved it. I replace all “utf-8” with “latin-1” in shapefile.py, which located in ~/Library/Python/3.7/lib/python/site-packages/shapefile.py
Created #340 that should help fix this
On Thu, Feb 2, 2017 at 2:16 PM, Benjamin Root ben.v.root@gmail.com wrote: