- Introduction to WorkXpress
- Building Your Application
- Examples and Best Practices
- Technical Manual
This shows you the differences between two versions of the page.
expression function - time between driving [2016/09/14 18:19] |
expression function - time between driving [2016/09/14 18:19] (current) |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Time Between - Driving (Expression Function) ====== | ||
+ | //This function is available in Platform Versions 14.05.948 and above.// | ||
+ | ===== Purpose ===== | ||
+ | The **Time Between - Driving** function (TIME_BETWEEN_DRIVING) calculates the approximate time to drive between two points on Earth. | ||
+ | {{ ::time_betwee_driving_initial.png? |}} | ||
+ | |||
+ | ===== Parameters ===== | ||
+ | This function has a variable number of parameters depending on the data being used: | ||
+ | |||
+ | To pass the source and destination locations using Latitude and Longitude the first four parameters should be: | ||
+ | * Source Latitude | ||
+ | * Source Longitude | ||
+ | * Destination Latitude | ||
+ | * Destination Longitude | ||
+ | |||
+ | -OR- | ||
+ | |||
+ | To pass the source and destination locations using [[Field Type - Address|Address Field]] values then the first two parameters should be: | ||
+ | * Source Address Field (Stored Value) | ||
+ | * Destination Address Field (Stored Value) | ||
+ | |||
+ | -OR- | ||
+ | |||
+ | To pass the source and destination locations using Address Field parts then the first eight parameters should be: | ||
+ | * Source Street | ||
+ | * Source City | ||
+ | * Source State | ||
+ | * Source Zip | ||
+ | * Destination Street | ||
+ | * Destination City | ||
+ | * Destination State | ||
+ | * Destination Zip | ||
+ | |||
+ | -AND- | ||
+ | |||
+ | Regardless of the source and destination input parameters, the following parameters can follow the source and destination inputs. All of these parameters are optional and their default values are in bold. | ||
+ | |||
+ | * Format (**"formatted"**, "seconds") | ||
+ | * Use Premium Data ("yes" | **"no"**) | ||
+ | * Route Type (**"fastest"** | "shortest" | "pedestrian" | "walking and public transport" | "bicycle") | ||
+ | * Avoid Highways ("yes" | **"no"**) | ||
+ | * Avoid Toll Roads ("yes" | **"no"**) | ||
+ | ===== Output ===== | ||
+ | |||
+ | The output of the **Distance Between - Driving** function is a number or a string representing the time to drive between two points. | ||
+ | |||
+ | ===== Example ===== | ||
+ | |||
+ | For example, the time to drive between 304 Market St. Harrisburg, PA and 304 Market St. San Francisco CA would be: | ||
+ | |||
+ | TIME_BETWEEN_DRIVING(40.261081,-76.880648,37.792335,-122.397622) will result in 40:26:11. | ||
+ | |||
+ | TIME_BETWEEN_DRIVING(40.261081,-76.880648,37.792335,-122.397622,"seconds") will result in 145571. |