Convert geopandas shapely polygon to geojson

前端 未结 6 1923
猫巷女王i
猫巷女王i 2021-02-18 19:24

I created a circle using geopandas and it returned a shapely polygon:

POLYGON: ((...))

I want this same polygon as a geojson object. I ran acr

6条回答
  •  悲&欢浪女
    2021-02-18 19:40

    To write a standard geojson object using pandas you shall use the driver provided by fiona as recommended in the documentation

    gdf.to_file('path/to/file.geojson', driver='GeoJSON')
    

    See import fiona; fiona.supported_drivers for a list of fully supported drivers

提交回复
热议问题