matplotlib / matplotlib/basemap

readshapefile fails on certain filenames

オープン
#151 コメント 7 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

主要言語
Python
スター
817
フォーク
395
PR マージ指標
30日以内にマージされた PR はありません

説明

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

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

readshapefile エントリポイントと examples/hurrtracks.py の再現から始めます。説明されているとおりに huralll020 の shapefile コンポーネントの名前を変更し、hurrtracks.py を実行して、ドットを含むファイル名が失敗する理由を追跡します。同じ shapefile を huralll020_0.1 のようなファイル名で読み込め、既存の例も引き続き動作すれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
python
領域
data
issue の種類
バグ
難易度
2/5
見積もり時間
1〜3時間
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
45/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。