Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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?

edit

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

share|improve this question
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. –  RyanDalton 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. –  fortmac Jan 4 '13 at 14:44
add comment

2 Answers

up vote 4 down vote accepted

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? )

share|improve this answer
add comment

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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