This component allows you to query the Tom Tom API for trip distance and duration information.
Expected inputs (coordinates in decemal fomart): -
- Starting latitude
- Starting longitude
- Ending latitude
- Ending longitude
Outputs: -
- Departure Time
- Arrival Time
- Trip Duration
- Travel Time (Seconds)
- Traffic Delay (Seconds)
- Distance (Kilometers)
- Distance (Meters)
- Traffic Length (Kilometers)
- Traffic Length (Meters)
Note that you need a Tom Tom Developer API key to use this component. It is free, thanks to their generous fremium plan. With the API key, you get 2,500 free API calls per day.
You can register here: -
https://developer.tomtom.com/user/register
They don't require a credit card or ask for a lot of personal detail. Once you sign up, you will receive your API key by email. You can also find it in your developer dashboard. Here's a link to that: -
https://developer.tomtom.com/user/me/apps
Troubleshooting
- If you see the following error message, then you most likely have a trailing space in your API key.
"ERROR GET Request 0:0:12 Execute failed: java.lang.IllegalArgumentException: Illegal character in query at index "
As a best practice, copy your API key by clicking on the clipboard icon next to your API key on the Tom Tom developer dashboard.
- If the component fails all together, then ensure that you provided your API key. The component would also fail if no data was retrived. View the console for the relevant error message. Here are details from the Tom Tom site to help debug status code errors: -
- 200 OK
- 206 Partial Content
- 400 Malformed request: The requested syntax is not available.
- 400 Bad request: Parameters out of range.
- 401 Unauthorized:
The supplied Admin Key is not valid for this Request.
No Admin Key is supplied.
- 401 Unauthorized: Configuration not found.
The configuration does not exist in the database.
The user has not registered an Admin Key.
- 403 Forbidden: The supplied API Key is not valid for this Request.
- 403 Forbidden: User can only register once.
- 429 Too Many Requests: The API key is over QPS (Queries per second).
- 500 Internal Server Error: There is a problem with the TomTom Road Event Reporter Enterprise API service.
Status error codes source: - https://developer.tomtom.com/rer-enterprise-api/road-event-reporter-enterprise-api-documentation-locations-service/status-id
If you have any questions or suggestions please email me at Sntrada@hotmail.com
Enjoy!
- Type: TableCoordinatesCoordinates