RoutingManager question

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.

Moderators: Unholy, bextein, JustinS83, Glodenox

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.

Re: RoutingManager question

Postby apapapap82 » Fri May 27, 2016 1:11 am

@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
Joined: Fri May 27, 2016 1:05 am
Has thanked: 0 time
Been thanked: 0 time

RoutingManager question

Postby DexDeadly » Wed May 11, 2016 2:48 am

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
Joined: Wed May 11, 2016 2:46 am
Has thanked: 0 time
Been thanked: 1 time

Re: RoutingManager question

Postby DexDeadly » Wed May 11, 2016 11:26 pm

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
Joined: Wed May 11, 2016 2:46 am
Has thanked: 0 time
Been thanked: 1 time

Re: RoutingManager question

Postby DexDeadly » Thu May 12, 2016 3:33 pm

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.

[ img ] 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
Joined: Wed May 11, 2016 2:46 am
Has thanked: 0 time
Been thanked: 1 time

Re: RoutingManager question

Postby DexDeadly » Thu May 12, 2016 9:17 pm

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
Joined: Wed May 11, 2016 2:46 am
Has thanked: 0 time
Been thanked: 1 time

Re: RoutingManager question

Postby DexDeadly » Mon Sep 19, 2016 5:26 pm

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
Joined: Wed May 11, 2016 2:46 am
Has thanked: 0 time
Been thanked: 1 time

Re: RoutingManager question

Postby Glodenox » Thu May 12, 2016 7:11 am

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.
Belgium & Luxembourg Coordinator • Script Writing Community Coordinator
[ img ][ img ]
Glodenox
Waze Global Champs
Waze Global Champs
 
Posts: 1107
Joined: Tue Aug 11, 2015 9:04 pm
Location: Belgium
Has thanked: 583 times
Been thanked: 1268 times

Re: RoutingManager question

Postby Glodenox » Thu May 12, 2016 3:39 pm

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.
Belgium & Luxembourg Coordinator • Script Writing Community Coordinator
[ img ][ img ]
Glodenox
Waze Global Champs
Waze Global Champs
 
Posts: 1107
Joined: Tue Aug 11, 2015 9:04 pm
Location: Belgium
Has thanked: 583 times
Been thanked: 1268 times

Re: RoutingManager question

Postby world_me05i9tq » Mon May 29, 2017 11:56 am

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
Joined: Mon May 29, 2017 11:49 am
Has thanked: 0 time
Been thanked: 0 time


Return to Addons, Extensions, and Scripts

Who is online

Users browsing this forum: jm6087, Mythdraug