'How can to convert a shapely polygon dict to geojson format

I am new to shapely and am running into a small issue with the format, and I hope someone here can help me, or point me in the right direction.

I am constructing voronoi polygons, by using this package: geovoronoi https://github.com/WZBSocialScienceCenter/geovoronoi/blob/master/examples/using_geopandas.py

And the instructions are clear, and the plot of the polygons looks good, but now I would like to use the polygons. When checking the object I see this:

Type:        dict
String form: {0: <shapely.geometry.polygon.Polygon object at 0x0000029A9E47F6D0>, 1: <shapely.geometry.polygon <...> ject at 0x0000029AA8B08CA0>, 41: <shapely.geometry.polygon.Polygon object at 0x0000029AA8B08D00>}
Length:      42

So, that is good, but how do I convert this polygon object to something more useful, like a geojson or geopandas dataframe? It must be something very basic, but as I am new to this format I might have missed it while reading the documentation. Thanks in advance, Gijs



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source