cartograph.style

class cartograph.style.Style(appears_at=0)

Generic style. Features will become visible at zoom level appears_at, the default value is zero (visible at every zoom level).

update(zoom)

Update the style at zoom level zoom. Subclasses can override this method to change the style at different zoom levels. By default, does nothing.

class cartograph.style.AreaStyle(appears_at=0, color='black', fill=True, hatch='')

Subclass of Style.

Area style which determines the colour of the area, whether it is filled and a hatching.

class cartograph.style.WayStyle(appears_at=0, color='black', linestyle='-', linewidth=1.0, markerstyle='', markersize=0)

Subclass of Style.

Way style which determines the colour of the way, the linestyle, linewidth, markerstyle and markersize.

class cartograph.style.NameStyle(appears_at=0, color='black', fontsize=7, fontweight='normal')

Subclass of Style.

Name style which determines the colour of the name, the fontsize and the fontweight.

class cartograph.style.NodeStyle(appears_at=0, color='black', text='P', fontsize=7, fontweight='bold')

Subclass of NameStyle.

Node style which determines the colour of the node, the text label, the fontsize and the fontweight.

class cartograph.style.ElevationStyle(colormap='terrain', vmin=-3000, vmax=5000, colormap_alpha=0.4, hillshade_alpha=0.25, contour_appears_at=15, contour_levels=[], contour_color='black', contour_width=0.2, clabel_levelskip=2, clabel_fontsize=5)

Subclass of Style.

Elevation style which determines the colormap of the background image, the elevation limits vmin and vmax of the colormap, the opacity colormap_alpha of the background image, the opacity hillshade_alpha of the hillshade, a list or numpy array of zoom levels at which contours appear, the contour levels, the contour colour, the linewidth of the contours, the levels at which contours are labelled (by default, labelled at every other level) and the fontsize of the contour labels.

When using the “terrain” colormap (the default), low values are drawn in blue so it may be usefult to set vmin to be below sea level.