Extremely simple and lean 2D visualization of traffic scenarios in 350 lines of JavaScript. Reads a CSV object list and an optional map (simple polylines stored as GeoJSON) and plays the scenario right in your browser without any dependencies. Written by hand. Work in progress.
Demo available here.
Recording.2025-04-17.at.11.04.46.webm
python -m http.serverGo to http://localhost:8000.
By default, the scenario format of TAF-BW is used, which is mostly the same as used by the INTERACTION dataset. However, by customizing the column names (see config.js), any CSV format that includes all of the 8 required fields can be read.
Note: A scenario origin point in lat / lon world coordinates is required when wanting to visualize on the map.
The optional map is read as a simple set of polylines for maximum flexibility. No Lanelet2 or OpenDrive format required. This allows to use self-drawn or auto-generated maps, which are not necessarily 100 % consistent.
You can use GDAL to convert a Lanelet2 map from OSM format to GeoJSON.
OSM_USE_CUSTOM_INDEXING=NO ogr2ogr -f GeoJSON k729.geojson k729.osm linesAlternatively, you can use this web UI to perform the conversion right in your browser without installing any dependencies (thanks, @bugra9 for porting GDAL to WASM). Set the options as follow:
If you end up with an empty file, use JOSM instead (File -> Save As...).
Pre-converted versions of the official maps are to be found at data/.
For proper visualization, metric coordinates (no lat / lon) are used internally. Thus, input lat / lon coordinates (by default, WGS84 is assumed) are automatically converted to web mercator projection.
- Scenario:
vehicle_tracks_000.csv - Map:
k729_2022-03-16.osm(must be converted to GeoJSON, see above)
- Code cleanup
- Error handling
screencast.webm
This project is not affiliated with FZI Forschungszentrum Informatik Karlsruhe.
This repository contains a modified subset of data originally created by FZI Forschungszentrum Informatik, used under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License (CC BY-NC-SA 4.0).