> ## 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 Java Class

> The Matcher Java class provides methods for performing map matching on GPS paths using road network data.

The `Matcher` Java Class includes the following methods for map matching:

* `match()`: Performs map matching for GPS paths
* `loadOSM()`: Loads OSM xml file and retrieves edges information

## `match()`

Perform map matching between an RDD of edges and an RDD of GPS tracks source node ID, destination node ID, a geometry column of type LineString that connects
source and destination nodes, source node latitudes and longitudes, destination node
latitudes and longitudes
contains the track ID, sequence of coordinates, and a geometry column of type LineString
connecting all GPS points

### Parameters

```java theme={"system"}
public static Dataset<Row> match( Dataset<Row> edgesDf, Dataset<Row> pathsDf, String colEdgesGeom, String colPathsGeom)
```

<ParamField path="edgesDf" type="Dataset<Row>" required>
  A DataFrame consisting of all edges in the dataset. Each row in the RDD contains source node ID, destination node ID, a geometry column of type LineString that connects source and destination nodes, source node latitudes and longitudes, destination node latitudes and longitudes
</ParamField>

<ParamField path="pathsDf" type="Dataset<Row>" required>
  A DataFrame consisting of all target GPS tracks for map matching. Each row contains the track ID, sequence of coordinates, and a geometry column of type LineString connecting all GPS points
</ParamField>

<ParamField path="colEdgesGeom" type="String" required>
  A string denoting the geometry column in the edges dataFrame
</ParamField>

<ParamField path="colPathsGeom" type="String" required>
  A string denoting the geometry column in the paths dataFrame
</ParamField>

### Returns

<ResponseField name="Dataset<Row>" type="Dataset<Row>">
  A DataFrame consisting of map matching results for each target GPS tracks
</ResponseField>

## `loadOSM()`

<Warning>`loadOSM()` has been deprecated Use OSMLoader.loadOSM instead.</Warning>

Perform map matching between an RDD of edges and an RDD of GPS tracks

### Parameters

```java theme={"system"}
@Deprecated public static Dataset<Row> loadOSM(String osmPath, String tagsFilter)
```

<ParamField path="osmPath" type="String" required>
  A string denoting the path to the OSM xml file
</ParamField>

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

### Returns

A Spatial DataFrame representing the edges DataFrame required for map matching

## Usage Examples

```java theme={"system"}
import com.wherobots.Matcher;

// Example usage
Dataset<Row> result = Matcher.match(edgesDf, pathsDf, "geometry", "geometry");
```
