trace Attributes
Map-match a GPS trace onto the road network and return the attributes of every edge along the matched path.
This is Valhalla's trace_attributes action. Use it instead of traceRoute when you need the road network itself — edge identifiers, road classes, speeds, names — rather than turn-by-turn directions. Narrow the response with TraceAttributesRequest.filters; by default Valhalla returns every attribute it has, which is a lot of JSON for a long trace.
Everything runs against the tiles already on the device, so this works with no network.
Unlike traceRoute, this action always answers with Valhalla's own JSON — a format on the request's directions options is ignored rather than rejected.
Exclude matched.edge_index through TraceAttributesRequest.filters when matching with map_snap. Valhalla leaves that field unpopulated for some matched points while still reporting a valid edge id, so it emits the size_t sentinel — 18446744073709551615 — which does not fit in a Long, and the whole response becomes undecodable rather than just that one field. Tracked upstream as valhalla/valhalla#3699, with a fix proposed in valhalla/valhalla#6278.
Return
The matched edges, points, and the admins they reference.
Parameters
The trace to match, the costing model, and which attributes to return.
See also
Throws
if the Valhalla engine returns an error response, which includes the case where the trace cannot be matched to the road network.
if the response JSON cannot be parsed.