地geopandas-多角形到多边形几何形状
几何
在我的Geopandas dataFrame中是类型 Polygon
和 MultipolyGon
。我想将多龙门
转换为多边形
,因为我在数据上运行一些空间功能有问题。
from shapely.geometry import MultiPolygon, Polygon
import geopandas as gpd
from shapely import wkt
gdf = gpd.read_file()
# To GeoPandas
gdf['geometry'] = gdf['zip_code_geom'].apply(wkt.loads)
# Set Geometry
gdf = gdf.GeoDataFrame(df_rent_geo_v7, geometry='geometry')
# MultiPolygon to Polygon
gdf = gdf.explode(column='geometry', ignore_index=True, index_parts=False)
我尝试使用 [eskext] [1] [1]
,如其他类似问题,但是它不会将 Multipolygons
转换为多边形
。
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您的示例数据中有不良的几何形状。这将转换有效的问题,并将坏的存储在BAD_GEOM_DICT中进行进一步调查。在有效的Geoms上爆炸作品。
There are bad geometries in your example data. This will convert the valid ones and store the bad ones in the bad_geom_dict for further investigation. Explode works on the valid geoms.