regionmask.from_geopandas

regionmask.from_geopandas(geodataframe, numbers=None, names=None, abbrevs=None, name='unnamed', source=None)

Create regionmask.Region from geopandas.geodataframe.GeoDataFrame.

Parameters
  • geodataframe (geopandas.geodataframe.GeoDataFrame) – GeoDataFrame to be transformed to a Regions class.

  • numbers (str, optional) – Name of the column in geodataframe that gives each region its number. This column must not have duplicates. If None (default), takes geodataframe.index.values.

  • names (str, optional) – Name of the column in shapefile that names a region. Breaks for duplicates. If None (default) uses “Region0”, .., “RegionN”.

  • abbrevs (str, optional) – Name of the column in shapefile that five a region its abbreviation. Breaks for duplicates. If _from_name, a combination of the first letters of region name is taken. If None (default) uses “r0”, .., “rN”.

  • name (str, optional) – name of the regionmask.Region instance created

  • source (str, optional) – source of the shapefile

Returns

regionmask.core.regions.Regions