将单个多边形分割成多个多边形geopandas

问题描述 投票:0回答:1

我有一个 shapefile,我正在将其转换为 wkt 以与其他一些数据连接。不幸的是,某些多边形字段值对于 Excel 的字符串限制 (30,000) 来说太长。如果字符串长度超过某个值,如何拆分多边形列。

我使用了geopandas方法explode(),但它并不能解决所有情况。

import geopandas
myshpfile = geopandas.read_file("cb_2018_us_county_500k/cb_2018_us_county_500k.shp") 
gd = geopandas.GeoDataFrame(myshpfile)
exploded = gd.explode(index_parts=True)
exploded.to_file('test_county_exploded.csv', driver='CSV', geometry= 'AS_WKT')
python geometry polygon geopandas shapefile
1个回答
0
投票

不要使用Excel文件来存储几何图形

© www.soinside.com 2019 - 2024. All rights reserved.