Walking instruction in transit Route

There is no detail walking step instruction in routeType pt, but geo points included.

eg; routeType: pt

“steps”: [
{
“distance”: 365.733,
“relativeDirection”: “DEPART”,
“streetName”: “path”,
“absoluteDirection”: “SOUTH”,
“stayOn”: false,
“area”: false,
“bogusName”: true,
“lon”: 103.84352824,
“lat”: 1.317997417,
“elevation”: []
}
]

In routeType: walk

“route_instructions”: [
[
“Straight”,
“”,
16,
“1.317997,103.843528”,
12,
“16m”,
“South”,
“North”,
“walking”,
“Head Southeast”
]

Could you include walking route instructions more detail with street name if need to walk on street?

eg; “Head Southeast on Goldhill plaza toward Khing Guan Eve.”

Hi @Thin

Thank you for your valuable feedback. We are looking into incorporating the detailed walking step instruction in routeType PT. As for routeType Walk, as the number of instructions returned can be overwhelming to end users if the distance between the 2 points are far, we will reviewed the feasibility of implementing your request again within the team!

1 Like

Hi @junhong , Thanks for response. How about street name , will you able to provide if available in walking instruction, so that we don’t need to reverse geocode in each walking steps.

Hi @Thin

After evaluating your request with my team. It is not possible to provide street name in the walking instructions. The reason is that we do not have the resource to include the street names in all the walking routes steps. We will keep this in mind and see if we can include it in future.

hi,
iam trying to render route from onemap and my code to decode the route is as follows

                 //getting route geometry
                 var geometryOfRoute = response.route_geometry;
                console.log(geometryOfRoute);
               
                //Decode polyine to 6 decimal points
                var polyline = L.polyline(L.PolylineUtil.decode(geometryOfRoute, 6), {
                    color: "purple",
                    weight: 5,
                    smoothFactor: 1
                });
               //Getting bounds
                var bounds = polyline.getBounds();
                //Adding polyline to our map
                polyline.addTo(this.map);
                //Zoom to bounds
                this.map.fitBounds(bounds);

iam getting response, route_geometry and everything… but iam unable to show route in map…its not showing the route and shows error like cannot read property “decode” of undefined…
can anyone help me with showing routes in onemap using onemap routing service.

Hi Monisha,

As you noticed, JS executes its code based on fastest completion in a single thread. In your case, the response might be returning the information slower than you are decoding them (undefined object). This results in the non-display of the route.

You might be encountering asynchronous issues(callback hell) in your Javascript code.

Please visit this website to understand more:

Hi,
iam trying to show route from one poiint to other using onemap routing service…
the following lines are my code

var polyUtil = require(‘polyline-encoded’);
var encoded = response.route_geometry;
console.log(‘encoded’, encoded)

                var latlngs = polyUtil.decode(encoded, {
                    precision: 6
                })
                console.log('latlngs', latlngs)
                this.polyline = L.polyline(latlngs, {
                    color: "red",
               
                }).addTo(this.map); 

…so after calling the routing api iam getting the response as

  1. {status_message: “Found route between points”, route_geometry: “qgnG}xdyRDGCCUOKGWSQ@@D?B?DAHADCBy@m@INQVGE]QGBYh@G@EJSI_@Y”, status: 0, route_instructions: Array(11), route_name: Array(1), …}

  2. route_geometry:“qgnG}xdyRDGCCUOKGWSQ@@D?B?DAHADCBy@m@INQVGE]QGBYh@G@EJSI_@Y

  3. route_instructions:Array(11)

  4. 0:(10) [“Head”, “”, 6, “1.388889,103.904312”, 4, “6m”, “South East”, “North”, “walking”, “Head Southeast”]

  5. 1:(10) [“Left”, “”, 44, “1.388856,103.904351”, 32, “44m”, “North East”, “South East”, “walking”, “Turn Left”]

  6. 2:(10) [“Left”, “”, 32, “1.389166,103.904589”, 23, “32m”, “North”, “North East”, “walking”, “Turn Left”]

  7. 3:(10) [“Right”, “”, 42, “1.389288,103.904398”, 30, “42m”, “North East”, “North West”, “walking”, “Turn Right”]

  8. 4:(10) [“Left”, “”, 27, “1.38958,103.904626”, 20, “27m”, “North West”, “North East”, “walking”, “Turn Left”]

  9. 5:(10) [“Right”, “”, 26, “1.389717,103.904431”, 19, “26m”, “North East”, “North West”, “walking”, “Turn Right”]

  10. 6:(10) [“Left”, “”, 34, “1.389907,103.904552”, 25, “34m”, “North West”, “North East”, “walking”, “Turn Left”]

  11. 7:(10) [“Right”, “”, 5, “1.390083,103.904316”, 4, “5m”, “North”, “North West”, “walking”, “Turn Right”]

  12. 8:(10) [“Left”, “”, 7, “1.390124,103.904308”, 5, “7m”, “North West”, “North”, “walking”, “Turn Left”]

  13. 9:(10) [“Right”, “”, 36, “1.390152,103.904252”, 26, “36m”, “North East”, “North West”, “walking”, “Turn Right”]

  14. 10:(10) [“Destination”, “”, 0, “1.390414,103.904425”, 0, “0m”, “North”, “North East”, “walking”, “You Have Arrived At Your Destination”]

  15. length:11

  16. proto:Array(0)

  17. route_name:[""]

  18. route_summary:{start_point: “”, end_point: “”, total_time: 183, total_distance: 254}

  19. status:0

  20. status_message:“Found route between points”

and after decoding my route_geometry using the above code iam getting an array of objects

  1. (24) [Array(2), Array(2), Array(2), Array(2), Array(2), Array(2), Array(2), Array(2), Array(2), Array(2), Array(2), Array(2), Array(2), Array(2), Array(2), Array(2), Array(2), Array(2), Array(2), Array(2), Array(2), Array(2), Array(2), Array(2)]

  2. 0:(2) [0.138889, 10.390431]

  3. 1:(2) [0.138886, 10.390435]

  4. 2:(2) [0.138888, 10.390437]

  5. 3:(2) [0.138899, 10.390445]

  6. 4:(2) [0.138905, 10.390449]

  7. 5:(2) [0.138917, 10.390459]

  8. 6:(2) [0.138926, 10.390458]

  9. 7:(2) [0.138925, 10.390455]

  10. 8:(2) [0.138925, 10.390453]

  11. 9:(2) [0.138925, 10.39045]

  12. 10:(2) [0.138926, 10.390445]

  13. 11:(2) [0.138927, 10.390442]

  14. 12:(2) [0.138929, 10.39044]

  15. 13:(2) [0.138958, 10.390463]

  16. 14:(2) [0.138963, 10.390455]

  17. 15:(2) [0.138972, 10.390443]

  18. 16:(2) [0.138976, 10.390446]

  19. 17:(2) [0.138991, 10.390455]

  20. 18:(2) [0.138995, 10.390453]

  21. 19:(2) [0.139008, 10.390432]

  22. 20:(2) [0.139012, 10.390431]

  23. 21:(2) [0.139015, 10.390425]

  24. 22:(2) [0.139025, 10.39043]

  25. 23:(2) [0.139041, 10.390443]

but these latitude and longitudes corresponds to africa…but my start and end locationis in singapore…though i get route_instructions correctly…after decodingt the route-geometry it showing africa’s latlngs…also route-instructions from returned response has only 11 array objects whereas the array of latlngs after decoding the route-geometry is 24

i dont know whats the problem is. can u please help me to sort out this issue

hi,

tq ,actually i got my route rendered to my map… the mistake was in giving precision

i just removed the precision while decoding the route-geometry and now its showing correct route…

Hi Monisha,

The default precision is ‘5’.

Yesterday is a busy day for us! Thankfully you are able to resolve it.

Enjoy your day!!

Regards,
Kai