regionate.region.Region

class regionate.region.Region(name, lons, lats, force_ccw=False, remove_duplicate_points=False)[source]

Bases: object

A named polygonal region defined by a list or array of geographical coordinates.

Methods

copy([remove_duplicate_points])

Returns a copy of the Region.

make_counterclockwise()

Checks if the section is clockwise and flips its direction if it is to make it counterclockwise.

remove_duplicate_points([closeness_threshold])

Removes any duplicate points.

copy(remove_duplicate_points=False)[source]

Returns a copy of the Region.

Parameters:

remove_duplicate_points (bool) – Default: False. If True, prunes any duplicate points from the input arrays (lons, lats).

Returns:

region_copy – Copy of the region.

Return type:

regionate.region.Region

make_counterclockwise()[source]

Checks if the section is clockwise and flips its direction if it is to make it counterclockwise.

remove_duplicate_points(closeness_threshold=5000.0)[source]

Removes any duplicate points.

Parameters:

closeness_threshold (float) – A short distance within which points are deemed to be identical. Default: 5.e3.