Understanding a matrix response

Apologies for the basic noobie question but haven’t been able to find a good definition of “snapped_distance” despite searching this forum and googling in general.

My use case will be to find the closest driving route from one point to potentially 10-20 points, so I believe using the matrix service makes sense. I’ve been able to make both ORS API playground queries and also HTTP based queries in my program and get good results. I’m just trying to understand them better and haven’t figured out “snapped_distance”, especially when my single source [0] has a value. What is it ‘snapping’ to?

Also, separately, are the distances that are reported in the distances array beeline distances or roadway routing distances (assuming I specified driving-car in my URL)?

Thank you.

Hey,

in the playground matrix request, you’ll find a “response” tab, where clicking on the green questionmark will give you the response documentation (a bit hidden, I’ll admit…).

From this documentation:

snapped_distance (double)
Distance between the source/destination Location and the used point on the routing graph.

The snapped_distance is a beeline distance.

Distances reported by the matrix endpoint in the distances array are roadway routing distances.

Best regards

1 Like