matplotlib / matplotlib/basemap
readshapefile fails on certain filenames
Nessuno ha ancora preso questa issue.
- Lingua principale
- Python
- Stelle
- 817
- Fork
- 395
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
Hi,
(Tested with basemap 1.0.6)
This works:
`m.readshapefile('foo.shp', 'my_shape')`
while this fails:
`m.readshapefile('bar_0.1.shp', 'my_shape')`
```
raise IOError('error reading shapefile %s.shp' % shapefile)
fields = shf.fields
coords = []; attributes = []
IOError: error reading shapefile bar_0.1.shp
```
Note that foo.shp and bar_0.1.shp are exactly the same file except for the filename. So it seems that the additional `.` causes the problem. Minimal example to reproduce behavior:
Rename `huralll020.{shp,dfb,shx}` to `huralll020_0.1.{shp,dbf,shx}` and change filename in `examples/hurrtracks.py` accordingly. Run hurrtracks.py.
Of course the obvious workaround is not to use `.` in filenames. But this is somewhat impracticable as I have a large number or files and would like keeping the filenames consistent accross filetypes (netCDF, shapfiles, pngs, etc).
Is there an easy fix?
Thanks very much,
Andy
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia dal punto di ingresso readshapefile e dalla riproduzione in examples/hurrtracks.py. Rinomina i componenti dello shapefile huralll020 come descritto, esegui hurrtracks.py e analizza perché il nome file con il punto non funziona. Il lavoro è completato quando lo stesso shapefile può essere letto con un nome file come huralll020_0.1 e l'esempio esistente continua a funzionare.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- python
- Ambito
- data
- Tipo di issue
- Bug
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 45/100