readshapefile() raises incorrect error msg regarding shpproj and shapelib
See original GitHub issueWhen plotting a shapefile using readshapefile()
m.readshapefile(shapefile_path, 'roads')
I received this error message:
ValueError: shapefile must have lat/lon vertices - it looks like this one has vertices in map projection coordinates. You can convert the shapefile to geographic coordinates using the shpproj utility from the shapelib tools (http://shapelib.maptools.org/shapelib-tools.html)
However, it appears that the specified module “shapelib” is no longer maintained or available. To add to the confusion, there is a completely different module that also goes by the name “shapelib” available on pypi and github, but that does not contain the functionality suggested above.
In regard to a suggested solution. I found the fix on this site to be useful for converting the shapefile and getting past this readshapefile() error. http://fascicul.us/convert-display-shapefile-matplotlib.html
However, this conversion sometimes leads to a new error:
ValueError: readshapefile can only handle 2D shape types
Which I have yet to find a way to resolve
Issue Analytics
- State:
- Created 7 years ago
- Comments:6 (3 by maintainers)

Top Related StackOverflow Question
Hi, This error was getting resolved by using geopandas and setting the shape file crs to null as follows
Using the resultant shape file resolves the error.
I just want to add (for anyone who can help in the future) that I resolve this problem converting my shapefile through this web: https://mygeodata.cloud/