Skip to main content
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

public static Dataset<Row> match( Dataset<Row> edgesDf, Dataset<Row> pathsDf, String colEdgesGeom, String colPathsGeom)
edgesDf
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
pathsDf
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
colEdgesGeom
String
required
A string denoting the geometry column in the edges dataFrame
colPathsGeom
String
required
A string denoting the geometry column in the paths dataFrame

Returns

Dataset<Row>
Dataset<Row>
A DataFrame consisting of map matching results for each target GPS tracks

loadOSM()

loadOSM() has been deprecated Use OSMLoader.loadOSM instead.
Perform map matching between an RDD of edges and an RDD of GPS tracks

Parameters

@Deprecated public static Dataset<Row> loadOSM(String osmPath, String tagsFilter)
osmPath
String
required
A string denoting the path to the OSM xml file
tagsFilter
String
required
A string denoting the tags to be used for filtering the OSM data

Returns

A Spatial DataFrame representing the edges DataFrame required for map matching

Usage Examples

import com.wherobots.Matcher;

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