Convert geopandas shapely polygon to geojson

前端 未结 6 1907
猫巷女王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:44

    Something like this should do the trick:

    features = [{'type': 'Feature', 'properties': {}, 'geometry': shapely.geometry.mapping(shapelyObject)}]
    

    Now you can try to map features in mapbox. Hope this helps.

    Reference: https://gis.stackexchange.com/questions/213717/geometry-workflow-from-shapely-to-geojson

提交回复
热议问题