Plane Tracks Project Overview What are these data anyway? These data show the ge
ID: 3123315 • Letter: P
Question
Plane Tracks Project
Overview
What are these data anyway?
These data show the geographic location, airspeed, heading and altitude of commercial aircraft in range of my house over a couple of days. The data format is shown later in this document.
How did you get these data?
I received these data using a Software Defined Radio (SDR) receiver I put together from ideas I found on the 'Net. Here's one of the links I used:
http://www.rtl-sdr.com/adsb-aircraft-radar-with-rtl-sdr/
And here's a video from a recent DefCon that explains a lot more:
http://www.youtube.com/watch?v=ZuNOD3XWp4A
from about 17 minutes until about 29 minutes, and also from about 40 minutes until 50 minutes, although the whole 90 minute video is interesting as well.
Suggested Classes
Coordinate
Instances of this class hold latitude, longitude and altitude, along with the plane's ID. In addition to getters and setters, it should have a method called map ( ) that converts the latitude, to a Y coordinate, longitude to an X coordinate, and altitude to a number between 0 and 100 that can be used to color code the altitude. (See Processing's HSB colorMode ( )).
Setter and getter methods are explained in your zybook section 2.3. The map method and the Hue Saturation Brightness (HSB) colorMode are described on the Processing web page.
The constructor for Coordinate could take these values as parameters if desired. (Constructors are described in your zybook, section 2.4 and 2.5, and of course on the web).
Here's how mapping transformations work. Consider the following values (they would be member variables in your Observation class).
36000 28.49532 -82.46785
The red value turns out to be about 82.43 degrees West Longitude and the green value turns out to be about 28.5 degrees North Latitude. (The fact that the longitude is preceded by a minus sign means that it is West of Greenwich, England, and the fact that the latitude is positive means that it is North of the equator.) This is not too far from Orlando, as you will see.
The blue value is an altitude of 36000 feet.
Now when you open up a Display window of say, 400 by 500 in Processing, the axes of your coordinate system look like this:
0,0 ------------------------------- … ------------------------ 399 (x)
|
|
…
|
|
499 (y)
Longitude is X, and latitude is Y. So to get the value 28.49532 -82.46785 to “land” inside the Display Window, we need to scale it (multiply) and translate it (add or subtract).
The map ( ) function will do this nicely.
https://processing.org/reference/map_.html
In order to work, map ( ) needs the following information:
An input value. This is the number you want mapped.
An input range, consisting of a minimum input value and a maximum input value. In the case of mapping latitudes to y display coordinates these limits will be the minLatitude, and the maxLatitude set in the program.
An output range, consisting of the minimum and maximum values you wish the scaled output to take. In the case of latitude these range between 0 and the width of the display window.
There is a bit of a trap in how latitude and longitude are numbered, versus how the Display window is counted. Latitude increases as you move away from the equator (up the screen, along the Y axis) and annoyingly, longitude is measured as negative here in the Western hemisphere, and gets less negative as you more East, towards the right of the window along the X axis. You will need to tinker with the arguments to map ( ) to get this to work. Confusing, but mastering the map ( ) function is important because it is super-useful in graphics.
Observation
Instances of this class hold all the data read from one line in the input file. This includes the latitude, longitude and altitude that will be used to populate Coordinates, along with an aircraft ID and some other information.
A useful approach here would be to have the constructor for Observation take a string as a parameter. Read the string from the input file. Section 10.4 in the zybook shows a good example of this. Then add code in Observation to parse (break up) the string into the individual variables such as latitude and longitude. This is possible because the lines in the file have fields separated by spaces.
AirMap
You only need one instance of this one. You can instantiate it in your PApplet's setup ( ) method. An AirMap contains an ArrayList of Coordinate objects. It needs a constructor, as well as methods to add a Coordinate, and then a method to retrieve Coordinates one by one so that they can be plotted in the PApplet's loop ( ) method.
ArrayLists are explained in Section 7.5 of your zybook.
Approach
Use the Papplet framework you set up when you installed and tested the Processing libraries in an earlier project. That will make it easy to get the display working, and will add some convenient methods, such as map ( ) that you will need.
Overall, the flow of the program is like this:
Code each of the classes you need, from the suggested classes above.
In the Processing idiom, you can do all the steps below in the setup ( ) method.
Instantiate an AirMap.
Instantiate a Scanner passing the name of the file containing the plane data
While end of file has not been reached, see: http://stackoverflow.com/questions/4208502/how-to-determine-when-end-of-file-has-been-reached
read a line from the file via the Scanner, instantiate an Observation to hold it.
Use the methods you built in Observation to retrieve the ID, along with the latitude, longitude and altitude
Instantiate an instance of Coordinate and add the latitude, longitude, etc. to it.
Add the Coordinate instance to the AirMap
Do the required sizing and setting of the background color for the Display window
Set the colorMode ( ) to HSB see: https://processing.org/reference/colorMode_.html
In the loop() method:
Iterate through the AirMap, retrieving the mapped values (X, Y and altitude) from each Coordinate.
Show these as points in the Display window.
Processing also brings in a couple of cool methods you might consider:
https://processing.org/reference/loadStrings_.html
and
https://processing.org/reference/splitTokens_.html
although the pure Java approach outlined in the zybook works fine.
Here's a sample input line, showing the fields of interest to our program:
20160312 113417 ???????? C07877 23675 29.20180 -81.39876 73 1043
In order the fields are:
Field
Value
Notes
Date
20160312
Day the observation was recorded. Format is YYYYMMDD
Time
113417
Time the observation was recorded. Format is HHMMSS
Flight
????????
Flight number assigned by airline. ???????? means not provided.
Aircraft ID
C07877
Hexadecimal number uniquely identifying the aircraft.
Altitude
23675
In feet
Latitude
29.20180
North latitude in degrees
Longitude
-81.39876
West longitude in degrees
????
73
I forget what this is.
Transponder code
1043
Unique identifier for radar returns
The fields we need are colored in green above.
Field
Value
Notes
Date
20160312
Day the observation was recorded. Format is YYYYMMDD
Time
113417
Time the observation was recorded. Format is HHMMSS
Flight
????????
Flight number assigned by airline. ???????? means not provided.
Aircraft ID
C07877
Hexadecimal number uniquely identifying the aircraft.
Altitude
23675
In feet
Latitude
29.20180
North latitude in degrees
Longitude
-81.39876
West longitude in degrees
????
73
I forget what this is.
Transponder code
1043
Unique identifier for radar returns
Explanation / Answer
Solution:
yes,this information is accurate. the websites guven in this project are also extremely helpful.
observations and output is also correct.