... | ... | @@ -21,8 +21,7 @@ This use case has a behavior similar to that offered by Bandeja de Salida that c |
|
|
|
|
|
> {baseUrl}/v1/events
|
|
|
|
|
|
En el endpoint se publican las velocidades recomendadas en formato JSON. Aquí se puede ver un ejemplo:
|
|
|
|
|
|
Recommended speeds are published on the endpoint in JSON format. Here an example is shown:
|
|
|
```json
|
|
|
[
|
|
|
{
|
... | ... | @@ -106,25 +105,25 @@ En el endpoint se publican las velocidades recomendadas en formato JSON. Aquí s |
|
|
]
|
|
|
```
|
|
|
|
|
|
A continuación, se presenta una descripción de cada uno de los campos del JSON anterior. Dicho JSON, publica la información de una congestión concreta así como las velocidades recomendadas en diferentes puntos:
|
|
|
Below is a description of each of the fields in the above JSON. This JSON publishes the information on a specific congestion as well as the recommended speeds at different points:
|
|
|
|
|
|
En el documento se publica una lista de carreteras afectadas en las que existe un atasco, cada una de ellas esta formada por un campo **_properties_** y **_recommendedSpeeds_**. Es decir, cada conjunto de estos dos campos referencia a una carretera diferente con recomendaciones de velocidad diferentes.
|
|
|
The document publishes a list of affected roads where there is a traffic jam, each of which is made up of a field **_properties_** and **_recommendedSpeeds_**. That is, each set of these two fields refers to a different road with different speed recommendations.
|
|
|
|
|
|
- **Properties:** Contiene información relativa a la zona afectada.
|
|
|
- **Lat:** Latitud donde comienza el atasco.
|
|
|
- **Lon:** Longitud donde comienza el atasco.
|
|
|
- **Timestamp(Fecha UTC)**: Fecha y hora en formato UTC del momento en el que se ha actualizado la información. Puede no coinicidir con la fecha y hora actuales.
|
|
|
- **Properties:** It contains information relative to the affected area.
|
|
|
- **Lat:** Latitude where the jam starts.
|
|
|
- **Lon:** Longitude where the jam starts.
|
|
|
- **Timestamp(UTC Date)**: Date and time in UTC format of the moment in which the information was updated. It may not match the current date and time.
|
|
|
- **Vialidad.**
|
|
|
- **RoadDescription:** Nombre de la carretera o carreteras que se ven afectadas.
|
|
|
- **Direction:** La dirección de la carretera sobre la que se aplica el algoritmo. Puede tener valores 1 (Ascendente) o 0 (Descendente).
|
|
|
- **AffectedLength:** Longitud, en metros, del tramo en el que actualmente hay una retención. Cuanto mayor sea esta distancia mayor será la distancia entre velocidades recomendadas.
|
|
|
- **RoadMaxSpeed:** Velocidad máxima de la vía, en Km/h.
|
|
|
- **RecommendedSpeeds:** Contiene las velocidades recomendadas en los distintos tramos.
|
|
|
- **Speed:** Velocidad recomendada.
|
|
|
- **kmStart:** Punto de inicio de la zona de recomendación. Representa la distancia desde el punto de origen en la que comienza la zona de velocidad recomendada.
|
|
|
- **kmEnd:** Punto de finalización de la zona de recomendación. Representa la distancia desde el punto de origen en la que finaliza la zona de velocidad recomendada.
|
|
|
- **RoadDescription:** Name of the road or roads that are affected.
|
|
|
- **Direction:** The direction of the road on which the algorithm is applied. It can have values 1 (Ascending) or 0 (Descending).
|
|
|
- **AffectedLength:** Length, in meters, of the section in which there is currently a retention. The greater this distance, the greater the distance between recommended speeds.
|
|
|
- **RoadMaxSpeed:** Maximum speed of the track, in Km/h.
|
|
|
- **RecommendedSpeeds:** It contains the recommended speeds in the different sections.
|
|
|
- **Speed:** Recommended speed.
|
|
|
- **kmStart:** Starting point of the recommendation zone. Represents the distance from the point of origin at which the advisory speed zone begins.
|
|
|
- **kmEnd:** End point of the recommendation zone. Represents the distance from the point of origin at which the advisory speed zone ends.
|
|
|
|
|
|
Teniendo en consideración los campos anteriores a continuación se muestra un JSON de ejemplo junto con la interpretación del mismo:
|
|
|
Taking into consideration the previous fields, an example JSON is shown below along with its interpretation:
|
|
|
|
|
|
|
|
|
```json
|
... | ... | @@ -142,11 +141,11 @@ Teniendo en consideración los campos anteriores a continuación se muestra un J |
|
|
]
|
|
|
```
|
|
|
|
|
|
Desde el punto en el que se origina el atasco, recordemos que viene dado por los campos _lat_ y _lng_, (supongamos que en la carretera coincide que es el punto kilométrico 200) hasta el punto kilométrico 212.4, los coches deben circular a una velocidad de 40 Km/h. Desde el punto kilométrico 212.4 hasta el 227.28 los coches deben circular a 50 Km/h. Y así sucesivamente hasta llegar a los 90 Km/h, que en este ejemplo es la velocidad máxima de la vía.
|
|
|
From the point where the traffic jam originates, let us remember that it is given by the fields _lat_ and _lng_, (let us suppose that the road coincides with kilometer point 200) up to kilometer point 212.4, the cars must circulate at a speed of 40km/h. From kilometer point 212.4 to 227.28, cars must travel at 50 km/h. And so on until reaching 90 km/h, which in this example is the maximum speed of the road.
|
|
|
|
|
|
## Errores
|
|
|
## Errors
|
|
|
|
|
|
Todas las respuestas HTTP que no sean **200 – OK**, se pueden considerar **inválidas**. Independientemente del mensaje de error, el formato de la respuesta es como el siguiente ejemplo:
|
|
|
All HTTP responses other than **200 – OK**, can be considered **invalid**. Regardless of the error message, the response format is like the following example:
|
|
|
|
|
|
```json
|
|
|
{
|
... | ... | @@ -156,9 +155,9 @@ Todas las respuestas HTTP que no sean **200 – OK**, se pueden considerar **inv |
|
|
}
|
|
|
```
|
|
|
|
|
|
La información relativa a los errores en este caso de uso se puede encontrar aquí. Estos errores tendrán tres categorías principales:
|
|
|
Information regarding errors in this use case can be found here. These errors will have three main categories:
|
|
|
|
|
|
#### Error de Autentificación
|
|
|
#### Authentication Errors
|
|
|
|
|
|
- HTTP Status: **401 - Unauthorized**
|
|
|
| Code | Message |
|
... | ... | @@ -166,7 +165,7 @@ La información relativa a los errores en este caso de uso se puede encontrar aq |
|
|
| 1 | User not found or valid |
|
|
|
|
|
|
|
|
|
#### Error de Cliente
|
|
|
#### Client Errors
|
|
|
|
|
|
- HTTP Status: **400 - Bad Request**
|
|
|
| Code | Message |
|
... | ... | @@ -183,7 +182,7 @@ La información relativa a los errores en este caso de uso se puede encontrar aq |
|
|
| 10 | There is an error in one or more elements |
|
|
|
|
|
|
|
|
|
A continuación se muestra una respuesta de _error 5 - Expired token received_ la cual tendrá el siguiente formato:
|
|
|
Below is a response of _error 5 - Expired token received_ which will have the following format:
|
|
|
|
|
|
```json
|
|
|
{
|
... | ... | @@ -194,7 +193,7 @@ A continuación se muestra una respuesta de _error 5 - Expired token received_ l |
|
|
|
|
|
```
|
|
|
|
|
|
#### Error de Servidor
|
|
|
#### Server Errors
|
|
|
|
|
|
- HTTP Status: **500 - Internal Server Error**
|
|
|
| Code | Message |
|
... | ... | |