matplotlib / basemap

Plot on map projections (with coastlines and political boundaries) using matplotlib
MIT License
772 stars 390 forks source link

Add an option encoding_errors to readshapefile #554

Closed guziy closed 1 year ago

guziy commented 1 year ago

addresses #552

molinav commented 1 year ago

It should be harmless to merge this feature, since it adds a new argument and defaults to the former behaviour, right?

So far it looks good to me. Being a "new feature", I would then bump the basemap version to 1.4.0 soon. But before that I had in mind to fix some of the remaining bugs in the 1.3.x series, just that I didn't find a free spot in my calendar to do it.

guziy commented 1 year ago

Thanks @molinav: Yes to your question, this simply adds a new argument with the default value strict which is the current default in pyshp. To avoid the trouble of searching for the right encoding for those who don't need actual strings from the .dbf, they could just set encoding_errors="ignore".

Related question on stackoverflow: https://stackoverflow.com/questions/42103455/utf-8-codec-cant-decode-when-using-readshapefile-on-python-basemap/59262192#59262192

molinav commented 1 year ago

Thanks for the contribution and the feedback, @guziy!