Syntax

long PCMSCalcTrip(Trip trip, char *orig, char *dest)


Parameters

Trip trip – Handle to a trip.

char *orig – A geocodable location defining the origin of the trip

char *dest – A geocodable location defining the destination of the trip.


Description

Returns the distance between an origin and destination by calculating the route using the current configuration of the trip. This function can be called repeatedly with new origins and destinations.  Each call will use the same trip options for each route. For longer or more complex trips, the origin and destination can be added with PCMSAddStop and run with PCMSCalculate.


Return Values 

Returns the trip distance multiplied by 10.0 as a floating-point number. Precision can be configured in an application-level setting.


Sample Code 

/* Calculate the distance using default calculation */
miles = PCMSCalcTrip(trip, “Chicago, IL”, “New York, NY”);

printf(“Practical: %f\n”, miles / 10.0);


Supported Since: PC*MILER|Connect 12

Category: Trip Management