2017-09-24 76 views
1

我是新来的python,我想打开一个形状文件,但当我打开文件时,我收到一条消息,说“壳不是线性环”当我尝试通过命令行打开它时发出消息。我的代码是两条线长,所以我真的不知道怎么回事就在这里......Python Geopandas投掷“壳不是线性环”错误

代码:

import geopandas as gpd 

gdp.read_file("tl_2016_17_tract.shp") 

错误:

“壳牌是不是一个线性环”

我我也尝试用R和QGIS打开形状文件,并且都正常工作。我认为这可能与我的python安装有关,因为我之前遇到过一些问题。我找不到任何地方的错误“Shell不是LinearRing”的一个很好的解释!

感谢您的帮助!

+0

您好,我能够下载并成功打开此文件https://catalog.data.gov/dataset/tiger- line-shapefile-2016-state-illinois-current-census-tract-state-based,我相信你的是一样的。我使用的是geopandas 0.3.0和fiona 1.7.8(fiona处理geopandas的读取)。关于你的错误,我不知道该怎么做。也许是一个腐败的文件? –

回答

0

有相同问题的用户说:

I resolved this issue - I believe it had to do with geopandas and how it was installed. I resolved it by using:

conda remove geopandas

I originally installed via conda-forge channel

and then installing via pip:

pip install geopandas

I also went through and installed some packaged via homebrew, but I am not sure if that made a difference.

Source