Find what exit-based highways are within 50 miles of a given latitude/longitude.
JSON Response
Key | Value | Description |
---|---|---|
highways | Array of Highways | An array of Highway objects that represent the exit-based highways found within 50 miles of the supplied coordinate. These Highway objects contain 2 special child Exit objects. One is under the negative_exit key and the other is under the positive_exit key. Read below for more details. |
It is a useful feature to allow the user to see what highways are nearby. If a user is sitting in a diner off of an exit on I-85, the On Highway Detection API will correctly detect that they are not on the highway. So how can we allow them to view I-85 (or other nearby highways) exits ahead so they can plan their trip while taking a break?
That's what this API will allow. Supply it a coordinate and it will return an array of Highway objects for all exit-based highways within 50 miles.
The Highway objects returned in the highways
array have a special structure, defined below.
And then each of positive_exit
and negative_exit
have a child Highway In State object under the key highway_in_state
. This Highway In State object contains a child State object and a child Direction object, but not a child Highway object as that would be redundant.
Common Next API(s)
- Upcoming Exits (by using
highways[]
.positive_exit
.id
orhighways[]
.negative_exit
.id
) - Exits for Highway in State (by using
highways[]
.positive_exit
.highway_in_state
.id
andhighways[]
.positive_exit
.highway_in_state
.direction
.current_direction
ORhighways[]
.negative_exit
.highway_in_state
.id
andhighways[]
.negative_exit
.highway_in_state
.direction
.current_direction
)
This API allows you to easily feed results to either the Upcoming Exits API or the Exits for Highway in State API, depending on preference. To use the Upcoming Exits API, simply use the id
for either the positive_exit
or negative_exit
child Exit objects.
To supply the Exits for Highway in State API, you will have to make use of the child Highway In State object of positive_exit
or negative_exit
. You will want to use highway_in_state
.id
along with highway_in_state
.direction
.current_direction
. You should have no use for highway_in_state
.direction
.reverse_direction
in this use case.