Computer Science 210
Data Structures

Fall 2017, Siena College

Programming Project 2: Working with Highway Data
Due: 11:59 PM, Monday, October 9, 2017

For this fairly short programming project, you will begin working with some real world data derived from highway systems. You will likely use this same data in other assignments later this semester.

You may work alone or with a partner on this assignment. Only one submission per group is needed.

Getting Set Up

You will receive an email with the link to follow to set up your GitHub repository metalintro-project-yourgitname for this Programming Project. One member of the group should follow the link to set up the repository on GitHub, then that person should email the instructor with the other group members' GitHub usernames so they can be granted access. This will allow all members of the group to clone the repository and commit and push changes to the origin on GitHub. At least one group member should make a clone of the repository to begin work.

Working with Travel Mapping Data

A big advantage of working with this kind of data is that it has a connection to reality, and that we can visualize the data and the results of our manipulations of that data with the Google Maps API. This data is collected by the Travel Mapping (TM) Project (http://tm.teresco.org/). The METAL project has taken the highway data from TM and converted into a format that is more convenient for us to load into a data structure and use. Much more about the project is available at (/metal/, but everything you need to know should be in this document.

The Data

The data is in plain text ".tmg" ("Travel Mapping Graph") files which have the following format:

These graph files are linked from http://tm.teresco.org/graphs/. For example, usai-system.tmg describes the entire U.S. Interstate Highway system. YT-region.tmg describes a much smaller set of roads: the routes in the Yukon. Of interest might be siena25-area.tmg and siena50-area.tmg, which represents highways within 25 and 50 miles, respectively, of Siena. You can download a few individual files, or download a zip file of the entire collection.

To see what this data looks like in map form, you can load it into the METAL project's Highway Data Examiner, at /metal/hdx/.

Question 1: Download a smaller graph (a few hundred vertices and edges) and load it into HDX. Create a screen capture, save it in a file in your repository. Any common graphics format (e.g., JPG, GIF, PNG) is acceptable. (5 points)

Note that you will need to tell git to start tracking this file before you can commit and push it. If your file is called map.png, you would issue the command:

git add map.png

Initially, you will work only with waypoint data and ignore the road segments. Your tasks:

  1. Develop a class Waypoint that represents that data for a single waypoint. It should include fields for the waypoint name and its latitude and longitude values, a constructor, accessors for the three components, and appropriate equals and toString methods.
  2. Develop a class WaypointLoader that has a main method that takes the name of a .tmg file to be loaded as a command-line parameter, and reads all of the waypoints from that file into an array or an ArrayList of Waypoint objects. It should then enter an input loop where the user is repeatedly prompted for a string, and the program prints out all waypoints in your collection (array or ArrayList) whose labels contain the entered string as a substring, ignoring case.

Submitting

Your submission requires that all required deliverables are committed and pushed to the master for your repository's origin on GitHub. That's it! If you see everything you intend to submit when you visit your repository's page on GitHub, you're set.

Grading

This program will be graded as a programming assignment.

This assignment is worth 55 points, which are distributed as follows:

> FeatureValueScore
Lab Question 1 (HDX screen capture) 5
Waypoint fields 3
Waypoint constructor 3
Waypoint accessors 3
Waypoint equals 2
Waypoint toString 2
WaypointLoader command-line param with error checking 3
WaypointLoader load waypoints into an array or ArrayList 10
WaypointLoader interactive loop 5
WaypointLoader print all matching waypoints 6
Program design 3
Program style 3
Program documentation 7
Total 55