I24's Transform module for downstream traffic visualization and analysis (post-post processing).
The module is collection-agnostic, meaning it can transform both RAW and RECONCILED collections without explicit configuration.
The Transform module:
- Subscribes to a post-processed collection via mongoDB's change stream (change_stream_reader.py)
- Transforms trajectories into a timestamp-based document (transformation.py)
- Writes and updates the documents into a transformed mongoDB collection (batch_update.py)
- Parallelizes step 1-3 with multiprocessing (main.py)
-
Clone the repository
-
Create a
config.json
file usingconfig.template.json
. -
Enter the credentials for connecting to MongoDB and the collection info
read_database_name
&read_collection_name
: The name of the collection and its database to transform (must already exist in db)write_database_name
&write_collection_name
: The name of the transformed collection and its database (to be generated by main.py){ "host": "x.x.x.x", "port": 27017, "username": "username", "password": "password", "read_database_name": "db_name", "read_collection_name": "collection_name" "write_database_name": "database_name" "write_collection_name": "collection_name" }
- Initialize config
- Run
run_static_transformer.py
- Initialize config
- Run
run_dynamic_transformer.py