get_geodf#

get_geodf(geometry: Union[shapely.geometry.polygon.Polygon, list, geopandas.geoseries.GeoSeries], crs: str) geopandas.geodataframe.GeoDataFrame[source]#

Get a GeoDataFrame from a geometry and a crs

>>> poly = Polygon(((0., 0.), (0., 1.), (1., 1.), (1., 0.), (0., 0.)))
>>> geodf = get_geodf(poly, crs=WGS84)
>>> print(geodf)
                                            geometry
0  POLYGON ((0.00000 0.00000, 0.00000 1.00000, 1....
Parameters
  • geometry (Union[Polygon, list]) – List of Polygons, or Polygon or bounds

  • crs (str) – CRS of the polygon

Returns

Geometry as a geodataframe

Return type

gpd.GeoDataFrame