Helps get live and historical GPS data on vehicles by accessing the "Live Vehicle Positions" API.
More...
|
async Task< VehiclePosition[]> | GetArchivedVehiclePositions (DateTime dateStartTime, TimeSpan timeSpan) |
| Gets historic/archived GPS data for buses on a specific date, filtered either by vehicle ID, or all buses without a time period or both. GPS data is not stored for as long as other forms of data you may fail to get data older than a few months. More...
|
|
async Task< VehiclePosition[]> | GetArchivedVehiclePositions (DateTime dateStartTime, TimeSpan timeSpan, string vehicle) |
| Gets historic/archived GPS data for buses on a specific date, filtered either by vehicle ID, or all buses without a time period or both. GPS data is not stored for as long as other forms of data you may fail to get data older than a few months. More...
|
|
async Task< LiveVehiclePosition[]> | GetLiveVehiclePositions () |
| Gets live GPS data for all buses currently operating. More...
|
|
async Task< LiveVehiclePosition > | GetLiveVehiclePosition (string vehicle) |
| Gets live GPS data for a single buses matching Vehicle ID number. More...
|
|
async Task< bool > | IsVehicle (string vehicle) |
| Checks if the Vehicle ID Number is currently in service right now. More...
|
|
|
| GpsController () |
| Creates a GPS Controller, you should not need to make your own GPS controller, you can get an instance of one via the main 'ReadingBuses' object. More...
|
|
Helps get live and historical GPS data on vehicles by accessing the "Live Vehicle Positions" API.
◆ GpsController()
ReadingBusesAPI.VehiclePositions.GpsController.GpsController |
( |
| ) |
|
|
package |
Creates a GPS Controller, you should not need to make your own GPS controller, you can get an instance of one via the main 'ReadingBuses' object.
◆ GetArchivedVehiclePositions() [1/2]
async Task< VehiclePosition[]> ReadingBusesAPI.VehiclePositions.GpsController.GetArchivedVehiclePositions |
( |
DateTime |
dateStartTime, |
|
|
TimeSpan |
timeSpan |
|
) |
| |
Gets historic/archived GPS data for buses on a specific date, filtered either by vehicle ID, or all buses without a time period or both. GPS data is not stored for as long as other forms of data you may fail to get data older than a few months.
- Parameters
-
dateStartTime | Vehicle ID Number eg 414 |
timeSpan | (optional) How long a period do you want data for, you can not get multiple days worth of data. If you ask this your result will be automatically truncated to only the start date to midnight. |
- Returns
- An array of GPS locations at a previous date.
- Exceptions
-
ReadingBusesApiExceptionMalformedQuery | Thrown if, you have not choose a date in the past, or the date is too far in the past and so no data exists. Thrown if you have not filtered by either 'timeSpan' or 'vehicle' ID or both. Thrown if the API key is invalid or expired. |
ReadingBusesApiExceptionBadQuery | Thrown if the API responds with an error message. |
ReadingBusesApiExceptionCritical | Thrown if the API fails, but provides no reason. |
See GpsController.GetLiveVehiclePositions() to get live data instead.
◆ GetArchivedVehiclePositions() [2/2]
async Task< VehiclePosition[]> ReadingBusesAPI.VehiclePositions.GpsController.GetArchivedVehiclePositions |
( |
DateTime |
dateStartTime, |
|
|
TimeSpan |
timeSpan, |
|
|
string |
vehicle |
|
) |
| |
Gets historic/archived GPS data for buses on a specific date, filtered either by vehicle ID, or all buses without a time period or both. GPS data is not stored for as long as other forms of data you may fail to get data older than a few months.
- Parameters
-
dateStartTime | Vehicle ID Number eg 414 |
timeSpan | (optional) How long a period do you want data for, you can not get multiple days worth of data. If you ask this your result will be automatically truncated to only the start date to midnight. |
vehicle | (optional) Vehicle ID Number eg 414 |
- Returns
- An array of GPS locations at a previous date.
- Exceptions
-
ReadingBusesApiExceptionMalformedQuery | Thrown if, you have not choose a date in the past, or the date is too far in the past and so no data exists. Thrown if you have not filtered by either 'timeSpan' or 'vehicle' ID or both. Thrown if the API key is invalid or expired. |
ReadingBusesApiExceptionBadQuery | Thrown if the API responds with an error message. |
ReadingBusesApiExceptionCritical | Thrown if the API fails, but provides no reason. |
See GpsController.GetLiveVehiclePositions() to get live data instead.
◆ GetLiveVehiclePosition()
async Task< LiveVehiclePosition > ReadingBusesAPI.VehiclePositions.GpsController.GetLiveVehiclePosition |
( |
string |
vehicle | ) |
|
Gets live GPS data for a single buses matching Vehicle ID number.
- Parameters
-
vehicle | Vehicle ID Number eg 414 |
- Returns
- The GPS point of Vehicle matching your ID provided.
- Exceptions
-
ReadingBusesApiExceptionBadQuery | Thrown if a vehicle of the ID does not exist or is not currently active. You can check by using the 'IsVehicle' function. |
◆ GetLiveVehiclePositions()
async Task< LiveVehiclePosition[]> ReadingBusesAPI.VehiclePositions.GpsController.GetLiveVehiclePositions |
( |
| ) |
|
Gets live GPS data for all buses currently operating.
- Returns
- An array of GPS locations for all buses operating by Reading Buses currently
- Exceptions
-
ReadingBusesApiExceptionBadQuery | Thrown if the API key is invalid or expired. |
ReadingBusesApiExceptionCritical | Thrown if the API fails, but provides no reason. |
◆ IsVehicle()
async Task< bool > ReadingBusesAPI.VehiclePositions.GpsController.IsVehicle |
( |
string |
vehicle | ) |
|
Checks if the Vehicle ID Number is currently in service right now.
- Parameters
-
vehicle | Vehicle ID Number eg 414 |
- Returns
- True or False for if the buses GPS can be found or not currently.
The documentation for this class was generated from the following file: