polartoolkit.regions#
Bounding regions for commonly plotted polar regions. In stereographic projections. The format is (xmin, xmax, ymin, ymax), in meters.
Attributes#
Functions#
get all the regions defined in this module. |
|
|
Change a bounding region by shifting the box east/west or north/south, or zooming in |
|
Get the bounding region of 2 regions. |
|
Plot an interactive map, and use the "Draw a Rectangle" button to draw a rectangle |
Module Contents#
- alter_region(starting_region, zoom=0, n_shift=0, w_shift=0)[source]#
Change a bounding region by shifting the box east/west or north/south, or zooming in or out.
- Parameters:
starting_region (tuple[float, float, float, float]) – Initial region in meters in format [xmin, xmax, ymin, ymax]
zoom (float, optional) – zoom in or out, in meters, by default 0
n_shift (float, optional) – shift north, or south if negative, in meters, by default 0
w_shift (float, optional) – shift west, or east if negative, in meters, by default 0
- Returns:
Returns the altered region
- Return type:
- combine_regions(region1, region2)[source]#
Get the bounding region of 2 regions.
- Parameters:
- Returns:
Bounding region of the 2 supplied regions.
- Return type:
- draw_region(**kwargs)[source]#
Plot an interactive map, and use the “Draw a Rectangle” button to draw a rectangle and get the bounding region. Vertices will be returned as the output of the function.
- Returns:
Returns a list of list of vertices for each polyline.
- Return type:
- Parameters:
kwargs (Any)
Example
>>> from polartoolkit import regions, utils ... >>> polygon = regions.draw_region() >>> region = utils.polygon_to_region(polygon, hemisphere="north")