# Flight path visualizations from ADSB data

**URL:** <https://discussions.flightaware.com/t/flight-path-visualizations-from-adsb-data/17983>\
**Category:** ADS-B Flight Tracking\
**Created:** [February 2, 2016, 3:43pm UTC](https://discussions.flightaware.com/t/flight-path-visualizations-from-adsb-data/17983 "2016-02-02T15:43:10Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![BartJr](https://sea1.discourse-cdn.com/flex019/user_avatar/discussions.flightaware.com/bartjr/32/33888_2.png) [@BartJr](https://discussions.flightaware.com/u/BartJr)\
**Post date:** [February 2, 2016, 3:43pm UTC](https://discussions.flightaware.com/t/flight-path-visualizations-from-adsb-data/17983/1 "2016-02-02T15:43:10Z")

</div>

Anyone make any interesting visualizations or graphics from their receiver data?

I logged a day’s worth of flights for my local airport KAUS (only from aircraft that broadcast positions–no MLAT) and plotted them in Google Earth:

![](https://us1.discourse-cdn.com/flex019/uploads/flightaware/original/3X/1/f/1f5f80bf7468606d63e1643674ba322a1b05dfd1.jpeg)  
[(click for larger version)](http://i.imgur.com/jffh7Dh.jpg)

Google Earth can also animate GPS tracks, so I wrote the flight data in that kml track format, and for fun I timeshifted them so they all arrive and depart at the same time to make this animation: _([http://i.imgur.com/U5GKJ77.gifv](http://i.imgur.com/U5GKJ77.gifv))_

---

<div class="post-metadata">

**Author:** ![lignumaqua](https://sea1.discourse-cdn.com/flex019/user_avatar/discussions.flightaware.com/lignumaqua/32/97822_2.png) [@lignumaqua](https://discussions.flightaware.com/u/lignumaqua)\
**Post date:** [February 2, 2016, 4:47pm UTC](https://discussions.flightaware.com/t/flight-path-visualizations-from-adsb-data/17983/2 "2016-02-02T16:47:46Z")

</div>

Very nice! 🙂 Looks like you are only a mile or so away from me.

---

<div class="post-metadata">

**Author:** ![TomMuc](https://sea1.discourse-cdn.com/flex019/user_avatar/discussions.flightaware.com/tommuc/32/113358_2.png) [@TomMuc](https://discussions.flightaware.com/u/TomMuc)\
**Post date:** [February 2, 2016, 4:58pm UTC](https://discussions.flightaware.com/t/flight-path-visualizations-from-adsb-data/17983/3 "2016-02-02T16:58:46Z")

</div>

the still picture looks like fallen reed at the edge of a lake - and the animation looks supercool 🙂 almost arts!

---

<div class="post-metadata">

**Author:** ![LitterBug](https://sea1.discourse-cdn.com/flex019/user_avatar/discussions.flightaware.com/litterbug/32/36812_2.png) [@LitterBug](https://discussions.flightaware.com/u/LitterBug)\
**Post date:** [February 2, 2016, 6:51pm UTC](https://discussions.flightaware.com/t/flight-path-visualizations-from-adsb-data/17983/4 "2016-02-02T18:51:56Z")

</div>

SWEET! what kind of DB and scripting did you use to generate the KML file?

Cheers!  
LitterBug

---

<div class="post-metadata">

**Author:** ![BartJr](https://sea1.discourse-cdn.com/flex019/user_avatar/discussions.flightaware.com/bartjr/32/33888_2.png) [@BartJr](https://discussions.flightaware.com/u/BartJr)\
**Post date:** [February 2, 2016, 10:12pm UTC](https://discussions.flightaware.com/t/flight-path-visualizations-from-adsb-data/17983/5 "2016-02-02T22:12:12Z")

</div>

Thanks, it is a small python script which reads a log of port 30003 messages. I should clean it up and put it on github.

The Google Earth KML is basically series of lon/lat/altitide datapoints (and times if you want gps track animation), so it’s pretty straightforward to create from the ads-b messages if you group the data by plane.

> [@lignumaqua](#):
>
> Looks like you are only a mile or so away from me

Hi neighbor! You are certainly the one to beat on my stats page of nearby sites 🙂

---

<div class="post-metadata">

**Author:** ![f1jek](https://sea1.discourse-cdn.com/flex019/user_avatar/discussions.flightaware.com/f1jek/32/116344_2.png) [@f1jek](https://discussions.flightaware.com/u/f1jek)\
**Post date:** [February 3, 2016, 12:54pm UTC](https://discussions.flightaware.com/t/flight-path-visualizations-from-adsb-data/17983/6 "2016-02-03T12:54:25Z")

</div>

Flag ! 😮

---

<div class="post-metadata">

**Author:** ![jvcdcarlos](https://avatars.discourse-cdn.com/v4/letter/j/3be4f8/32.png) [@jvcdcarlos](https://discussions.flightaware.com/u/jvcdcarlos)\
**Post date:** [February 4, 2016, 6:03pm UTC](https://discussions.flightaware.com/t/flight-path-visualizations-from-adsb-data/17983/7 "2016-02-04T18:03:01Z")

</div>

how can i do that???

[quote=“BartJr”]  
Anyone make any interesting visualizations or graphics from their receiver data?

I logged a day’s worth of flights for my local airport KAUS (only from aircraft that broadcast positions–no MLAT) and plotted them in Google Earth:

![](https://us1.discourse-cdn.com/flex019/uploads/flightaware/original/3X/1/f/1f5f80bf7468606d63e1643674ba322a1b05dfd1.jpeg)  
[(click for larger version)](http://i.imgur.com/jffh7Dh.jpg)

Google Earth can also animate GPS tracks, so I wrote the flight data in that kml track format, and for fun I timeshifted them so they all arrive and depart at the same time to make this animation: \*([A day's worth of flights at AUS](http://i.imgur.com/U5GKJ77.gifv))  
\*[/quote]

---

<div class="post-metadata">

**Author:** ![idh](https://sea1.discourse-cdn.com/flex019/user_avatar/discussions.flightaware.com/idh/32/113363_2.png) [@idh](https://discussions.flightaware.com/u/idh)\
**Post date:** [February 17, 2016, 11:03pm UTC](https://discussions.flightaware.com/t/flight-path-visualizations-from-adsb-data/17983/8 "2016-02-17T23:03:21Z")

</div>

> Thanks, it is a small python script which reads a log of port 30003 messages. I should clean it up and put it on github.

Please!

---

<div class="post-metadata">

**Author:** ![HEV150](https://avatars.discourse-cdn.com/v4/letter/h/898d66/32.png) [@HEV150](https://discussions.flightaware.com/u/HEV150)\
**Post date:** [April 7, 2016, 6:10pm UTC](https://discussions.flightaware.com/t/flight-path-visualizations-from-adsb-data/17983/9 "2016-04-07T18:10:11Z")

</div>

> [@idh](#):
>
> > Thanks, it is a small python script which reads a log of port 30003 messages. I should clean it up and put it on github.
> 
> Please!

+1,  
I’m highly interested in that script too

---

<div class="post-metadata">

**Author:** ![dbaker](https://sea1.discourse-cdn.com/flex019/user_avatar/discussions.flightaware.com/dbaker/32/97166_2.png) [@dbaker](https://discussions.flightaware.com/u/dbaker)\
**Post date:** [April 7, 2016, 9:48pm UTC](https://discussions.flightaware.com/t/flight-path-visualizations-from-adsb-data/17983/10 "2016-04-07T21:48:02Z")

</div>

Awesome!

---

<div class="post-metadata">

**Author:** ![pgenneken](https://sea1.discourse-cdn.com/flex019/user_avatar/discussions.flightaware.com/pgenneken/32/38491_2.png) [@pgenneken](https://discussions.flightaware.com/u/pgenneken)\
**Post date:** [April 7, 2016, 10:51pm UTC](https://discussions.flightaware.com/t/flight-path-visualizations-from-adsb-data/17983/11 "2016-04-07T22:51:14Z")

</div>

Great Idea!.. Love it.

---

<div class="post-metadata">

**Author:** ![JonHanford](https://sea1.discourse-cdn.com/flex019/user_avatar/discussions.flightaware.com/jonhanford/32/17237_2.png) [@JonHanford](https://discussions.flightaware.com/u/JonHanford)\
**Post date:** [April 8, 2016, 3:31am UTC](https://discussions.flightaware.com/t/flight-path-visualizations-from-adsb-data/17983/12 "2016-04-08T03:31:03Z")

</div>

+1 on sharing the code 😃

---

<div class="post-metadata">

**Author:** ![BartJr](https://sea1.discourse-cdn.com/flex019/user_avatar/discussions.flightaware.com/bartjr/32/33888_2.png) [@BartJr](https://discussions.flightaware.com/u/BartJr)\
**Post date:** [April 30, 2016, 10:59pm UTC](https://discussions.flightaware.com/t/flight-path-visualizations-from-adsb-data/17983/13 "2016-04-30T22:59:28Z")

</div>

Comparing MLAT (blue) vs ADSB (red) positions logged over 8 hours today. 1 dot = 1 position. Black circle = me.

I thought it was interesting that to the north and west, where I am blocked by hills, MLAT reception looks better than ADSB. I guess that makes sense, it should be harder to receive complete position messages than other shorter Mode-S messages used for mlat.

ADSB is clearly dominant east of Houston–probably beyond my mlat sync region.

**[(click for larger image)](http://i.imgur.com/Lhbc6JM.png)**

 ![](https://us1.discourse-cdn.com/flex019/uploads/flightaware/original/3X/2/4/248ad8c3333339d6f5985c1ccd26795c72dc9696.jpeg)

> [@JonHanford](#):
>
> +1 on sharing the code 😃

I lost that script and have to rewrite it. The lesson is don’t store important things in /tmp 😒

---

<div class="post-metadata">

**Author:** ![dbaker](https://sea1.discourse-cdn.com/flex019/user_avatar/discussions.flightaware.com/dbaker/32/97166_2.png) [@dbaker](https://discussions.flightaware.com/u/dbaker)\
**Post date:** [April 30, 2016, 11:10pm UTC](https://discussions.flightaware.com/t/flight-path-visualizations-from-adsb-data/17983/14 "2016-04-30T23:10:05Z")

</div>

> [@BartJr](#):
>
> ADSB is clearly dominant east of Houston–probably beyond my mlat sync region.

That area is also lots of longhaul aircraft to/from South America as well as Gulf of Mexico operations that have ADS-B.

---

<div class="post-metadata">

**Author:** ![dpmcgee](https://avatars.discourse-cdn.com/v4/letter/d/4da419/32.png) [@dpmcgee](https://discussions.flightaware.com/u/dpmcgee)\
**Post date:** [May 1, 2016, 4:19pm UTC](https://discussions.flightaware.com/t/flight-path-visualizations-from-adsb-data/17983/15 "2016-05-01T16:19:23Z")

</div>

> [@BartJr](#):
>
> Comparing MLAT (blue) vs ADSB (red) positions logged over 8 hours today. 1 dot = 1 position. Black circle = me.
> 
> I thought it was interesting that to the north and west, where I am blocked by hills, MLAT reception looks better than ADSB. I guess that makes sense, it should be harder to receive complete position messages than other shorter Mode-S messages used for mlat.
> 
> ADSB is clearly dominant east of Houston–probably beyond my mlat sync region.
> 
> > [@JonHanford](#):
> >
> > +1 on sharing the code 😃
> 
> I lost that script and have to rewrite it. The lesson is don’t store important things in /tmp 😒

How about sharing the script you used for this map? I’d love to do a similar thing with the position log I kept for the last 24 hours.

---

<div class="post-metadata">

**Author:** ![BartJr](https://sea1.discourse-cdn.com/flex019/user_avatar/discussions.flightaware.com/bartjr/32/33888_2.png) [@BartJr](https://discussions.flightaware.com/u/BartJr)\
**Post date:** [May 1, 2016, 5:57pm UTC](https://discussions.flightaware.com/t/flight-path-visualizations-from-adsb-data/17983/16 "2016-05-01T17:57:50Z")

</div>

It’s basically just a scatterplot. I logged positions from the BaseStation-format output of dump1090 and mlat-client, but you could get data from aircraft.json as well. Here’s how I did it:

```auto

#add basestation output to mlat-client
sudo piaware-config -mlatResultsFormat "beast,connect,localhost:30104 basestation,listen,30303"
sudo service piaware restart
#start logging
nc -d localhost 30303 | cut -d , -f 15,16 > MLAT.latlon&
nc -d localhost 30003 | egrep 'MSG,[23]' | cut -d , -f 15,16 > ADSB.latlon&

```

Then make a plot with your favorite program. I used gnuplot and mercator projection:

```auto

gnuplot> set datafile separator comma
gnuplot> set angle degrees
gnuplot> mercator(lat) = log(tan(45 + lat/2))*180/pi
gnuplot> plot 'ADSB.latlon' u 2:(mercator($1)) w dots lc 'red', 'MLAT.latlon' u 2:(mercator($1)) w dots lc 'blue', 'texas.csv' u 1:(mercator($2)) w lines lw 2

```

The state outline coordinates are in texas.csv, which I made by grabbing lat/lon data out of [this svg](http://www.mccurley.org/svg/data/states.svg).

Since there are a lot of overlapping points, a heatmap would probably be more interesting than just a scatter. I will have to try that in matplotlib or something.

edit: Actually my gnuplot script was a little more complicated… Because so many points overlap, if you draw MLAT second the dots are drawn on top of many ADSB dots so it will look like you have more MLAT than reality (or vice versa). To work around this I added a third column of 0 or 1, combined the two into one file, and randomized the line order. This way MLAT and ADSB dots are drawn randomly so it looks better when there is a tight grouping.

```auto

% cat logADSB | awk 'BEGIN{OFS=",";FS=","}{print $16,$15,0}' > foo2
% cat logMLAT | awk 'BEGIN{OFS=",";FS=","}{print $16,$15,1}' > foo1
% cat foo1 foo2 | shuf > combined
gnuplot> set cbrange [0:1]
gnuplot> set palette defined (0 'red', 1 'blue')
gnuplot> plot 'combined' u 1:(mercator($2)):3 w dots palette

```

---

<div class="post-metadata">

**Author:** ![ExCalbr](https://sea1.discourse-cdn.com/flex019/user_avatar/discussions.flightaware.com/excalbr/32/115490_2.png) [@ExCalbr](https://discussions.flightaware.com/u/ExCalbr)\
**Post date:** [May 1, 2016, 8:20pm UTC](https://discussions.flightaware.com/t/flight-path-visualizations-from-adsb-data/17983/17 "2016-05-01T20:20:55Z")

</div>

> [@BartJr](#):
>
> Comparing MLAT (blue) vs ADSB (red) positions logged over 8 hours today. 1 dot = 1 position. Black circle = me.
> 
> I thought it was interesting that to the north and west, where I am blocked by hills, MLAT reception looks better than ADSB. I guess that makes sense, it should be harder to receive complete position messages than other shorter Mode-S messages used for mlat.
> 
> ADSB is clearly dominant east of Houston–probably beyond my mlat sync region.
> 
> **[(click for larger image)](http://i.imgur.com/Lhbc6JM.png)**  
> [http://i.imgur.com/Lhbc6JMl.png](http://i.imgur.com/Lhbc6JMl.png)
> 
> > [@JonHanford](#):
> >
> > +1 on sharing the code 😃
> 
> I lost that script and have to rewrite it. The lesson is don’t store important things in /tmp 😒

What kind of antenna are you using? You seem to be getting a lot more range than I am (I’m at about 730 ft elevation near Northcross Mall).

---

<div class="post-metadata">

**Author:** ![dpmcgee](https://avatars.discourse-cdn.com/v4/letter/d/4da419/32.png) [@dpmcgee](https://discussions.flightaware.com/u/dpmcgee)\
**Post date:** [May 1, 2016, 8:44pm UTC](https://discussions.flightaware.com/t/flight-path-visualizations-from-adsb-data/17983/18 "2016-05-01T20:44:09Z")

</div>

Ahh, awesome. Wasn’t sure if you were using gnuplot, matplotlib, or something else.

Since this was so intriguing, I decided to pursue a matplotlib solution today and write a script. Here it is, super-hardcoded at the moment, but it works! I would definitely recommend running this not on your Pi as it has to crunch for a while. I also fed it upwards of 1.3 million positions logged over the last 20 hours. I can clean this up and get it on github at some point.

```auto

from mpl_toolkits.basemap import Basemap
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt

def main():
    lats = ]
    lons = ]
    alts = ]

    print('processing data...')
    with open('testdata.csv', 'r') as data:
        for line in data:
            pieces = line.split(',')
            if pieces[1] == '3':
                lats.append(float(pieces[14]))
                lons.append(float(pieces[15]))
                alts.append(int(pieces[11]))

    print('drawing map...')
    plt.figure(figsize=(80, 60))
    my_map = Basemap(llcrnrlon=min(lons), llcrnrlat=min(lats),
                     urcrnrlon=max(lons), urcrnrlat=max(lats),
                     resolution='h')
    #my_map.drawmapboundary()
    my_map.drawcoastlines()
    my_map.drawstates()
    my_map.drawrivers()
    my_map.fillcontinents(color='0.975', zorder=0)

    print('plotting points...')
    x, y = my_map(lons, lats)
    my_map.scatter(x, y, s=1.0, c=alts, marker='o', lw=0, cmap='plasma')
    plt.savefig('/tmp/my_map.png', bbox_inches='tight', pad_inches=0)

if __name__ == ' __main__':
    main()

```

Here is the result. Colors are based on altitude of the recorded position. You should be able to make your own if you provide it a file with BaseStation format data captured off port 30003 or similar.

[Large Image](http://i.imgur.com/gLvIYpM.jpg)  
 ![](https://us1.discourse-cdn.com/flex019/uploads/flightaware/original/3X/9/6/9697247c61ef62230144fb28367013d5d6bf7136.jpeg)

---

<div class="post-metadata">

**Author:** ![BartJr](https://sea1.discourse-cdn.com/flex019/user_avatar/discussions.flightaware.com/bartjr/32/33888_2.png) [@BartJr](https://discussions.flightaware.com/u/BartJr)\
**Post date:** [May 2, 2016, 2:45am UTC](https://discussions.flightaware.com/t/flight-path-visualizations-from-adsb-data/17983/19 "2016-05-02T02:45:20Z")

</div>

Nice! The streaking or starburst pattern of your reception is very interesting. Do you know the cause of that?

I actually haven’t used matplotlib before so I will work off your example 😃

> [@ExCalbr](#):
>
> What kind of antenna are you using? You seem to be getting a lot more range than I am (I’m at about 730 ft elevation near Northcross Mall).

I have two setups in the attic at the moment: a Moonraker 6.5dBd collinear (should be comparable to the FlightAware antenna) and a 900MHz cellular Yagi (which actually works pretty well at 1090) pointed at Houston. The graphic above is from the Yagi. Of course it helps that I am at 100ft higher elevation and I have a clear view to the east.

---

<div class="post-metadata">

**Author:** ![ExCalbr](https://sea1.discourse-cdn.com/flex019/user_avatar/discussions.flightaware.com/excalbr/32/115490_2.png) [@ExCalbr](https://discussions.flightaware.com/u/ExCalbr)\
**Post date:** [May 2, 2016, 2:59am UTC](https://discussions.flightaware.com/t/flight-path-visualizations-from-adsb-data/17983/20 "2016-05-02T02:59:08Z")

</div>

> [@BartJr](#):
>
> Nice! The streaking or starburst pattern of your reception is very interesting. Do you know the cause of that?
> 
> I actually haven’t used matplotlib before so I will work off your example 😃
> 
> > [@ExCalbr](#):
> >
> > What kind of antenna are you using? You seem to be getting a lot more range than I am (I’m at about 730 ft elevation near Northcross Mall).
> 
> I have two setups in the attic at the moment: a Moonraker 6.5dBd collinear (should be comparable to the FlightAware antenna) and a 900MHz cellular Yagi (which actually works pretty well at 1090) pointed at Houston. The graphic above is from the Yagi. Of course it helps that I am at 100ft higher elevation and I have a clear view to the east.

Thanks. I just moved my rig up higher in the attic. I actually had it inside a 2nd floor room for the last year or two (or however long I’ve been running it). Since I got the new pro receiver, I decided to move it to the attic. Yesterday I moved it to where I could reach, which wasn’t much higher than inside. Today, after moving ladders, installing a hook, routing an extension coord, etc., I mounted it at the peak of my attic, which is about 28 feet above ground. I figure the antenna is a foot or two lower than this.

I have a weather station with anemometer on a mast outside that’s at 40’ above ground. I’ll be moving my receiver up there after I figure out how to weatherproof it. Also, I didn’t really want to route A/C current up the mast, so I may figure out an alternative for that, too.

Anyway, after I moved the device to the peak of the attic, I started getting some flights recorded over 200 miles away. I’ll have to watch for a while to see where the farthest signals are coming from. Used to be Abilene, but now I’m starting to see activity in the gulf, Dallas, Houston, Laredo, and Del Rio. I’ll be curious to see what it looks like after a few days. Looks like I’m barely seeing into Mexico. 🙂

[Next page](https://discussions.flightaware.com/t/flight-path-visualizations-from-adsb-data/17983.md?page=2)
