Skip to content

Run map matching

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

Run map matching in bash

The programs take configuration in xml format as input

# Run UBODT precomputation
ubodt_gen ubodt_config.xml
# Run map matching (Single processor)
fmm fmm_config.xml
# Run map matching parallely (omp stands for OpenMP)
fmm_omp fmm_config.xml

Check the example for configuration file format.

Run map matching in python

Run fmm in python can be as simple as:

import fmm
# Load model from configuration file
model = fmm.MapMatcher("fmm_config.xml")

# Run map matching with wkt geometry as input

wkt = "LINESTRING (0.200812146892656 2.14088983050848,1.44262005649717 2.14879943502825,3.06408898305084 2.16066384180791,3.06408898305084 2.7103813559322,3.70872175141242 2.97930790960452,4.11606638418078 2.62337570621469)"

result = model.match_wkt(wkt)

# Print the result

print "Matched path geometry",result.mgeom
print "Matched points geometry",result.pgeom
print "Matched edge id",list(result.opath)
print "Matched path edges",list(result.cpath)

A demo is provided as fmm_demo.ipynb. Check the folder python for more information.