matplotlib / matplotlib/basemap
readshapefile() raises incorrect error msg regarding shpproj and shapelib
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Python
- Sterne
- 817
- Forks
- 395
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
When 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
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginnen Sie am Einstiegspunkt readshapefile() und untersuchen Sie den Fehlerpfad, der shpproj aus shapelib empfiehlt. Reproduzieren Sie die gemeldete Konvertierung und anschließend den Fehler „only handle 2D shape types“, und bestimmen Sie dann, ob die Anleitung oder die Verarbeitung fehlerhaft ist. Als erledigt gilt die Aufgabe, wenn die Fehlermeldung und die Konvertierungsanleitung die verfügbaren Tools und unterstützten Shape-Typen korrekt wiedergeben.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- python
- Bereich
- data-visualization
- Issue-Typ
- Bug
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Muss geklärt werden
- Anfängerfreundlichkeit
- 35/100