get_geodf

Contents

get_geodf#

get_geodf(geom: Polygon | list | GeoSeries, crs: str) GeoDataFrame[source]#

Get a GeoDataFrame from a geometry and a crs

Parameters:
  • geom (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

Example

>>> 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....