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

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.
-
Colour by your data
Categorical or numeric columns, legends, switchable colourings.
-
Add your own layers
Zones, points and lines under or over the roads.
-
Google Street View
Click a road and see it, in a floating window or beside the map.
-
Big networks
Vector tiles in the file, or the GPU backend for millions of edges.
-
Dashboards & JavaScript
Ready-made pages, and
window.rs*calls to drive the map. -
Put it on a website
An iframe, a JSON spec, or
roadstyle.json your own map.
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.