Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Spatial Tools and Truck Routes

Treyson
13 - Pulsar
13 - Pulsar

What's up everybody!

 

I am trying to calculate distance between two points for truck routing, but I find that the distance tool is getting crushed because we have some 1000+ mile distances. Are there any best practices for long distance calculations? Does anyone know of a way to limit the travel to routes that are "truck safe"? I am really interested in the possibilities here, so any advice is welcome! (example attached)

 

TreysonDistance.png

Treyson Marks
Senior Analytics Engineer
6 REPLIES 6
dataMack
12 - Quasar

For something like this I would look into using the Google Directions API and DistanceMatrix API.  It's easy to build the URL in Alteryx and parse out the response (XML or JSON).  With Google, you'd get the flexibility to add waypoints to the route (ex assume your truck as to visit different distribution centers, etc.) as well as specific preferences to do things like avoid toll roads.  The documentation is here:

https://developers.google.com/maps/documentation/directions/

 

Treyson
13 - Pulsar
13 - Pulsar

Have you done this process before? I am having some issues with the URL here and I need some help. I have attached a new copy of the YXDB. I removed my key from this, but I know the key is fine becasue it was working with the examples provided.

 

I am glad that you showed me this because I wanted to learn the download tool anyay. 

Treyson Marks
Senior Analytics Engineer
SophiaF
Alteryx
Alteryx

Hi @Treyson,

 

Attached are 2 workflows that should help you get started. The first connects to the Google DistanceMatrix API (as mentioned by @dataMack) and does a simple distance calculation. The second uses the Google Maps Directions API (thanks again Jason!) to avoid tolls and ferries and outputs directions as well as an overall distance. Definitely a good place to get started when learning the download tool - this one even lets you explore Blob type fields a bit!

 

*For both workflows, be sure to enter your API key (each will have a separate API key as they reference different APIs) in the Formula tool after the Join.

 

Cheers,

 

 

 

 

Sophia Fraticelli
Senior Solutions Architect
Alteryx, Inc.
Treyson
13 - Pulsar
13 - Pulsar

This is the coolest thing I have seen all day! Thank you so much!

Treyson Marks
Senior Analytics Engineer
SophiaF
Alteryx
Alteryx

Happy to help!

Sophia Fraticelli
Senior Solutions Architect
Alteryx, Inc.
sriniprad08
11 - Bolide

Hi All,

 

I have Lat/ long points and i need to calculate the total length of the trip in miles? How should i go about it? i have used the poly-build and used the options length(miles). is that correct? thanks

Labels