Upload Traffic Files
Interacting with the API
It is possible to upload a traffic file by directly interacting with the API. Each row of a traffic file corresponds to a single event that is part of that traffic.
The endpoint below is used for that effect, where the project ID is given by project_id.
POST /p-{project_id}/traffic/upload
Besides the project ID, this endpoint also requires the following path parameter:
| Element | Type | Presence | Unit | Description | Observations |
|---|---|---|---|---|---|
name |
string |
Optional | - | Name commonly used to identify the traffic. It can be set to any string | Any name accepted, but must be unique amongst all traffics of a project |
Expected columns in file
See the Traffics upload specification for the full list of columns. If at least one of the mandatory columns is missing, Echo will return a validation error and will let you know which columns are missing.
When uploading a traffic file without a timestamp column, Echo requires values for temperature (°C), pressure (Pa), and humidity (%). These values can be provided in the upload or taken from the project’s meteorological defaults. For files without time references, Echo looks specifically for a season named "default" and uses that season’s values.
Type of traffic files accepted
Currently, only .csv files are accepted for traffics. Files compressed as .zip are also accepted. In these cases, Echo will fetch the first file in the zipped upload and process it,
ignorning other files that may be inside.
Below is an example of how you can upload a traffic file to your project.
from typing import Union
import requests
from pathlib import Path
def upload_traffic_file(base_url: str, project_id: int, headers: dict, file_path: Union[str, Path]):
# Prepare file
file = {"file": open(file_path, "rb")}
# Traffic name
name = "My Traffic"
# Upload file
traffic_response = requests.post(
f"{base_url}/p-{project_id}/traffic/upload" + f"?name={name}",
files=file,
headers=headers
)
# Extract response after uploading traffic. The response will let you know if the upload was received
traffic = traffic_response.json()
Traffic status
After having uploaded the traffic file, Echo will validate its content and will generate error logs if anything goes wrong. The traffic can only be used after it has been validated and has been accepted by Echo.
Track and profile references
A traffic file references tracks and profiles by name. These references are validated when a calculation is requested — not at upload time. This means you can upload a traffic file before the referenced tracks and profiles exist in the project, and add them later. When you request a calculation, Echo will check that all referenced tracks and profiles exist and that each track and profile pair is compatible (same flight type and aircraft type). If any reference is missing or incompatible, the calculation request will be rejected with a descriptive error.
Using the Website
DOCUMENTATION TO BE ADDED SOON
The documentation for this section has not been completed yet.