Skip to content

How to bring your own data in the traffic library? #311

Answered by xoolive
laynr asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @laynr
Indeed, I am well behind in terms of documentation.

About your issue:

  • rename lat, lon and alt to latitude, longitude, altitude
  • add a column timestamp with a dtype as timestamp (I recommend the timezone-aware version, but things should work in both cases)

Then create a Flight or Traffic (collection of Flight) object directly from the pandas Dataframe:

# for a single trajectory
Flight(df.rename(columns=dict(lat='latitude', etc.)))
# for many trajectories
for flight in Traffic(df.rename(columns=dict(lat='latitude', etc.))):
    print(flight)

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by laynr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants