CS1010 -- Lab 5: GPS Analyzer

Winter 2005-2006
Outcomes Addressed
Overview

In completing this assignment, you will develop a software application to analyze Global Positioning System (GPS) data.

First Week Assignment

You will design and implement a class that will represent one data point (one line) from a GPS data file. In addition, you will write a main program that will read a GPS data file (in the format specified below) and display the following information:

GPS Data File

There are three GPS data files available to you: smallgps.zip, gps.zip, and biggps.zip. Each file contains GPS data from multiple trips. Each trip represents one trip in my car. Typically these trips are either from my home to MSOE or back. The first few lines of the gps.zip file (unzipped) are:

Start time: 2004-03-05 11:09:23
record,fix,hour,min,sec,msec,latitude,longitude,alt
1,3,11,9,24,710,43.0835367,-88.0390017,702.09
2,3,11,9,26,310,43.0835367,-88.0390017,702.09
3,3,11,9,27,310,43.0835367,-88.0390017,702.09
...

The first line indicates the starting time for the first trip. The second line contains labels for the different fields associated with each record. The third line contains the data associated with the first data record. Each record includes (separated by commas) the record number, the number of satellites used to get a fix on the GPS receiver's position, the time the record was made (in hours, minutes, seconds, and milliseconds), the latitude, longitude, and altitude. These records continue until the end of the trip. Data for the second trip follow immediately after the first trip. In this particular example, the first trip has 1336 records. Here are lines 1337-1345 of the data file:

1335,4,11,31,52,750,43.0445550,-87.9081050,639.76
1336,4,11,31,53,750,43.0445550,-87.9081033,639.76
Start time: 2004-03-05 17:10:35
record,fix,hour,min,sec,msec,latitude,longitude,alt
1,3,17,10,36,380,43.0445983,-87.9081033,583.98
2,3,17,10,37,380,43.0445950,-87.9081017,583.98
3,3,17,10,38,380,43.0445917,-87.9081000,583.98
4,3,17,10,39,380,43.0445917,-87.9081033,587.27
5,3,17,10,40,380,43.0445850,-87.9081067,587.27

Note: Your program should work on all three files although it may take a significant amount of time to process the larger files.

Second Week Assignment

You will design and implement a class that will represent one trip from a GPS data file. Your class should make use of an array to store all of the data points for the trip. In addition, you will modify your main program so that it will display the following information:

Notes:

  1. An array size of 6000 should be sufficient for all of the trips in the data files; however, your program should display a warning if a trip is too large to fit in your array.
  2. The distance, in miles, between two points (expressed in lat/long coordinates) can be approximated as:
    Distance = 3963.1 * arccos(c) * Pi / 180
    where
    c = sin(lat1)*sin(lat2)*cos(long1-long2) + cos(lat1)*cos(lat2)
    where all trigonometric calculations are done in degrees (note that the trig operations in the Math classs do their work in radians instead of degrees, so you will need to convert appropriately).
  3. The standard deviation is defined by the following equation:

    where N is the number of samples, xi is the value of the ith sample, and x with the bar over it is the average of all the x's.
Just for Fun

For added enjoyment, you may wish to consider displaying any of the following:

Checkpoint One (due 11:00pm, the day prior to week 9 lab) (70 points)

You should submit your Java source code for the first assignment. You will be required to demonstrate your working program at the beginning of the week 9 lab period.

Final Lab report (due 11:00pm, the day prior to the week 10 lab) (130 points)

Use the lab 5 template file to use as a starting point for this report. You can just leave the other sections blank.

Continue using the XML file that you submitted in week 5.

The lab report need not be self-contained. Your report should include:

As with any report you submit, correct spelling and grammar are required. In addition, your report should be submitted electronically following the Electronic submission guidelines. (You may wish to consult the XML help video and/or sample report before submitting your report.) Be sure to keep copies of all your files, in case something gets lost.

Your grade will depend on quality of design, clarity of code and documentation, as well as whether your program produces the correct results. If you have any questions, consult your instructor.

Acknowledgment

This laboratory assignment was developed by Dr. Chris Taylor.

Last Updated: Thursday, 01-Jan-2015 14:29:47 EST