regionmask.Regions_cls

class regionmask.Regions_cls(name, numbers, names, abbrevs, outlines, centroids=None, source='')

class for plotting regions and creating region masks

Attributes

numbers list of the numbers of the regions
names list of long names
abbrevs list of abbreviations
centroids list of the center of mass of the regions
name (string) Name of the collection of regions.
outlines (List of Nx2 float array of vertices, Polygon, MultiPolygon) List of coordinates/ outline of the region as shapely Polygon/ MultiPolygon or list. Must be accessible as outlines[number].
__init__(name, numbers, names, abbrevs, outlines, centroids=None, source='')
Parameters:

name : string

Name of the collection of regions.

numbers : list of int

List of numerical indces for every region.

names : dict of string

Long name of each region. Must be accessible as names[number].

abbrevs : dict of string

List of abbreviations of each region. Must be accessible as abbrevs[number].

outlines : List of Nx2 float array of vertices, Polygon, MultiPolygon

List of coordinates/ outline of the region as shapely Polygon/ MultiPolygon or list. Must be accessible as outlines[number].

centroids : list of 1x2 iterable, optional.

Center of mass of this region. If not provided is calculated as (Multi)Polygon.centroid

source : string, optional

Source of the region definitions. Default: ‘’.

Methods

__init__(name, numbers, names, abbrevs, outlines)
Parameters:
combiner(prop)
map_keys(key) map from names and abbrevs of the regions to numbers
mask(lon_or_obj[, lat, lon_name, lat_name, …]) create a grid as mask of a set of regions for given lat/ lon grid
plot([ax, proj, regions, add_label, label, …]) plot map with with srex regions

Attributes

abbrevs list of abbreviations
centroids list of the center of mass of the regions
coords list of coordinates of the region vertices as numpy array
names list of long names
numbers list of the numbers of the regions
polygons list of shapely Polygon/ MultiPolygon of the regions
region_ids dict mapping all names and abbrevs to the region number