Matchers
There are several matchers that can be used to determine the road that a coordinate is matched to. Matchers may have tradeoffs between speed and accuracy.
Available Matchers
For readability, the full path is listed below and not used in other parts of the documentation.
LCSS
- class LCSSMatcher(road_map: MapInterface, distance_epsilon: float = 50.0, similarity_cutoff: float = 0.9, cutting_threshold: float = 10.0, random_cuts: int = 0, distance_threshold: float = 10000)[source]
A map matcher based on the paper:
Zhu, Lei, Jacob R. Holden, and Jeffrey D. Gonder. “Trajectory Segmentation Map-Matching Approach for Large-Scale, High-Resolution GPS Data.” Transportation Research Record: Journal of the Transportation Research Board 2645 (2017): 67-75.
- Parameters:
road_map – The road map to use for matching
distance_epsilon – The distance epsilon to use for matching (default: 50 meters)
similarity_cutoff – The similarity cutoff to use for stopping the algorithm (default: 0.9)
cutting_threshold – The distance threshold to use for computing cutting points (default: 10 meters)
random_cuts – The number of random cuts to add at each iteration (default: 0)
distance_threshold – The distance threshold above which no match is made (default: 10000 meters)
Line Snap
- class LineSnapMatcher(road_map: MapInterface)[source]
A crude (but fast) map matcher that just snaps points to the nearest road network link.
- map
The map to match against
Valhalla
- class ValhallaMatcher(valhalla_url='https://valhalla1.openstreetmap.de/trace_attributes', cost_model='auto', shape_match='map_snap', attributes={'edge.length', 'edge.speed'})[source]
pings a Valhalla server for map matching
Osrm
- class OsrmMatcher(osrm_address='http://router.project-osrm.org', osrm_profile='driving', osrm_version='v1')[source]
pings an OSRM server for map matching
Matcher Inferface
Each Matcher class must conform to the matcher interface defined below.