-
Notifications
You must be signed in to change notification settings - Fork 366
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
Key Error using Natural Earth POV files #2319
Comments
Adding a try/except seems reasonable. I'm a bit confused as to why we don't just extract the members within the file using the namelist directly: https://docs.python.org/3/library/zipfile.html#zipfile.ZipFile.namelist |
I guess that the original idea of extracing these file explicitly is so that if the zipfile doesn't have the critical files it raises an error rather than carries on regardless. should we split into "essential (.shp .dbx .shx)" and the rest. Then raise an error if the essential are not there and warn if any others are missing? cpg should certainly be optional based on: Some info on extensions is here:
|
Description
When trying to use Natural Earth's POV shapefiles, the unzipping step fails because they do not include a
.cpg
file. I wonder if we just need a try-except around thegetinfo
call. Having said that, out of the listcartopy/lib/cartopy/io/shapereader.py
Line 342 in ec891b0
we only appear to use
.shp
and.shx
in other parts of the library. So is there a reason we are unpacking all of them?Code to reproduce
Traceback
On first run, when Cartopy is downloading and unzipping the files I get
On second run, the plot works fine.
Full environment definition
Operating system
RHEL7
Cartopy version
0.22 and
main
conda list
pip list
The text was updated successfully, but these errors were encountered: