Feature interface (cartopy.feature)#

This module defines a Feature interface, which can be used and extended to add various “features” to geoaxes using ax.add_feature(), such as Shapely objects and Natural Earth Imagery.

The default zorder for Cartopy features is defined in defined in FeatureArtist as 1.5, which puts them above images and patches, but below lines and text.

Feature attributes#

Some commonly used features are stored as attributes in the feature module for ease of use.

COLORS

A dictionary of colors useful for drawing Features.

auto_scaler

AdaptiveScaler for NaturalEarthFeature.

BORDERS

Automatically scaled country boundaries.

STATES

Automatically scaled state and province boundaries.

COASTLINE

Automatically scaled coastline, including major islands.

LAKES

Automatically scaled natural and artificial lakes.

LAND

Automatically scaled land polygons, including major islands.

OCEAN

Automatically scaled ocean polygons.

RIVERS

Automatically scaled single-line drainages, including lake centerlines.

Feature classes#

AdaptiveScaler(default_scale, limits)

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

Feature(crs, **kwargs)

Represents a collection of points, lines and polygons with convenience methods for common drawing and filtering operations.

GSHHSFeature([scale, levels])

An interface to the GSHHS dataset.

NaturalEarthFeature(category, name, scale, ...)

A simple interface to Natural Earth shapefiles.

Scaler(scale)

General object for handling the scale of the geometries used in a Feature.

ShapelyFeature(geometries, crs, **kwargs)

A class capable of drawing a collection of shapely geometries.

WFSFeature(wfs, features, **kwargs)

A class capable of drawing a collection of geometries obtained from an OGC Web Feature Service (WFS).

nightshade.Nightshade([date, delta, ...])

Shade the darkside of the Earth, accounting for refraction.