我在GeoPandas数据框中有一列,其中包含类似this'{type=Point, coordinates=[37.55, 55.71]}'
或this的字符串'{type=MultiPoint, coordinates=[[37.6, 55.4]]}'
。它可以是多边形或任何其他几何形状。然后有嵌套列表形式的几点。如何将其转换为普通的GeoPandas几何对象?
使用shapely.geometry.shape
转换GeoJSON的字符串,身材匀称的几何形状。
from shapely.geometry import shape
df['geometry'] = df.apply(lambda: row: shape(row['jsoncolumn']), axis=1)
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句