DecodeRoute Route Input


#1

Could I get a sample of the input required for the “route” parameter?

I found a route from KHOU-KAUS on FlightAware (“IDU4 IDU WLEEE BITER6”) and got back the error “unable to decode.”


#2

That route decodes fine for me:

flightxml.flightaware.com/json/ … E%20BITER6

{“DecodeRouteResult”:{“next_offset”:-1,“data”:{“name”:“KHOU”,“type”:“Origin Airport”,“latitude”:29.645418599999999287,“longitude”:-95.27888889999999833},{“name”:“SHYNR”,“type”:“Reporting Point”,“latitude”:29.927305600000000396,“longitude”:-96.040499999999994429},{“name”:“BOCCK”,“type”:“Reporting Point”,“latitude”:29.936749999999999972,“longitude”:-96.207583299999996029},{“name”:“IDU”,“type”:“VOR-TAC (NAVAID)”,“latitude”:29.956055599999999117,“longitude”:-96.562194399999995653},{“name”:“KAUS”,“type”:“Destination Airport”,“latitude”:30.194527799999999473,“longitude”:-97.669888900000003673}]}}

When using the DecodeRoute function, be sure that the origin and destination airport codes are properly specified.

Be aware that not all routes filed by flights can be reliably understood by DecodeRoute, so you should be prepared for some to return an error.


#3

Ok it worked after I transferred the object’s text value to a variable instead of passing the object’s text value directly.

Doesn’t work:

flaFlightRouteStructArray = flaInfo.DecodeRoute(txtOrigin.Text, txtRoute.Text, txtDestination.Text)

Does work:

Dim strOrigin As String = txtOrigin.Text.Trim
Dim strRoute As String = txtRoute.Text.Trim
Dim strDestination As String = txtDestination.Text.Trim
flaFlightRouteStructArray = flaInfo.DecodeRoute(strOrigin, strRoute, strDestination)