- regionmask.from_geopandas(geodataframe, *, numbers=None, names=None, abbrevs=None, name='unnamed', source=None, overlap=False)
geodataframe (geopandas.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
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
source (str, optional) – source of the shapefile
overlap (bool, default: False) – Indicates if (some of) the regions overlap. If True
mask_3Dwill ensure overlapping regions are correctly assigned to grid points while
maskwill error (because overlapping regions cannot be represented by a 2D mask).
If False (default) assumes non-overlapping regions. Grid points will silently be assigned to the region with the higher number (this may change in a future version).
There is (currently) no automatic detection of overlapping regions.