Skip to content

Instantly share code, notes, and snippets.

@espinielli
Created March 23, 2015 17:48
Show Gist options
  • Save espinielli/428c050e0cd0c1b77aeb to your computer and use it in GitHub Desktop.
Save espinielli/428c050e0cd0c1b77aeb to your computer and use it in GitHub Desktop.
Funny ADS-B positions: zig-zag

Take flight ASL334 on 16th Feb 2015 (and sort the position reports by timestamp)

echo "lat,lon,clock,type" > data.csv
cat adsb.json | \
jq -r 'select(.ident=="ASL334" and .clock >= "1424041200" and .clock < "1424127600")|[.lat,.lon,.clock,.updateType]|join(",")' | \
sort --key=3n -t, >> data.csv

click on the markers to get tracks details: spot the zig-zag at around track 60!

lat lon clock type
46.75937 17.94932 1424105704 A
46.79640 17.89579 1424105734 A
46.89021 17.75989 1424105794 A
46.77708 17.92373 1424105813 A
46.98266 17.62700 1424105854 A
47.03064 17.55663 1424105884 A
47.07316 17.49425 1424105914 A
47.10841 17.44320 1424105937 A
47.16454 17.36164 1424105974 A
47.20990 17.29605 1424106004 A
47.21295 17.29142 1424106021 A
47.29973 17.16367 1424106064 A
47.32463 17.12691 1424106080 A
47.38669 17.03508 1424106122 A
47.42919 16.97205 1424106154 A
47.47332 16.90683 1424106184 A
47.52493 16.81924 1424106216 A
47.55725 16.74667 1424106243 A
47.56885 16.70901 1424106267 A
47.59044 16.62939 1424106284 A
47.61108 16.55509 1424106312 A
47.68694 16.27522 1424106406 A
47.71184 16.18389 1424106436 A
47.73550 16.09531 1424106467 A
47.75940 16.00605 1424106497 A
47.77330 15.95377 1424106542 A
47.81726 15.78790 1424106585 A
47.84505 15.68394 1424106615 A
47.85878 15.63197 1424106638 A
47.89723 15.48593 1424106675 A
47.92418 15.38276 1424106710 A
47.94271 15.31163 1424106735 A
47.96100 15.24100 1424106758 A
47.98013 15.16731 1424106796 A
48.00400 15.07700 1424106814 A
48.02049 15.01176 1424106836 A
48.03424 14.95795 1424106856 A
48.05736 14.86759 1424106886 A
48.07901 14.78217 1424106916 A
48.08455 14.76130 1424106946 A
48.11200 14.65300 1424106961 A
48.13500 14.56000 1424106992 A
48.15800 14.47100 1424107022 A
48.18400 14.36700 1424107058 A
48.19972 14.30630 1424107079 A
48.21208 14.25751 1424107096 A
48.22835 14.19210 1424107119 A
48.25447 14.08659 1424107156 A
48.27127 14.01848 1424107178 A
48.28100 13.98100 1424107197 A
48.29512 13.92193 1424107213 A
48.31000 13.86300 1424107232 A
48.32211 13.81285 1424107251 A
48.33400 13.76600 1424107269 A
48.35700 13.67300 1424107298 A
48.38100 13.57200 1424107333 A
48.40500 13.47400 1424107370 A
48.44092 13.32522 1424107418 A
48.46046 13.25233 1424107442 A
48.45964 13.25536 1424107459 A
48.51600 13.04600 1424107513 A
48.53010 12.99329 1424107534 A
48.51810 13.03852 1424107549 A
48.58000 12.82400 1424107590 A
48.59988 12.76315 1424107612 A
48.61702 12.70865 1424107631 A
48.51810 13.03852 1424107649 A
48.66236 12.56352 1424107681 A
48.69066 12.47230 1424107713 A
48.71000 12.40700 1424107735 A
48.73940 12.31098 1424107767 A
48.75486 12.26118 1424107784 A
48.75933 12.24607 1424107801 A
48.78754 12.15433 1424107819 A
48.81477 12.06426 1424107850 A
48.83354 12.00186 1424107870 A
48.85789 11.92066 1424107897 A
48.87502 11.86361 1424107915 A
48.90816 11.75403 1424107951 A
48.91588 11.72827 1424107966 A
48.95261 11.60459 1424107999 A
48.96877 11.54994 1424108017 A
48.99507 11.46091 1424108045 A
49.02435 11.36145 1424108077 A
49.06098 11.23641 1424108118 A
49.08810 11.14295 1424108148 A
49.11592 11.04697 1424108179 A
49.14627 10.94202 1424108212 A
49.16377 10.88615 1424108230 A
49.20332 10.78576 1424108266 A
49.22615 10.73783 1424108284 A
49.30838 10.58596 1424108347 A
49.35026 10.49549 1424108385 A
49.39034 10.41135 1424108421 A
49.42949 10.32930 1424108458 A
49.48256 10.21803 1424108511 A
49.52586 10.12576 1424108557 A
49.54459 10.08646 1424108572 A
49.57627 10.01909 1424108610 A
49.58591 9.99808 1424108651 A
49.65166 9.85734 1424108686 A
49.84492 9.61215 1424108847 A
49.89729 9.52616 1424108896 A
49.96838 9.41319 1424108968 A
49.99687 9.36770 1424108999 A
50.02038 9.32977 1424109024 A
50.05697 9.27016 1424109065 A
50.10892 9.18442 1424109125 A
50.11972 9.16408 1424109140 A
50.12927 9.11442 1424109165 A
50.13443 9.07760 1424109185 A
50.12801 8.97457 1424109245 A
50.12093 8.94465 1424109265 A
50.11614 8.92379 1424109280 A
50.11153 8.90494 1424109295 A
50.10706 8.88571 1424109310 A
50.10278 8.86767 1424109325 A
50.09848 8.84970 1424109340 A
50.09384 8.82989 1424109355 A
50.08816 8.80643 1424109375 A
50.08425 8.78943 1424109390 A
50.07959 8.77036 1424109405 A
50.07564 8.75336 1424109420 A
50.07135 8.73554 1424109435 A
50.06721 8.71852 1424109450 A
50.06346 8.70276 1424109465 A
50.05984 8.68802 1424109480 A
50.05641 8.67334 1424109495 A
50.05385 8.66324 1424109510 A
50.05023 8.64855 1424109530 A
50.04272 8.61175 1424109782 A
50.04358 8.61637 1424109834 A
<!DOCTYPE html>
<html>
<head>
<title></title>
<script src="http://maps.google.com/maps/api/js?sensor=true"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/gmaps.js/0.4.12/gmaps.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/queue-async/1.0.7/queue.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min.js"></script>
<style type="text/css">
#map {
width: 1200px;
height: 650px;
}
</style>
</head>
<body>
<div id="map"></div>
<script>
var dsv = d3.dsv(",", "text/plain");
var map = new GMaps({
el: '#map',
lat: 48.58725866596105,
lng: 12.808116082763735,
zoom: 12
});
queue()
.defer(dsv, "data.csv")
.await(ready);
// this gets executed once the files have been asynchronously read
function ready(error, tracks) {
var path = [];
tracks.forEach(function(d) {
path.push([d.lat,d.lon]);
});
map.drawPolyline({
path: path,
strokeColor: '#131540',
strokeOpacity: 0.6,
strokeWeight: 6
});
for (var i = 0; i < path.length; i++) {
map.addMarker({
lat: path[i][0],
lng: path[i][1],
infoWindow: {
content: '<p>track[' + i + '] @ ' + tracks[i].clock + '<br> type: ' +
(tracks[i].type == 'A' ? 'ADS-B' :
tracks[i].type == 'Z' ? 'Radar' :
tracks[i].type == 'O' ? 'Transoceanic':
tracks[i].type == 'P' ? 'Estimated':
tracks[i].type == 'D' ? 'datalink':
'unknown') +
'.</p>'
}
});
}
}
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment