This python script transform one or several temporal trajectories composed of a set of nodes and links into a KML file plotting these trajectories over time on Google Earth.
The script kmlMovie.py takes as input two csv files with column names, the value separator is a semicolon ";".
-
Nodes.csv is composed of 3 columns providing geographical information about the nodes:
- Node ID
- Longitude of the node
- Latitude of the node
-
Links.csv is composed of 5 columns providing information about the "temporal" link between nodes defined in Nodes.csv. The links should be sorted by starting time.
- Link ID (numeric)
- Node of origin
- Node of destination
- Departure time of the link from the node of origin (date format '2014-01-01T08:00:00Z')
- Arrival time of the link to the node of destination
The script has also 7 parameters to set the kml movie's time windows, the nodes' and links' visibility (remaining time on screen), the nodes' and links' styles and the name of the output file. Their values can be set directly into the script.
- begin: Starting time of the movie (date format '2014-01-01T08:00:00Z')
- end: Ending time of the movie (date format '2014-01-01T08:00:00Z')
- delay_node: Number of seconds the nodes remain visible after their creation
- delay_link: Number of seconds the links remain visible after their creation
- hrefnodestyle: Hyperlink leading to the node style file
- rgbcolorlink: Define the links color with an rgb code
- output_file: Name of the output file
You can run the script using the command below to plot three temporal trajectories in Madrid.
python kmlMovies.py
If you need help, find a bug, want to give me advice or feedback, please contact me!
This repository is mirrored on both GitLab and GitHub. You can access it via the following links:
- GitLab: https://gitlab.com/maximelenormand/KML-movie-Python
- GitHub: https://github.com/maximelenormand/KML-movie-Python
The repository is archived in Software Heritage: