These Python scripts read SUMO traffic simulation results from the FCD (floating car data) export in the CSV format and convert it to the Cesium Language (CZML), which is a JSON-based format for describing time-dynamic geospatial data. The output CZML file can be visualized in the Cesium virtual globe and combined with semantic 3D city models using the 3DCityDB Web-Map-Client.
This script creates point representations for each traffic member. The function convert_to_czml takes the following parameters:
The input CSV file should have the following structure, where all values are stored in the first column of the CSV file, separated with commas and "." as a delimiter for decimal values.
| timestep [s] | id | x [°] | y [°] | z [m] | type |
|---|---|---|---|---|---|
| 0.0 | id_car_1 | 11.56 | 48.13 | 510.2 | passenger |
| 1.0 | id_car_1 | 11.57 | 48.14 | 510.1 | passenger |
| ... | ... | ... | ... | ... | ... |
In addition to the information specified above, this script requires angle (and optionally slope) values from the FCD output. This information is used to orient 3D models on the Cesium virtual globe depending on longitude, latitude and local orientation of traffic members. Traffic members of type passenger are assigned to a demo 3D model, provided by Cesium. Additionally, traffic members of type pedestrian are assigned to an animated person called CesiumMan, which is also provided by Cesium. Other 3D models can be referenced by adapting the link generated in the process of creating the CZML document.
A sample SUMO FCD result CSV file is available in the input folder and corresponding sample CZML files created using these scripts are provided in the output folder.
A documentation on how to use the 3DCityDB Web-Map-Client for web-based visualization of semantic 3D city models is available here. CZML documents can be directly integrated within this Web-Client as additional layers and thus easily combined with 3D city models.
Demo videos showing results of this process can be found here and here.
If you find contents of this repository helpful, please consider citing the following related publication.
@article{Beil2022,
author = {Beil, C. and Kendir, M. and Ruhdorfer, R. and Kolbe, T. H.},
title = {Dynamic and web-based 4D Visualization of Streetspace Activities derived from Traffic Simulations and semantic 3D City Models},
journal = {ISPRS Annals of the Photogrammetry, Remote Sensing and Spatial Information Sciences},
volume = {X-4/W2-2022},
year = {2022},
pages = {29--36},
url = {https://www.isprs-ann-photogramm-remote-sens-spatial-inf-sci.net/X-4-W2-2022/29/2022/},
doi = {10.5194/isprs-annals-X-4-W2-2022-29-2022}
}