Dependencies for pre-processing#

The raw data processing relies on two third-party tools that are not installed by pip: the Fast Map Matching library fmm (map matching) and the osmium command line tool (merging and cutting OpenStreetMap files).

Step 1: Build fmm#

Warning

On Windows, follow Installation of fmm in Windows instead.

Install the build dependencies:

(mtldp) $ sudo apt install cmake build-essential libboost-dev gdal-bin swig \
 libboost-serialization-dev libgdal-dev libbz2-dev libexpat1-dev libosmium2-dev

Clone fmm and build it from source with the Python interpreter of the mtldp environment active. The build takes several minutes:

(mtldp) $ git clone https://github.com/cyang-kth/fmm.git
(mtldp) $ cd fmm
(mtldp) $ mkdir build && cd build
(mtldp) $ cmake ..
(mtldp) $ make -j8
(mtldp) $ sudo make install

Check the installation:

(mtldp) $ fmm --help
(mtldp) $ python -c "import fmm; print(fmm.__file__)"

Note

match_points_to_map restarts the matching of a trip after a gap that cannot be connected through the network instead of discarding the whole trip. This behaviour needs the restart_on_disconnect option of the MTL build of fmm; with the upstream build the option is not available and a warning is printed.

Step 2: Install osmium-tool#

osmium is called by create_sub_regions, copy_regions and extract_osm_map to sort and merge OpenStreetMap files:

(mtldp) $ conda install -c conda-forge osmium-tool
# or
$ sudo apt install osmium-tool

Step 3: Install mtldp-preproc#

$ git clone git@github.com:michigan-traffic-lab/mtldp-preproc.git
(mtldp) $ cd mtldp-preproc && pip install -e .

The Python dependencies (networkx, scipy, shapely, pyshp, pyosmium through mtldp-meta-utils) are installed by pip.