Skip to main content
Map matching is the process of mapping noisy GPS points to correct road segments. Matcher is the WherobotsDB module that performs map matching for GPS points. The following functions are available in the matcher module:
  • match(): Performs map matching for GPS paths
  • load_osm(): Loads OSM xml file and retrieves edges and nodes information

match()

match() performs map matching for a GPS path trip. If not provided, the first non-geometry column is used.
match(edges_df: DataFrame, paths_df: DataFrame, edges_geometry: str, paths_geometry: str, id: str) -> DataFrame
edges_df
DataFrame
required
DataFrame object that contains all edges in the target dataset
paths_df
DataFrame
required
DataFrame object that contains all GPS trips for which map matching need to be performed
edges_geometry
str
required
Name of the geometry column in the edgesDf DataFrame
paths_geometry
str
required
Name of the geometry column in the pathsDf DataFrame
id
str
required
Optional - Name of the column in the pathsDf DataFrame that contains the unique identifier for each GPS

Returns

DataFrame
DataFrame
A DataFrame object containing the results of map matching

load_osm()

Function loads an OSM xml file and retrieves all the edges and locations of the corresponding nodes.
load_osm(osm_path: str, tags_filter: str) -> DataFrame
osm_path
str
required
A string that represents path to the OSM xml file
tags_filter
str
required
A string denoting the tags to be used for filtering the OSM data

Returns

DataFrame
DataFrame
A DataFrame object containing all the edges information required for map matching

Usage Examples

from matcher import *

# Example usage of match
result = match(edges_df=example_value, paths_df=example_value, edges_geometry=example_value)