Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

Construct Entire Route / Spatial Tool

Mukeshy12390
8 - Asteroid

Hi Everyone,

 

I have been trying to construct an entire route and find out the distance of the route rounded to the nearest mile.

 

what details I have.. 1 file with details like Point# , Longitude and Latitude.

 

Is there any we can do that using tool available in Spatial?

 

 

Thanks,

Mukesh

 

4 REPLIES 4
mst3k
11 - Bolide

Unless you have the add on package to get street info, or you interface with google API or something, the spatial tools will only be able to tell you the distance "as the crow flies" between each point, not actual street distances which will be longer since they will never go the shortest path between each point.

 

Assuming your points are already arranged in the order you want to go in, then the easiest thing to do would be to put a Poly-build tool in, configure it to make a Sequence polyline. Add a recordID if you need to, to use as the sequence field (again you will already need to have the points in the order you want to go in). If you also need to figure out the shortest path between all of them, so you don't already know the order you want to go in... that's a much tougher problem.

 

Now that you have a polyline object, you can just put a Spatial Info tool after it and it should tell you the length of your line.

Mukeshy12390
8 - Asteroid

thanks for the quick reply.

 

I didn't mention earlier data are in sequence order from starting point to endpoint.

 

ArtApa
Alteryx
Alteryx

Hi @Mukeshy12390 - Have a look at the following Weekly Challenge and its solutions: https://community.alteryx.com/t5/Weekly-Challenge/Challenge-266-Mother-s-Day-Bouquet/td-p/753922 

danilang
19 - Altair
19 - Altair

Hi @Mukeshy12390 

 

You can start by using the Create Point tool to build a Spatial [StartPoint] out of your lat-lon fields.  Order the points by [Point#] and use a multirow tool to copy the [StartPoint] from Row+1 as the [EndPoint] of Row.  Add a Formula tool to create [Line] from [StartPoint] to [EndPoint]  

ST_CreateLine([StartPoint],[EndPoint])

Use a Poly-Build tool to create a Sequence Polyline using [Line] as the Source Field and [Point#] as the Sequence field.  A Spatial Info tool can then return the length of your new Polyline in either Miles or Kilometers.

 

Dan

Labels