<P>似乎您的SuffEFILE包含非UTF字符,这些字符导致^ {CD1>}调用失败(GeopDaas使用菲奥娜打开文件)。在</p>
<p>解决这个错误的方法是打开Shapefile(例如使用QGis),然后选择<code>save as</code>,并将<code>Encoding</code>选项指定为“UTF-8”:</p>
<p><a href="https://i.stack.imgur.com/lSt78.png" rel="noreferrer"><img src="https://i.stack.imgur.com/lSt78.png" alt="enter image description here"/></a></p>
<p>这样做之后,我在调用<code>df = gpd.read_file("convertedShape.shp")</code>时没有出错。在</p>
<hr/>
<p>另一种不必使用QGis或类似工具的方法是再次读取并保存Shapefile(有效地转换为所需的格式)。使用OGR,您可以执行以下操作:</p>
<pre><code>from osgeo import ogr
driver = ogr.GetDriverByName("ESRI Shapefile")
ds = driver.Open("nbac_2016_r2_20170707_1114.shp", 0) #open your shapefile
#get its layer
layer = ds.GetLayer()
#create new shapefile to convert
ds2 = driver.CreateDataSource('convertedShape.shp')
#create a Polygon layer, as the one your Shapefile has
layer2 = ds2.CreateLayer('', None, ogr.wkbPolygon)
#iterate over all features of your original shapefile
for feature in layer:
#and create a new feature on your converted shapefile with those features
layer2.CreateFeature(feature)
ds = layer = ds2 = layer2 = None
</code></pre>
<p>这也使得在转换后可以用<code>df = gpd.read_file("convertedShape.shp")</code>成功打开。希望这有帮助。在</p>