[OSRM-talk] Need help understanding the json responses

Stephen Woodbridge woodbri at swoodbridge.com
Mon Nov 18 22:44:46 UTC 2013


Hi,

I'm parsing the json responses and the is going well, but my question is 
more related what is all this stuff? :)

Most of it makes sense, but I'm a little confused by the following:

The instructions indicate road names: N20, N60, N2, N61, N28, ""
So the "" is on the arrive at destination maneuver, but not sure what 
the rationale for not having a name there.

The route summary otherwise states the start point and end point names 
correctly as N20, N28

How is "route_name" determined? The wiki page states "Array of strings 
giving the name of roads." There does not appear to be an 
"alternative_names" item so this must be unique to the route regardless 
of alternatives?

What are the "via_points"? How are they determined? These appear to be 
the mapped locations for the start and end points like if I called 
nearest?loc=lat,lon

Is the position field in the instructions an index into a point in the 
route geometry array?

BTW, thanks for putting up with all my questions, this is all starting 
to come together. Great job all around!

Thanks
-Steve

GET 
'http://imaptools.com:5000/viaroute?instructions=true&alt=true&z=18&loc=43.235198,-76.420898&loc=43.709579,-76.286316'
{"version": 0.3,
  "status":0,
  "status_message": "Found route between points",
  "route_geometry": 
"{|zmqA`qjwpC?wyP?o{qBl{qB??m{qBm{qB?o{qB?m{qB?o{qB?m{qB?o{qB?m{qB?o{qB?m{qB??ufN",
  "route_instructions": [
     ["10","N20",5506,0,2915,"5506m","E",90],
     ["3","N60",6542,2,562,"6542m","S",180],
     ["7","N2",4771,3,146,"4771m","E",90],
     ["7","N61",58884,4,1797,"58884m","N",0],
     ["3","N28",627,13,153,"627m","E",90],
     ["15","",0,14,0,"","N",0.0]],
   "route_summary":{
     "total_distance":76332,
     "total_time":4676,
     "start_point":"N20",
     "end_point":"N28"
   },
   "alternative_geometries": [],
   "alternative_instructions":[],
   "alternative_summaries":[],
   "route_name":["N60","N61"],
   "alternative_names":[["",""]],
   "via_points":[[43.235294,-76.420897 ],[43.705882,-76.286315 ]],
   "hint_data": {
     "checksum":52824373,
     "locations": ["Dw0AAA4AAADwOAAAdgoAAJqulHdeCOs_3reTAt_ocfs",
                   "MRIAABYAAADkBgAAES0AAEeiWVys-sA_GuaaApX2c_s"]
   },
   "transactionId": "OSRM Routing Engine JSON Descriptor (v0.3)"
}



More information about the OSRM-talk mailing list