maps.domains.optimal

Module Contents

Classes

AlbersEqualArea

CRS

Equatorial

A domain with a central longitude < ±25 degrees, covering < 20% of the globe.

Extents

Global

A domain which covers >60% of the globe.

LambertAzimuthalEqualArea

Landscape

A non-equitorial domain with an aspect ratio > 1.2.

LargeEqatorial

A domain with a central longitude < ±25 degrees, covering > 20% of the globe.

NorthPolar

A domain with a central longitude > 75 degrees.

NorthPolarStereo

PlateCarree

Portrait

A non-equitorial domain with an aspect ratio < 0.8.

SouthPolar

A domain with a central longitude < -75 degrees.

SouthPolarStereo

Square

A non-equitorial domain with an aspect ratio > 0.8 and < 1.2.

TransverseMercator

Functions

crs_from_bounds(bounds)

Get an 'optimal' CRS to use for the given latitude and longitude extents.

Attributes

GLOBE_AREA

class maps.domains.optimal.AlbersEqualArea

Bases: CRS

CENTRAL_LATITUDE = 'central_lat'
CENTRAL_LONGITUDE = 'central_lon'
STANDARD_PARALLELS = 'standard_parallels'
cartopy_crs()
get_kwargs(domain)
to_ccrs(domain)
class maps.domains.optimal.CRS
cartopy_crs()
get_kwargs(domain)
to_ccrs(domain)
class maps.domains.optimal.Equatorial(extents, small_threshold=0.2, large_threshold=0.6)

Bases: Extents

A domain with a central longitude < ±25 degrees, covering < 20% of the globe.

property area
property central_lat
property central_lon
property max_lat
property max_lon
property min_lat
property min_lon
property ratio
property standard_parallels
CRS
get_crs()
is_equatorial()

Equatorial domains are centered around the equator.

is_global()

Global domains cover > 60% of the globe.

is_landscape()

Landscape domains are at leadt 20% wider than they are tall.

is_large()

Large domains cover < 60% of the globe but > 20%.

is_polar()

Polar domains are centered around a pole.

is_portrait()

Portrait domains are at least 20% taller than they are wide.

is_small()

Small domains cover < 20% of the globe.

is_square()

Square domains have a width and height within 20% of each other.

mutate()
class maps.domains.optimal.Extents(extents, small_threshold=0.2, large_threshold=0.6)
property area
property central_lat
property central_lon
property max_lat
property max_lon
property min_lat
property min_lon
property ratio
property standard_parallels
CRS
get_crs()
is_equatorial()

Equatorial domains are centered around the equator.

is_global()

Global domains cover > 60% of the globe.

is_landscape()

Landscape domains are at leadt 20% wider than they are tall.

is_large()

Large domains cover < 60% of the globe but > 20%.

is_polar()

Polar domains are centered around a pole.

is_portrait()

Portrait domains are at least 20% taller than they are wide.

is_small()

Small domains cover < 20% of the globe.

is_square()

Square domains have a width and height within 20% of each other.

mutate()
maps.domains.optimal.GLOBE_AREA = 64800
class maps.domains.optimal.Global(extents, small_threshold=0.2, large_threshold=0.6)

Bases: Extents

A domain which covers >60% of the globe.

property area
property central_lat
property central_lon
property max_lat
property max_lon
property min_lat
property min_lon
property ratio
property standard_parallels
CRS
get_crs()
is_equatorial()

Equatorial domains are centered around the equator.

is_global()

Global domains cover > 60% of the globe.

is_landscape()

Landscape domains are at leadt 20% wider than they are tall.

is_large()

Large domains cover < 60% of the globe but > 20%.

is_polar()

Polar domains are centered around a pole.

is_portrait()

Portrait domains are at least 20% taller than they are wide.

is_small()

Small domains cover < 20% of the globe.

is_square()

Square domains have a width and height within 20% of each other.

mutate()
class maps.domains.optimal.LambertAzimuthalEqualArea

Bases: CRS

CENTRAL_LATITUDE = 'central_lat'
CENTRAL_LONGITUDE = 'central_lon'
cartopy_crs()
get_kwargs(domain)
to_ccrs(domain)
class maps.domains.optimal.Landscape(extents, small_threshold=0.2, large_threshold=0.6)

Bases: Extents

A non-equitorial domain with an aspect ratio > 1.2.

property area
property central_lat
property central_lon
property max_lat
property max_lon
property min_lat
property min_lon
property ratio
property standard_parallels
CRS
get_crs()
is_equatorial()

Equatorial domains are centered around the equator.

is_global()

Global domains cover > 60% of the globe.

is_landscape()

Landscape domains are at leadt 20% wider than they are tall.

is_large()

Large domains cover < 60% of the globe but > 20%.

is_polar()

Polar domains are centered around a pole.

is_portrait()

Portrait domains are at least 20% taller than they are wide.

is_small()

Small domains cover < 20% of the globe.

is_square()

Square domains have a width and height within 20% of each other.

mutate()
class maps.domains.optimal.LargeEqatorial(extents, small_threshold=0.2, large_threshold=0.6)

Bases: Extents

A domain with a central longitude < ±25 degrees, covering > 20% of the globe.

property area
property central_lat
property central_lon
property max_lat
property max_lon
property min_lat
property min_lon
property ratio
property standard_parallels
CRS
get_crs()
is_equatorial()

Equatorial domains are centered around the equator.

is_global()

Global domains cover > 60% of the globe.

is_landscape()

Landscape domains are at leadt 20% wider than they are tall.

is_large()

Large domains cover < 60% of the globe but > 20%.

is_polar()

Polar domains are centered around a pole.

is_portrait()

Portrait domains are at least 20% taller than they are wide.

is_small()

Small domains cover < 20% of the globe.

is_square()

Square domains have a width and height within 20% of each other.

mutate()
class maps.domains.optimal.NorthPolar(extents, small_threshold=0.2, large_threshold=0.6)

Bases: Extents

A domain with a central longitude > 75 degrees.

property area
property central_lat
property central_lon
property max_lat
property max_lon
property min_lat
property min_lon
property ratio
property standard_parallels
CRS
get_crs()
is_equatorial()

Equatorial domains are centered around the equator.

is_global()

Global domains cover > 60% of the globe.

is_landscape()

Landscape domains are at leadt 20% wider than they are tall.

is_large()

Large domains cover < 60% of the globe but > 20%.

is_polar()

Polar domains are centered around a pole.

is_portrait()

Portrait domains are at least 20% taller than they are wide.

is_small()

Small domains cover < 20% of the globe.

is_square()

Square domains have a width and height within 20% of each other.

mutate()
class maps.domains.optimal.NorthPolarStereo

Bases: CRS

CENTRAL_LONGITUDE = 'central_lon'
cartopy_crs()
get_kwargs(domain)
to_ccrs(domain)
class maps.domains.optimal.PlateCarree

Bases: CRS

CENTRAL_LONGITUDE = 'central_lon'
cartopy_crs()
get_kwargs(domain)
to_ccrs(domain)
class maps.domains.optimal.Portrait(extents, small_threshold=0.2, large_threshold=0.6)

Bases: Extents

A non-equitorial domain with an aspect ratio < 0.8.

property area
property central_lat
property central_lon
property max_lat
property max_lon
property min_lat
property min_lon
property ratio
property standard_parallels
CRS
get_crs()
is_equatorial()

Equatorial domains are centered around the equator.

is_global()

Global domains cover > 60% of the globe.

is_landscape()

Landscape domains are at leadt 20% wider than they are tall.

is_large()

Large domains cover < 60% of the globe but > 20%.

is_polar()

Polar domains are centered around a pole.

is_portrait()

Portrait domains are at least 20% taller than they are wide.

is_small()

Small domains cover < 20% of the globe.

is_square()

Square domains have a width and height within 20% of each other.

mutate()
class maps.domains.optimal.SouthPolar(extents, small_threshold=0.2, large_threshold=0.6)

Bases: Extents

A domain with a central longitude < -75 degrees.

property area
property central_lat
property central_lon
property max_lat
property max_lon
property min_lat
property min_lon
property ratio
property standard_parallels
CRS
get_crs()
is_equatorial()

Equatorial domains are centered around the equator.

is_global()

Global domains cover > 60% of the globe.

is_landscape()

Landscape domains are at leadt 20% wider than they are tall.

is_large()

Large domains cover < 60% of the globe but > 20%.

is_polar()

Polar domains are centered around a pole.

is_portrait()

Portrait domains are at least 20% taller than they are wide.

is_small()

Small domains cover < 20% of the globe.

is_square()

Square domains have a width and height within 20% of each other.

mutate()
class maps.domains.optimal.SouthPolarStereo

Bases: CRS

CENTRAL_LONGITUDE = 'central_lon'
cartopy_crs()
get_kwargs(domain)
to_ccrs(domain)
class maps.domains.optimal.Square(extents, small_threshold=0.2, large_threshold=0.6)

Bases: Extents

A non-equitorial domain with an aspect ratio > 0.8 and < 1.2.

property area
property central_lat
property central_lon
property max_lat
property max_lon
property min_lat
property min_lon
property ratio
property standard_parallels
CRS
get_crs()
is_equatorial()

Equatorial domains are centered around the equator.

is_global()

Global domains cover > 60% of the globe.

is_landscape()

Landscape domains are at leadt 20% wider than they are tall.

is_large()

Large domains cover < 60% of the globe but > 20%.

is_polar()

Polar domains are centered around a pole.

is_portrait()

Portrait domains are at least 20% taller than they are wide.

is_small()

Small domains cover < 20% of the globe.

is_square()

Square domains have a width and height within 20% of each other.

mutate()
class maps.domains.optimal.TransverseMercator

Bases: CRS

CENTRAL_LATITUDE = 'central_lat'
CENTRAL_LONGITUDE = 'central_lon'
cartopy_crs()
get_kwargs(domain)
to_ccrs(domain)
maps.domains.optimal.crs_from_bounds(bounds)

Get an ‘optimal’ CRS to use for the given latitude and longitude extents.

The method for choosing a CRS is as follows:
  • If the area of the map is greater than 60% of the globe, use a global equirectangular CRS.

  • If the central latitude is within ±25 degrees, use an equirectangular CRS.

  • If the central latitude is greater (less) than +(-)75 degrees, use a North (South) Polar Stereo CRS.

  • If the central latitude falls between ±25 and ±75 degrees and the aspect ratio is > 0.8, use an Albers Equal Area CRS.

  • If the central latitude falls between ±25 and ±75 degrees and the aspect ratio is < 0.8, use a Transverse Mercator CRS.

This method is adapted from the method used by https://projectionwizard.org, which is discussed in the following article: Šavrič, B., Jenny, B. and Jenny, H. (2016). Projection Wizard – An online map projection selection tool. The Cartographic Journal, 53–2, p. 177–185. Doi: 10.1080/00087041.2015.1131938.

Parameters:

bounds (list) – The latitude and longitude extents of the bounding box, given as [min_longitude, max_longitude, min_latitude, max_latitude].

Return type:

cartopy.crs.CRS