Skip to content

roadstyle

Turn a road network into a styled, interactive HTML map that works offline, with Google Street View and a JavaScript API.

A roadstyle map of Södermalm: Hornsgatan selected, and the floating Street View window showing it

pip install roadstyle
import geopandas as gpd
import roadstyle as rs

edges = gpd.read_file("edges.gpkg")        # road edges with a `highway` column
rs.render_edges(edges).save("roads.html")  # one self-contained file, opens offline

What you can do

  • Style the roads


    Palettes, base maps, labels, arrows and 3D bridges.

    Style the roads

  • Colour by your data


    Categorical or numeric columns, legends, switchable colourings.

    Colour by your data

  • Add your own layers


    Zones, points and lines under or over the roads.

    Add your own layers

  • Google Street View


    Click a road and see it, in a floating window or beside the map.

    Google Street View

  • Big networks


    Vector tiles in the file, or the GPU backend for millions of edges.

    Big networks

  • Dashboards & JavaScript


    Ready-made pages, and window.rs* calls to drive the map.

    Dashboards & JavaScript

  • Put it on a website


    An iframe, a JSON spec, or roadstyle.js on your own map.

    Put it on a website

When to use roadstyle

  • Instead of geopandas .explore() when the output is a road map you care about: casings, per-class widths, one-way arrows, bridges over tunnels. .explore() draws one flat line.
  • Instead of prettymaps when you need an interactive web map or colour by data (flow, speed). prettymaps makes static images.
  • Instead of kepler.gl for road cartography. kepler.gl is a general exploration GUI; its roads are flat strokes with no labels or arrows.
  • For a quick look at any geometry, those tools are fine; roadstyle is for roads.

Gallery · Reference · Studio · GitHub · PyPI · Changelog