Skip to main content
Rail Routing and Mileage Functions
Contents
Function Reference
HRESULT _PCRSFN PCRSCalcTrip(Trip trip, char *orig, char *origRR, char *origGeo, char *dest, char *destRR, char *destGeo, long *pMiles)
- trip: A valid trip ID (obtained via
PCRSNewTrip
)
- orig: String containing origin place code
- origRR: Origin railroad SCAC code (4-char abbrev.)
- origGeo: City, SPLC, FSAC, ERPC, or Rule260
- dest, destRR, destGeo: Same as above for destination
- pMiles: Pointer to store calculated trip distance (in tenths of miles/kms)
HRESULT _PCRSFN PCRSCalculate(Trip trip, long *pMiles)
- trip: A valid trip ID (obtained via
PCRSNewTrip
)
- pMiles: Pointer to store calculated trip distance (in tenths of miles/kms)
- newParam:
P
, I
, S
, C
, A
, F
(Practical, Intermodal, Shortest, Coal/Bulk, Auto Racks, or Fuel Surcharge). Default = P
.
- newParam:
F
or N
(Familized or Non-familized). Default = F
.
- newParam:
I
or A
(Interactive or AutoRoute). Default = I
.
- newParam:
I
or E
(Include or Exclude junctions at origin or destination for AutoRoutes). Default = E
.
- newParam:
I
or E
(Include or Exclude railroads for autoRoutes that do not have active freight stations at location). Default = I
.
- newParam:
I
or E
(Include or Exclude intermodal-only stations on a Practical Route). Default = I
.
- newParam:
I
or E
(Include or Exclude Amtrak from generated autoRoutes). Default = I
.
HRESULT _PCRSFN PCRSGetRRs(Trip trip, short rrArray[], int rrArrayLen, int *numRRs)
- rrArray: Array of railroads
- rrArrayLen: Size of array
- numRRs: Total number of RRs in the route
HRESULT _PCRSFN PCRSGetNumRouteLegs(Trip trip, int *numLegs)
- numLegs: Number of carrier legs in the trip
HRESULT _PCRSFN PCRSGetNumRouteLinks(Trip trip, int *legNum)
HRESULT _PCRSFN PCRSGetRouteInfo(Trip trip, int legNum, LINKID *pLinks)
- legNum: Leg index number
- pLinks: Pointer to hold the links
HRESULT _PCRSFN PCRSGetRouteLegInfo(Trip trip, int which, short *rrNum, long *miles, char *rule260)
- which: Leg index number
- rrNum: RR number
- miles: Leg miles in tenths
- rule260: Junction name
HRESULT _PCRSFN PCRSLatLongsEnRoute(Trip trip, double* latlong, long numPairs)
- latlong: List of lat/long pairs
- numPairs: Number of lat/long pairs returned in the list