Command line¶
The roadstyle command turns a road file into a map or a page, without writing Python.
roadstyle INPUT [options] # INPUT: GPKG, GeoJSON, Shapefile, … with a road-class column
roadstyle studio [streamlit args] # the Studio workbench
Each styling flag mirrors a Python keyword (Every parameter); a flag you leave out keeps the keyword's default and your settings.
Output¶
| flag | default | what |
|---|---|---|
-o, --output PATH |
input name + the format's extension | output file |
-f, --format FMT |
web |
see Formats |
--version |
print the version | |
-h, --help |
print every flag |
Formats¶
-f |
writes | extension | Python equivalent |
|---|---|---|---|
web |
a self-contained MapLibre map | .html |
render_edges(g).save(...) |
Only the styling, filtering and data-colour flags apply to every format; the web flags below need
-f web.
Flags¶
| flag | Python keyword | what |
|---|---|---|
| Input | ||
--highway-col COL |
highway_col |
road-class column (default highway) |
--layer NAME |
load_edges(layer=) |
layer of a multi-layer file, e.g. a GPKG |
| Styling | ||
--palette {amber,carto,highsat,mono} |
palette |
class palette (default amber) |
--basemap KEY |
basemap |
base map (default from settings: ofm_positron) |
--tooltip COL [COL …] |
tooltip |
columns in the hover tooltip |
| Filtering | ||
--include TYPE [TYPE …] |
include |
keep only these classes |
--exclude TYPE [TYPE …] |
exclude |
drop these classes |
| Colour by data | ||
--color-by COL |
color_by |
colour by this column |
--colors JSON |
colors |
categorical map, e.g. '{"a":"#f00"}' |
--cmap NAME |
cmap |
numeric ramp, e.g. viridis |
--vmin N, --vmax N |
vmin, vmax |
ramp range |
--width-by MIN MAX |
width_by |
width in px follows the numeric --color-by |
Web map (-f web) |
||
--page {dashboard,street-view} |
render_dashboard / render_street_view |
a ready-made page instead of the plain map |
--dashboard JSON |
dashboard= |
with --page dashboard: the dashboard's options, for example the parts of its panel (Dashboard options) |
--view-3d |
view_3d=True |
tilted camera and 3D bridge decks |
--pitch DEG, --bearing DEG |
pitch, bearing |
starting camera |
--no-arrows |
arrows=False |
no one-way arrows |
--no-labels |
labels=False |
no street names |
--no-filter |
filter_control=False |
no effect: the floating Roads box is gone (the dashboard's roads tool is the road filter) |
--no-basemap-switcher |
basemap_switcher=False |
no base-map button |
--tiles / --no-tiles |
tiles=True / tiles=False |
--tiles is the default: the roads are embedded MLT vector tiles, as in render_edges. --no-tiles writes inline GeoJSON roads |
--no-compress |
compress=False |
plain JSON data instead of gzip |
--page¶
| page | builds |
|---|---|
dashboard |
the map, the standard toolbox and an empty panel. --dashboard gives the panel its parts (Dashboards) |
street-view |
the map + Google Street View of the clicked road |
--page needs -f web. For street-view only:
| flag | keyword | what |
|---|---|---|
--layout {beside,below} |
layout |
Street View right of the map (default) or under it |
--panel-width PCT |
panel_width |
Street View's share of the window, 20-80 (default 42) |
--no-resize |
resizable=False |
no draggable divider |
Street View needs the page served over http(s): python -m http.server, then open
http://localhost:8000/map.html. See Google Street View.
roadstyle-levels¶
The level step with files you can read and edit (Which road is on top):
roadstyle-levels make SOURCE FOLDER [--query SQL] [--geometry COL] [--id-col edge_id] [--band-col COL] [--order priority|class|COL]
[--band-dist 10] [--near-rules] [--engine python|rust] # roads.parquet, pairs.csv (edits.csv once)
roadstyle-levels solve FOLDER [--auto-ends] [--max-positions N] [--engine python|rust] # levels.csv
roadstyle-levels edit FOLDER [--port 8780] # the level editor
The Rust program roadstyle¶
The Rust program has no Python. Its options have the names of the render_edges keywords: --color-by lanes is color_by="lanes", --no-arrows is arrows=False. A value that is JSON is read as JSON. All commands are in The roadstyle program.
| command | does |
|---|---|
roadstyle page ROADS OUT.html [--palette P] [--profile P] [--settings FILE] [--api-key KEY] [--street-view-key KEY] |
the page in one file, as render_edges |
roadstyle sources ROADS OUTDIR [--format geojson\|geoparquet] [--keep COL,COL] [--name NAME] |
stage 1: the style and one file for each source |
roadstyle tiles STAGE1DIR OUT [--format pmtiles\|xyz] [--tile-format mlt\|mvt] [--keep COL,COL] [--base-url URL] |
stage 2: the vector tiles |
roadstyle levels make EDGES FOLDER [--id-col C] [--band-col C] [--order O] [--band-dist 10] [--head-m 5] [--near-rules] [--highway-col C] [--layer-col C] [--bridge-col C] [--tunnel-col C] [--junction-col C] [--boundary AREA.geojson] |
a level area's input. --boundary keeps the edge of the area, which the editor draws as a dashed line |
roadstyle levels solve FOLDER / levels edit FOLDER [--port 8780] [--page DIR] |
solve the area; the level editor (roadstyle serve FOLDER is the same without the check of the area) |
roadstyle design edit ROADS [--design FILE] [--port 8781] [--page DIR] |
the design editor |
roadstyle snapshot PAGE.html OUT.png [--center LON,LAT] [--zoom Z] [--pitch P] [--bearing B] [--width 1200] [--height 800] [--scale 1] [--settle 2.5] [--timeout 40] |
a PNG of a saved page |
roadstyle-mcp¶
Starts the MCP server: three tools for AI agents. Needs pip install "roadstyle[mcp]".
roadstyle studio¶
Opens the Studio workbench in the browser. Everything after studio goes to
streamlit run, e.g. roadstyle studio --server.port 8502. Needs pip install "roadstyle[studio]".
Examples¶
roadstyle edges.gpkg -o map.html --basemap ofm_dark
roadstyle edges.gpkg --include motorway trunk primary -o major.html
roadstyle edges.gpkg --color-by maxspeed_kmh --cmap viridis --width-by 1 6
roadstyle edges.gpkg --page street-view --layout below --panel-width 50
roadstyle edges.gpkg --page dashboard -o dashboard.html
roadstyle edges.gpkg --page dashboard -o dashboard.html \
--dashboard '{"panel": {"sections": [{"id": "q", "part": "query", "label": "Query"}, {"id": "road", "part": "road_card", "label": "Selected road"}]}}'
The Rust program takes the same JSON with the keyword --dashboard, and the template with --template dashboard:
roadstyle page edges.gpkg dashboard.html --template dashboard --dashboard '{"panel": {"sections": [{"id": "q", "part": "query"}]}}'
See also: Every parameter · Get started