> ## Documentation Index
> Fetch the complete documentation index at: https://docs.wherobots.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Matcher Python Module

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.

```python theme={"system"}
match(edges_df: DataFrame, paths_df: DataFrame, edges_geometry: str, paths_geometry: str, id: str) -> DataFrame
```

<ParamField path="edges_df" type="DataFrame" required>
  DataFrame object that contains all edges in the target dataset
</ParamField>

<ParamField path="paths_df" type="DataFrame" required>
  DataFrame object that contains all GPS trips for which map matching need to be performed
</ParamField>

<ParamField path="edges_geometry" type="str" required>
  Name of the geometry column in the edgesDf DataFrame
</ParamField>

<ParamField path="paths_geometry" type="str" required>
  Name of the geometry column in the pathsDf DataFrame
</ParamField>

<ParamField path="id" type="str" required>
  Optional - Name of the column in the pathsDf DataFrame that contains the unique identifier for each GPS
</ParamField>

### Returns

<ResponseField name="DataFrame" type="DataFrame">
  A DataFrame object containing the results of map matching
</ResponseField>

## `load_osm()`

Function loads an OSM xml file and retrieves all the edges and locations of the corresponding nodes.

```python theme={"system"}
load_osm(osm_path: str, tags_filter: str) -> DataFrame
```

<ParamField path="osm_path" type="str" required>
  A string that represents path to the OSM xml file
</ParamField>

<ParamField path="tags_filter" type="str" required>
  A string denoting the tags to be used for filtering the OSM data
</ParamField>

### Returns

<ResponseField name="DataFrame" type="DataFrame">
  A DataFrame object containing all the edges information required for map matching
</ResponseField>

### Usage Examples

```python theme={"system"}
from matcher import *

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