# Map Match ## Match GPS coordinates to the road network `MapMatchResult MapMatch.Match(MapMatchMatchParamsparameters, CancellationTokencancellationToken = default)` **post** `/api/v1/map-match` Match GPS coordinates to the road network ### Parameters - `MapMatchMatchParams parameters` - `required IReadOnlyList coordinates` GPS coordinates to match, in order of travel (max 50 points) - `required Double Lat` Latitude in decimal degrees (-90 to 90) - `required Double Lng` Longitude in decimal degrees (-180 to 180) - `IReadOnlyList? radiuses` Search radius per coordinate in meters. Must have the same length as `coordinates` or be omitted entirely. Default: 50m per point. ### Returns - `class MapMatchResult:` Map matching result as a GeoJSON FeatureCollection. Each Feature is a snapped tracepoint. The top-level `matchings` array contains the matched sub-routes connecting consecutive tracepoints. - `required IReadOnlyList Features` Snapped tracepoint Features in input order - `required GeoJsonGeometry Geometry` GeoJSON Geometry object per RFC 7946. Coordinates use [longitude, latitude] order. 3D coordinates [lng, lat, elevation] are used for elevation endpoints. - `required Coordinates Coordinates` Coordinates array. Nesting depth varies by geometry type: Point = [lng, lat], LineString = [[lng, lat], ...], Polygon = [[[lng, lat], ...], ...], etc. - `IReadOnlyList` - `IReadOnlyList>` - `IReadOnlyList>>` - `IReadOnlyList>>>` - `required Type Type` Geometry type - `"Point"Point` - `"LineString"LineString` - `"Polygon"Polygon` - `"MultiPoint"MultiPoint` - `"MultiLineString"MultiLineString` - `"MultiPolygon"MultiPolygon` - `required Properties Properties` - `Double DistanceM` Distance from the original GPS point to the snapped point in meters - `Long EdgeID` Road edge ID the point was snapped to - `Long MatchingsIndex` Index into the `matchings` array indicating which matching sub-route this point belongs to - `string? Name` Road name at the snapped point - `IReadOnlyList Original` Original GPS coordinate as [lng, lat] - `Long WaypointIndex` Index of this tracepoint in the original `coordinates` array - `required Type Type` - `"Feature"Feature` - `required IReadOnlyList> Matchings` Matched sub-routes. Each matching connects a contiguous sequence of tracepoints that could be matched to roads. - `required Type Type` - `"FeatureCollection"FeatureCollection` ### Example ```csharp MapMatchMatchParams parameters = new() { Coordinates = [ new() { Lat = 48.8566, Lng = 2.3522, }, new() { Lat = 48.857, Lng = 2.353, }, new() { Lat = 48.8575, Lng = 2.354, }, ], }; var mapMatchResult = await client.MapMatch.Match(parameters); Console.WriteLine(mapMatchResult); ``` #### Response ```json { "features": [ { "geometry": { "coordinates": [ 2.3522, 48.8566 ], "type": "Point" }, "properties": { "distance_m": 0, "edge_id": 0, "matchings_index": 0, "name": "name", "original": [ 0, 0 ], "waypoint_index": 0 }, "type": "Feature" } ], "matchings": [ { "foo": "bar" } ], "type": "FeatureCollection" } ``` ## Domain Types ### Map Match Request - `class MapMatchRequest:` GPS trace to snap to the road network. Provide an array of coordinate objects representing the GPS points. Maximum 50 points per request. - `required IReadOnlyList Coordinates` GPS coordinates to match, in order of travel (max 50 points) - `required Double Lat` Latitude in decimal degrees (-90 to 90) - `required Double Lng` Longitude in decimal degrees (-180 to 180) - `IReadOnlyList? Radiuses` Search radius per coordinate in meters. Must have the same length as `coordinates` or be omitted entirely. Default: 50m per point. ### Map Match Result - `class MapMatchResult:` Map matching result as a GeoJSON FeatureCollection. Each Feature is a snapped tracepoint. The top-level `matchings` array contains the matched sub-routes connecting consecutive tracepoints. - `required IReadOnlyList Features` Snapped tracepoint Features in input order - `required GeoJsonGeometry Geometry` GeoJSON Geometry object per RFC 7946. Coordinates use [longitude, latitude] order. 3D coordinates [lng, lat, elevation] are used for elevation endpoints. - `required Coordinates Coordinates` Coordinates array. Nesting depth varies by geometry type: Point = [lng, lat], LineString = [[lng, lat], ...], Polygon = [[[lng, lat], ...], ...], etc. - `IReadOnlyList` - `IReadOnlyList>` - `IReadOnlyList>>` - `IReadOnlyList>>>` - `required Type Type` Geometry type - `"Point"Point` - `"LineString"LineString` - `"Polygon"Polygon` - `"MultiPoint"MultiPoint` - `"MultiLineString"MultiLineString` - `"MultiPolygon"MultiPolygon` - `required Properties Properties` - `Double DistanceM` Distance from the original GPS point to the snapped point in meters - `Long EdgeID` Road edge ID the point was snapped to - `Long MatchingsIndex` Index into the `matchings` array indicating which matching sub-route this point belongs to - `string? Name` Road name at the snapped point - `IReadOnlyList Original` Original GPS coordinate as [lng, lat] - `Long WaypointIndex` Index of this tracepoint in the original `coordinates` array - `required Type Type` - `"Feature"Feature` - `required IReadOnlyList> Matchings` Matched sub-routes. Each matching connects a contiguous sequence of tracepoints that could be matched to roads. - `required Type Type` - `"FeatureCollection"FeatureCollection`