3
ジオメトリを使用してデータファイルをシェープファイルとして保存すると、次のエラーが発生します。pythonでgeopandasを使用してデータファイルをシェープファイルに保存すると、boolのValueErrorが発生します
geometry = [Point(xy) for xy in zip(df.longitude, df.latitude)]
dfout = geopandas.GeoDataFrame(df, geometry=geometry)
dfout.to_file(outputpath, driver='ESRI Shapefile')
Traceback (most recent call last):
File "test.py", line 230, in <module>
main()
File "test.py", line 223, in main
createSHP(df,outputpath)
File "test.py", line 150, in createSHP
dfout.to_file(outputpath, driver='ESRI Shapefile')
File "/home/ubuntu/anaconda2/lib/python2.7/site-packages/geopandas/geodataframe.py", line 343, in to_file
to_file(self, filename, driver, schema, **kwargs)
File "/home/ubuntu/anaconda2/lib/python2.7/site-packages/geopandas/io/file.py", line 61, in to_file
schema=schema, **kwargs) as c:
File "/home/ubuntu/anaconda2/lib/python2.7/site-packages/fiona/__init__.py", line 178, in open
enabled_drivers=enabled_drivers, crs_wkt=crs_wkt)
File "/home/ubuntu/anaconda2/lib/python2.7/site-packages/fiona/collection.py", line 155, in __init__
self.session.start(self, **kwargs)
File "fiona/ogrext.pyx", line 961, in fiona.ogrext.WritingSession.start (fiona/ogrext.c:16015)
ValueError: 'bool' is not in list
このエラーの意味を知ることはできませんでした。
どのバージョンのpython/geopandas/fionaをお使いですか?ジオメトリフィールドに空のデータがありますか? Python 3.4、geopandas 0.2.1、fiona 1.7.1のランダムフロートデータでエラーを再現できません。 –
'df.info()'の出力を表示できますか?特定の列のサブセットのみを書き込むときに同じエラーが発生するかどうかを確認できますか? – joris
@joris実際にはいくつかの列にnull値が存在しているので、私はcsvに保存できません。だから私は必要な列をnewdfを作成し、それは私の問題を解決しました。 – user99