General MTLDP functions

Pre-defined data processing procedure

Base class

class mtldp.DataProcessingBase(workspace)

Base class for the task

run()

you should put the processing here…

Returns

Parse the network

class mtldp.ParseNetwork(workspace, osm_file, output_shapefile=True, output_directed=True, output_json=True, save_csv=True, intersection_name_file=None)

Examples for the output workspace

├───workspace                   # workspace
    ├───network                 # folder for the map data
        │   map.log             # log file of the map parsing
        │   processed.osm       # processed osm data (filtered)
        │   raw.osm             # raw osm data (copied)
        │   static_net.json     # json file to display in the website
        │   ubdot.txt           # pre-calculation file for fast-map-matching
        │
        └───shapefiles          # shapefiles
                edges.cpg
                ...
                nodes.shx
__init__(workspace, osm_file, output_shapefile=True, output_directed=True, output_json=True, save_csv=True, intersection_name_file=None)
Parameters
  • workspace – folder of the workspace, all the output will be put in this file

  • osm_file – input osm file

  • output_shapefile (bool) – True to output the shapefile to a default folder

  • output_directed (bool) – output the directed map or undirected

  • output_json (bool) – output the json file to display the map

  • save_csv (bool) – save the parsed network to the csv file

  • intersection_name_file (Optional[str]) –

run()

you should put the processing here…

Returns

Load the trajectory data

class mtldp.LoadTrajectoryData(workspace, trajectory_files, adapter, load_buffer=False, output_buffer=True)
__init__(workspace, trajectory_files, adapter, load_buffer=False, output_buffer=True)

Initialize self. See help(type(self)) for accurate signature.

run()

you should put the processing here…

Returns

Trajectory data map matching