... | @@ -14,8 +14,49 @@ This End of Term (EoT) Assignment |
... | @@ -14,8 +14,49 @@ This End of Term (EoT) Assignment |
|
- Convert Tweets to extruding polygon features with timestamp
|
|
- Convert Tweets to extruding polygon features with timestamp
|
|
- Launch Google Earth and all KML files
|
|
- Launch Google Earth and all KML files
|
|
|
|
|
|
|
|
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:
|
|
|
|
|
|
|
|
### Object-Oriented Programming
|
|
|
|
|
|
|
|
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, 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 that will bring all the individual steps together.
|
|
|
|
|
|
|
|
### User Input and Experience
|
|
|
|
|
|
|
|
Although it was not technically required by the assignment instructions, we wanted to allow the user to interact with the programme in a few key steps. With this, we also had the aim of enhancing the user experience. We tried to come up with simple and friendly texts that would inform the user of what is happening. For example, the programme starts with a greeting and an explanation of what will happen.
|
|
|
|
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
|
|
`
|
|
|
|
Scanner askUser = new Scanner(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();
|
|
|
|
|
|
|
|
`
|
|
|
|
|
|
|
|
2. Ask the user if they would like to see additional information on the WMS while the programme is running
|
|
|
|
|
|
|
|
`
|
|
|
|
Scanner askServiceInfo = new Scanner(System.in);
|
|
|
|
String answer;
|
|
|
|
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.");
|
|
|
|
answer = askServiceInfo.next();
|
|
|
|
`
|
|
|
|
|
|
|
|
3. Ask the user if they would like to proceed to launch Google Earth. This step also made sure that the programme would halt again (giving the user some time to actually read the console output before Google Earth launches). If the users does not answer with some form of "yes", the programme will end with a friendly good-bye message.
|
|
|
|
|
|
|
|
`
|
|
|
|
Scanner askContinue = new Scanner(System.in);
|
|
|
|
String answer1;
|
|
|
|
System.out.println("Would you like to proceed to launch Google Earth now? Type Y for yes or anything else for no and hit enter.");
|
|
|
|
answer1 = askContinue.next();
|
|
|
|
`
|
|
|
|
|
|
|
|
|
|
## Creating a Central Class from which to Execute the Whole Programme
|
|
## Creating a Central Class from which to Execute the Whole Programme
|
... | | ... | |