Discussion for the unofficial, community-developed addons, extensions and scripts built for the Waze Map Editor.

The official index of these tools is the Community Plugins, Extensions and Tools wiki page.

Post Reply
Forum rules
Discussion for the unofficial, community-developed addons, extensions and scripts built for the Waze Map Editor.

DO NOT START a new thread unless it is about a new idea. Keep discussion of existing tools within the main thread for that tool.

The official index of these tools is the Community Plugins, Extensions and Tools wiki page.

RoutingManager question

Post by DexDeadly
Hello. So I'm currently pulling the JSON returned data using the RoutingManager and a URL. I am able to total the time using the crossTime in my ruby script. However how do I calculate distance. I see there is a distance field returned in the JSON but is this feet, meters, yards? What is it or is there a different field returned in the JSON? Anyone able to help point me in the right direction.
DexDeadly
Posts: 5
Been thanked: 1 time

POSTER_ID:17350103

1

Send a message

Post by apapapap82
@DexDeadly-
That's my design/code!!!!!! I built that last year. I'm glad it didn't go to waste because I abandoned the project to rebuild using React.

I think a way to do it is run an http server on your phone and use Tasker to launch the app. But from there it might, I don't know if you can preset the route. It's something to look into.
apapapap82
Posts: 1
Send a message

Post by DexDeadly
Here is an example of the JSON that I am looking at.

https://www.waze.com/RoutingManager/rou ... 0&nPaths=1

Is there anyway I can pull the distance from this?
DexDeadly
Posts: 5
Been thanked: 1 time
Send a message

Post by DexDeadly
Hello,

I originally had tried the length field but it seemed to be incorrect because it kept changing. Here I found out it was a bit of a brain fart on my end. My ruby script didn't reload so it didn't look at the length field like I thought it was. I was able to accomplish what I was looking for doing the following in Ruby in case anyone was curious

routes['response']['results'].each do |results|
totalTime += results['crossTime']
totalTimeNormal += results['crossTimeWithoutRealTime']
totalDist += results['length']
end

totalTime = (totalTime/60).ceil
totalTimeNormal = (totalTimeNormal/60).ceil
totalDist = totalDist * 0.00062137
totalDist = totalDist.round(2)

Now when I return the value of totalDist I get the value I been expecting. I am currently using this in Dashing.io as a quick view in the morning when leaving. This displays on a tablet mounted on the wall by my door. Here is a picture.

I may change this to show 3 different routes. What I would like and I have no idea how or if it is possible is to have a button where I can send that specific route to my phone and launch Waze. Is this possible, I'm using android devices.
DexDeadly
Posts: 5
Been thanked: 1 time
Send a message

Post by DexDeadly
ahhh well that is exactly something I would love to have. This would be awesome to be able to do. FInd the route I want to take > Send to phone > ??? > profit. Oh well this is good enough for now.
DexDeadly
Posts: 5
Been thanked: 1 time
Send a message

Post by DexDeadly
Hey apapapap82.

Which part did you build? Where is the new project cause I'd love to check it out. I'm actually doing something new with PHP now. Still wish I had a way to send a specific route to waze though.
DexDeadly
Posts: 5
Been thanked: 1 time
Send a message

Post by Glodenox
I've just checked this myself to see the instructions on the livemap as well and it seems that the length is defined in each entry (= road segment) of 'results' as the amount of meters on that segment. Also in non-metric countries, the data seems to be expressed in meters. So the sum of all 'length' values of the entries in the results array gives you the total distance in meters.

Some example code for this:

Code: Select all

// assuming response is the JavaScript object representation of the response
response.results.reduce(function(a,b) { return a + b.length; }, 0);
To get a better feel of what is contained within the response, I advice to open the developer tools of your browser and look at the network requests. Very likely it will also make the results a lot more readable as well.
Glodenox
Waze Global Champs
Waze Global Champs
Posts: 1569
Answers: 1
Has thanked: 278 times
Been thanked: 946 times
Send a message
Belgium & Luxembourg Coordinator • Script Writing Community Coordinator
https://www.tomputtemans.com/images/WazeBelgium.pnghttps://www.tomputtemans.com/images/WazeWMEbeta.png

Post by Glodenox
As far as I'm aware that isn't possible. I don't think Waze exposes an intent that allows you to say which route to use. All you can do is say to where Waze should navigate as explained here.

EDIT: relevant UserVoice suggestion: Waze suggestion box: expose intents.
Glodenox
Waze Global Champs
Waze Global Champs
Posts: 1569
Answers: 1
Has thanked: 278 times
Been thanked: 946 times
Send a message
Belgium & Luxembourg Coordinator • Script Writing Community Coordinator
https://www.tomputtemans.com/images/WazeBelgium.pnghttps://www.tomputtemans.com/images/WazeWMEbeta.png

Post by world_me05i9tq
Hello,

I'm using RoutingManager to estimate time and km from 2 points.
I'm using this query found on the feed: https://www.waze.com/row-RoutingManager ... LOW_UTURNS

I have following questions about this query parameters :
- What AVOID_Trails and Callow_uturns refer to ?
- Is there other options available ? If yes, which ones ?
- What "At=0" refer to ?
- I would like to define a specific departure time, like 10 AM UTC, how can I specify that in my query ?

I have following questions about this query results :
- In summary, what "time", "cost","astarVisited" refer to ? and what is the unit ?
- Do time consider traffic ? if not, what do I have to do to consider traffic ?

Regards
world_me05i9tq
Posts: 1
Send a message