@@ -18,7 +18,7 @@ This End of Term (EoT) Assignment shall:
Before launching into a detailed description of our code and result, we first want to discuss a few key aspects that we kept in mind for this assignment:
Since this assignment contains a variety of steps, it would lead to an extremely long and complex code if we designed it so that all the code was contained in a single class. Instead, after spending some time discussing our plan of action, we quickly opted for a more modular approach. This way, we can easily and intuitively dissect the programme into its sub-components. This division of sub-tasks makes it much easier for us to keep a clear structure in the programme and to easily jump into any of the sub-components if we need to work on that part. In this manner, we created one main executable class (`GoogleEarthTweetMapper.java`) that will bring all the individual steps together.
...
...
@@ -30,14 +30,31 @@ Although it was not technically required by the assignment instructions, we want
Specifically, we wanted to allow user input for these decisions:
**1.**Ask the user to **choose a local directory**, where the programme would store the tweets.csv, tweets.kml, boston.png, and boston.kml files.
**1.**Inform the user that the programme will download the CSV and KML files and **ask them for permission to store the files locally**.
```java
ScanneraskUser=newScanner(System.in);
System.out.println("Hello! Welcome to this Google Earth Tweet and WMS Mapper.\n\nBefore we get started, could you please enter a local directory (= a folder) where a few files may be stored?\n"
+"Simply enter a filepath below and hit enter.\nAn example would look like this: C:\\\\Users\\\\Christina\\\\Documents\\\\EoT");
directory=askUser.next();
ScanneraskUser=newScanner(System.in);// warning coming from non-closed scanner. Note: if we close it, subsequent scanners fail to work.
Stringanswer;
System.out.println("Hello! Welcome to this Google Earth Tweet and WMS Mapper!\n\n"
+"This programme will:\n"
+"1: download an image of Boston from a WMS\n"
+"2: convert it into a KML structure\n"
+"3: download a tweets.csv file from the web\n"
+"4: convert it into a KML structure\n"
+"5: launch both kml files in Google Earth\n\n"
+"The downloaded files will be stored at C:\\Users\\Public\\Documents\n"
+"If this is fine, please enter Y below and hit enter to continue! If not, we will stop the programme and you can manually change the directory at the very top of this class's code.");
System.out.println("We've stopped the programme. Please adjust the code and start again!");
System.exit(0);
}
```
...
...
@@ -46,10 +63,21 @@ System.out.println("Hello! Welcome to this Google Earth Tweet and WMS Mapper.\n\
```java
ScanneraskServiceInfo=newScanner(System.in);
ScanneraskServiceInfo=newScanner(System.in);//warning coming from non-closed scanner. Note: if scanner is closed subsequent scanners fail to work.
Stringanswer;
System.out.println("Would you like additional information on the WMS service while the programme runs? Type Y for yes or anything else for no and hit enter.");
System.out.println("\nWould you like additional information on the WMS service while the programme runs? Type Y for yes or anything else for no and hit enter.");
System.out.println("\tThe WMS capabilities are being retreived from a server called: "+serverName+"\n\tAnd the server's title is: "+serverTitle+"\n\t"+
"The requested image will be stored as a .png with dimensions of 1000 x 1000 pixels.\n\t"+
"The coordinate reference system is set to ESPG:4326.");