slv.basemap#

Salt Lake Valley basemaps.

SaltLake makes a cartopy map of the valley and layers features onto it. Every add_* method returns the map, so calls chain:

from slv.basemap import SaltLake

m = (
    SaltLake(tiles="terrain")
    .add_population()
    .add_trax(lines="RG")
    .add_sites(["wbb", "ldf", "hdp"], labels={"wbb": "UOU"})
    .add_mesowest()
    .add_legend()
    .add_inset()
    .add_north_arrow()
)
m.fig.savefig("slv.png", dpi=300)

The load_* functions read the layers’ data (group data via $SLV_SPATIAL_DIR, slv user data via $SLV_USER_DATA_DIR) and return lon/lat GeoDataFrames; the add_* methods only plot, so any of them also takes data you pass in.

Attributes

TRAX_COLORS

Colour of each TRAX line, keyed by its line letter in UTA_TRAX.geojson.

STADIA_ATTRIBUTION

Stadia Maps credit, required wherever its tiles are shown.

Functions

cached_tiler

A cartopy tiler that caches its tiles on disk, safe to build in several processes at the same moment.

load_borders

2022 Census state or county boundaries from $SLV_SPATIAL_DIR/administrative.

load_interstates

Interstates (UGRC road CARTOCODE "1") from $SLV_SPATIAL_DIR/transportation/roads.

load_mesowest

MesoWest stations ($SLV_USER_DATA_DIR/mesowest), optionally filtered by Status and Mesonet; None keeps all.

load_population

Block-group population and density (people km⁻², over land area).

stadia_tiles

A Stadia Maps tiler ($STADIA_API_KEY), cached on disk by cartopy.

Classes

SaltLake

A cartopy map of the Salt Lake Valley.