Displaying the shortest path with nice graphics and clear driving instructions. This is built on previous assignments, and will use graphics to produce a good looking map. The map files do not have exactly the format of the mystery file that we used in class. At the very bottom of this document I have detailed the differences. Now the user will select two places, something like this: starting place: Keokuk 1 possibilities: IA state: IA Place is Keokuk, IA, pop 11427 (40.4025, -91.3944), closest intersection 13859 destination: Miami 5 possibilities: AZ FL MO OK TX state: AZ Place is Miami, AZ, pop 1936 (33.3962, -110.872), closest intersection 24329 Your program then proceeds to find the shortest path between the two locations using Dijkstra's algorithm. It will then find the smallest area digital elevation model binary file that covers both the start and end point, and renders it graphically as a map, with carefully chosen colours indicating altitudes just like in an atlas. This file: http://rabbit.eng.miami.edu/geographical/bintiles/coverage.txt lists all the files and the areas that they cover. (You can't open a URL in C++ as though it were a file. You'll need to download the files to the computer you are using) The information on each line is the range of latitude, followed by the range of longitude, followed by the file name. The digital elevation model files are all here: https://rabbit.eng.miami.edu/geographical/bintiles/ their names begin with usa and end with .dat NOTE: that directory also has a file called all.zip so you don't have to download all the files individually, they are all compressed within it. The start and end points should be marked on the map along with their names. The shortest path is then drawn on the map as a clearly visible line following all the turns that a driver would make according to the final requirement: Include some screen shots in your submitted document. The path should be printed as detailed driving instructions to get from the starting place to the destination. Describe the starting intersection so that it can easily be found. Then for each step, say which road to take, in which direction, and for what distance, then describe where that road ends up. With one special thing: don't print consecutive steps along the same road. Wait until you follow a road whose name is different from the previous one, then print that road just once, with its cumulative distance. This is easy if you think about it properly, but you will still get most of the points if you don't manage this requirement. The output should look something like this, it should be just as informative as this, but being identical is not required. Starting place: Miami 5 possibilities: AZ FL MO OK TX state: FL Place is Miami, FL, pop 362470 (25.7877, -80.2241), closest intersection 28876 destination: Orlando 2 possibilities: FL OK state: FL Place is Orlando, FL, pop 185951 (28.5335, -81.3758), closest intersection 27923 Starting point is intersection #28876, 1.29 miles NE of Miami, FL where FL-836 and I-395 and I-95 meet take I-95 NW 1.43 miles to intersection #28869, 1.9 miles E of Miami, FL then FL-112 SW 3.379 miles to intersection #28871, 1.55 miles E of Brownsville, FL then US-27 NW 67.661 miles to intersection #28750, 0.41 miles W of South Bay, FL then unnamed road N 6.307 miles to intersection #28733, 2.93 miles S of Belle Glade, FL then US-441 N 6.051 miles to intersection #28701, 0.4 miles SE of Fremd Village-Padgett Island, FL then FL-729 N 1.7 miles to intersection #28690, 1.23 miles S of Pahokee, FL then US-441 N 2.101 miles to intersection #28685, 0.18 miles N of Canal Point, FL then US-98/US-441 NW 31.347 miles to intersection #28579, 0.32 miles SW of Okeechobee, FL then US-441 NW 34.474 miles to intersection #28311, 19.39 miles SE of Fellsmere, FL then unnamed road NW 44.954 miles to intersection #28114, 2.87 miles W of St. Cloud, FL then US-192/US-441 NW 0.385 miles to intersection #28109, 3.2 miles SE of St. Cloud, FL then unnamed road NW 12.022 miles to intersection #28042, 2.14 miles S of Taft, FL then US-17/US-92/US-441 N 5.635 miles to intersection #27966, 1 miles S of Holden Heights, FL then I-4 N 1.897 miles to intersection #27928, 0.57 miles W of Orlando, FL then unnamed road NE 0.553 miles to intersection #27923, 0.3 miles NW of Orlando, FL Destination is intersection #27923, 0.3 miles NW of Orlando, FL where FL-527 and unnamed road meet Total 219.896 miles Working with HLS colour descriptions instead of the more familiar RGB ones makes it easy to generate a range of slowly but smoothly changing colours, the conversion methods are here: https://rabbit.eng.miami.edu/class/een318/hlstorgb.txt Remember that if you have no other way to produce graphics from a C++ program, the notes for class 18, 22nd October, on the class web page include links to files that allow you to create .bmp files of your own design. They would have to be transferred to your own computer via sftp. You should be able to open the "terminal" app and type sftp rabbit.eng.miami.edu (this might not be necessary for you, but to make it work for me, I had to go to my ".ssh" directory, on a PC it is at C:\users\myusername\.ssh where myusername is replaced by your username on your PC, not on rabbit. Inside that directory I had to create a file called "config" (not config.txt or an other variant) and put these three lines inside it: Host rabbit.eng.miami.edu HostName rabbit.eng.miami.edu User yourusername where yourusername is replaced by your rabbit user name. I expect it to be very similar on a macintosh. Once you have logged in through sftp, the cd and ls commands work, but they are not quite their usual selves: you are not typing to a shell, just to the ftp server and it has a limited and different command set. To download a file use the command "get" followed by the file's name. The file's name may be followed by the name you want the file to have on your own computer is it is not the same. The "put" command is for uploading, but I doubt that would be needed. When finished, use the "quit" command. DIFFERENCES BETWEEN THE .dat FILES AND mystery.dat THAT WE EXAMINED IN CLASS. The usa....dat files are in almost the same format as mystery.dat, but with one extra row added at the beginning. This row contains human readable space-separated text looking like this: rows 600 columns 600 bytesperpixel 2 secondsperpixel 120 leftlongseconds -342000 toplatseconds 180000 min 1 max 1703 specialval -500 That means that you can read it the simple way that you usually read text files in C++: ifstream fin("usaXXXXX.dat", ios::in | ios::binary); string s; int n; for (int i = 0; i < 9; i += 1) { fin >> s >> n; ... so the first time round the loop you will read the string "rows" and the int 600, that tells you that after this extra line there are 600 rows of real elevation data. "columns 600" tells you that each row has 600 numbers in it, "bytesperpixel 2" tells you that those numbers are short ints (2 bytes long). "secondsperpixel 120" tells you the scale: the data points are 120 seconds of arc apart, that is 120 / 60 / 60 = 0.03333333 degrees. "leftlongseconds -342000" gives the longitude of the leftmost column of data, 95 degrees West. "toplatseconds 180000" says the latitude of the first row of points is 50 degrees North. Then you see that the range of elevations that actually appear in the data is from 1 to 1703 (I think it's in feet) and the special value that means "outside the coastline" is -500. After reading this text data you need to use fin.seekg to go to the beginning of the first row of real data, which in this case is 600 short ints from the beginning. You should read this line of data because not all files have the same size, and you need to have at least that one piece of information.