I set up Open Source Routing Machine (OSRM). The documentation does a pretty good job of laying everything out and I was able to get a server set up and running on my machine. My question is about handling the JSON output from my server. As explained in the documentation the routing information is encoded. My application was built accepting JSON from Mapquest's Open API which is unencoded.

My question is do I need to perform a special function to unencode the data? Or better yet, is their some feature baked into OSRM I am not using properly to get the unencoded results?


Solved: Adding ?compression=false to the request query will output unencoded data.

  • 3
    since you solved it yourself, feel free to add your solution as an "Answer" below and mark it as "Accepted" to close the question. Thanks. – RyanKDalton Jan 3 '13 at 21:45
  • I think he cannot accept his own answer for his own question.... It will be a little crazy introspective thing to do... ( well, better than downvote his own answer !! ) – Magno C Jan 4 '13 at 14:03
  • I figured out the solution right after I posted the question. But, because I didn't have enough points, I would have had to wait 8 hours to answer it. – kevinaskevin Jan 4 '13 at 14:44

Solved by himself :

Adding ?compression=false to the request query will output unencoded data.

A proof that smeagol and gollum can work together. ( what is compression, my precious? )

| improve this answer | |

Instead of avoiding compression you can fix the real problem.

If you have lots of points (which is the case for routing) and you send them as normal json numbers you have a big response and a problem. To reduce that size one could embed a binary form of the point list into the json.

OSRM is doing this via googles algorithm, of course there are other options and algorithms.

Now to read that data you can just use the OSRM utility or the google one on the javascript side.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.