shpを読み込んで、shp内のポリゴンを結合し、再び出力したいです。
以下のようなエラーが出ます。
AttributeError: 'MultiPolygon' object has no attribute 'to_file'
恐らく、shp内のポリゴンを結合したら、マルチポリゴンになり、to_fileでは出力できないという意味と思っています。
マルチポリゴンでも出力するにはどうすれば良いでしょうか。
コード
gdf_res = gpd.read_file(dir_input1/input_file, encoding='cp932')
gdf_res=gdf_res["geometry"].unary_union
gdf_res.to_file(dir_output/output_file,encoding='cp932')
print('Output: ',dir_output/output_file)
すみません、pytohnです。
回答1件
あなたの回答
tips
プレビュー