本文介绍了Fiona读取数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在使用geopandas读取数据时遇到问题,但根据此 post 我试图将fiona重新安装到1.1.6版本,但仍然无法正常工作..

I have problems concerning reading data using geopandas , but it seems the error is due to fiona according to this post I tried to reinstall fiona to 1.1.6 version, but still it does not work..

导入fiona 使用fiona.open('taz.shp')作为src: 对于src中的功能: 打印功能

import fiona with fiona.open('taz.shp') as src: for feature in src: print feature

---------------------------------------------------------------------------
IndexError                                Traceback (most recent call last)
<ipython-input-31-b70513efc12b> in <module>()
      1 import fiona
      2 with fiona.open('taz.shp') as src:
----> 3     for feature in src:
      4         print feature

fiona/ogrext.pyx in fiona.ogrext.Iterator.__next__ (fiona/ogrext.c:17244)()

fiona/ogrext.pyx in fiona.ogrext.FeatureBuilder.build (fiona/ogrext.c:3254)()

IndexError: list index out of range

但是当我编写其他类似的脚本时,它似乎可以工作

But when I write other similar script, it seems to work

c = fiona.open('taz.shp', 'r')
print c
<open Collection 'taz.shp:taz', mode 'r' at 0x106f51dd0>

推荐答案

我经历了与您相同的挫败感,直到最终使它起作用.以下程序包可一起稳定运行:

I went through the same frustration as you until I made it finally working. The following packages work stable together:

GDAL: 1.11.2
Fiona: 1.6.0
Geopandas: 0.1.0.dev-

有关如何安装的详细说明,请查看有关此问题的其他文章: https://stackoverflow.com/a/37634515/5853731

For detailed explanation on how to install it check out my other post on this issue: https://stackoverflow.com/a/37634515/5853731

这篇关于Fiona读取数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-09 02:47