Skip to content

Input and output

Can Yang edited this page Feb 7, 2020 · 9 revisions

Input

Two files should be prepared for the map matching program:

  1. GPS trajectory file:
  • an ESRI shapefile (LineString) where each feature stores a trajectory. The id field name will be specified by the user.
  • a CSV file with a header row and columns separated by ;. Each row stores a trajectory with geometry in WKT linestring format. The id and geometry column name will be specified by the user. An example can be found at trips.csv
  1. Network file: an ESRI shapefile (LineString), each row stores a network edge with ID, source and target fields, which defines the topology of network graph.

For more details, please to refer to the ubodt configuration and fmm configuration.

Output of ubodt_gen

The output of program ubodt_gen is a CSV file or a Binary file, which is automatically detected from the file extension csv or bin. Binary file can be used to save space in case of a large road network.

The CSV file contains the following information:

  • source: source (origin) node
  • target: target (destination) node
  • next_n: the next node visited after source in the shortest path
  • prev_n: the previous node visited before target in the shortest path
  • next_e: the next edge index visited after source in the shortest path
  • distance: the shortest path distance

Note: In UBODT, the edge index is stored in next_e. However, in the final output, the element is exported as the id attribute of edge specified by the configuration fmm_config>network>id, which is a string value.

Output of fmm

The output of program fmm is a CSV file containing the following information based on user specification:

  • id: id of trajectory
  • ogeom: WKT Linestring, original trajectory geometry
  • opath: sequence of ids, edge matched to each point in trajectory
  • error: sequence of floats,distance from each point to its matched point
  • offset: sequence of floats, distance from the matched point to the start of the matched edge
  • length: sequence of floats, length of the matched edge for each point
  • spdist: sequence of floats, shortest path distances traversed between consecutive points
  • pgeom: WKT Linestring, a line connecting the matched points
  • cpath: sequence of ids, the path traversed by the trajectory
  • tpath: sequence of ids, edges traversed between consecutive points, separated by |
  • mgeom: WKT Linestring, the geometry of the cpath
  • ep: sequence of floats, emission probability in HMM for each matched point
  • tp: sequence of floats, transition probability in HMM for two consecutive matched points

By default, only cpath and mgeom are exported. The fields are illusrated by the image below.