Skip to content

Input and output

Can Yang edited this page May 30, 2019 · 9 revisions

Input

Two files should be prepared for the map matching program:

  1. GPS trajectory file: an ESRI shapefile (LineString) with an ID field. Each row stores a trajectory.
  2. 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
  • 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

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