cartopy.feature.AdaptiveScaler#

class cartopy.feature.AdaptiveScaler(default_scale, limits)[source]#

Automatically select scale of geometries based on extent of plotted axes.

Parameters:
  • default_scale – Coarsest scale used as default when plot is at maximum extent.

  • limits – Scale-extent pairs at which scale of geometries change. Must be a tuple of tuples ordered from coarsest to finest scales. Limit values are the upper bounds for their corresponding scale.

Example

>>> s = AdaptiveScaler('coarse',
...           (('intermediate', 30), ('fine', 10)))
>>> s.scale_from_extent([-180, 180, -90, 90])
'coarse'
>>> s.scale_from_extent([-5, 6, 45, 56])
'intermediate'
>>> s.scale_from_extent([-5, 5, 45, 56])
'fine'
scale_from_extent(extent)[source]#

Given an extent, update the scale.

Parameters:

extent – The boundaries of the plotted area of a projection. The coordinate system of the extent should be constant, and at the same scale as the scales argument in the constructor.