arup-group / elara

Command line utility for processing MATSim events output files.
MIT License
13 stars 4 forks source link

adds animation handler: #197

Closed fredshone closed 2 years ago

fredshone commented 2 years ago

adds event handler for arrow formatted "animation data". Animations are intended to show vehicle movements only.

Can be called via cli: elara event-handlers vehicle-links-animate all -i tests/test_fixtures -o test_out/

or by adding vehicle_links_animate to config under event_handlers.

Output example called by cli as above using elara test fixtures (shown as dataframe):

  veh_mode          color                                               path  \
0      car      [0, 0, 0]  [[-7.557256, 49.766735], [-7.556523, 49.767286...   
1      bus  [255, 40, 40]  [[-7.557256, 49.766735], [-7.556523, 49.767286...   
2      car      [0, 0, 0]  [[-7.557256, 49.766735], [-7.556523, 49.767286...   
3      bus  [255, 40, 40]  [[-7.557256, 49.766735], [-7.556523, 49.767286...   
4      car      [0, 0, 0]  [[-7.557255, 49.766736], [-7.556523, 49.767286...   
5      car      [0, 0, 0]  [[-7.557256, 49.766734], [-7.556523, 49.767287...   
6      bus  [255, 40, 40]  [[-7.557255, 49.766736], [-7.556523, 49.767286...   
7      bus  [255, 40, 40]  [[-7.557255, 49.766736], [-7.556523, 49.767286...   

                                          timestamps    vid  
0   [1649142000, 1649142001, 1649142456, 1649142460]  chris  
1   [1649143800, 1649144101, 1649144556, 1649144563]   bus1  
2   [1649145600, 1649145601, 1649145606, 1649146060]   nick  
3   [1649147400, 1649147701, 1649148156, 1649148163]   bus2  
4  [1649176200, 1649176201, 1649176206, 164917666...  chris  
5   [1649179800, 1649179801, 1649180256, 1649180260]   nick  
6   [1649179800, 1649180104, 1649180559, 1649180566]   bus3  
7   [1649183400, 1649183701, 1649184156, 1649184160]   bus4  

This is just the MVP. Not fast or clever:

andkay commented 2 years ago

Oh -- and one more thing. If you have can imagine adding different types of animations, please consider moving this into a new module with a dedicated workstation.