|

|
|

|
|
**Contributors:** Edah Sahinovic, Katharina Wöhs, Christina Zorenböhmer
|
|
**Contributors:** Edah Sahinovic, Katharina Wöhs, Christina Zorenböhmer
|
|
|
|
**.java Files:** All .java files can be found in our ["Codes" folder](https://git.sbg.ac.at/s1080384/EoT/-/tree/main/Java%20Codes).
|
|
|
|
|
|
## Background and Aim
|
|
## Background and Aim
|
|
|
|
|
... | @@ -27,9 +28,7 @@ Although it was not technically required by the assignment instructions, we want |
... | @@ -27,9 +28,7 @@ Although it was not technically required by the assignment instructions, we want |
|
Specifically, we wanted to allow user input for these decisions:
|
|
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.** Ask the user to **choose a local directory**, where the programme would store the tweets.csv, tweets.kml, boston.png, and boston.kml files. <details><summary>See Code Snippet</summary>
|
|
|
|
|
|
<details><summary>Code Snippet</summary>
|
|
|
|
|
|
|
|
```
|
|
```
|
|
Scanner askUser = new Scanner(System.in);
|
|
Scanner askUser = new Scanner(System.in);
|
... | @@ -41,9 +40,7 @@ System.out.println("Hello! Welcome to this Google Earth Tweet and WMS Mapper.\n\ |
... | @@ -41,9 +40,7 @@ System.out.println("Hello! Welcome to this Google Earth Tweet and WMS Mapper.\n\ |
|
</details>
|
|
</details>
|
|
|
|
|
|
|
|
|
|
**2.** Ask the user if they would like to **see additional information** on the WMS while the programme is running
|
|
**2.** Ask the user if they would like to **see additional information** on the WMS while the programme is running. <details><summary>See Code Snippet</summary>
|
|
|
|
|
|
<details><summary>Code Snippet</summary>
|
|
|
|
|
|
|
|
```
|
|
```
|
|
Scanner askServiceInfo = new Scanner(System.in);
|
|
Scanner askServiceInfo = new Scanner(System.in);
|
... | @@ -55,9 +52,7 @@ Scanner askServiceInfo = new Scanner(System.in); |
... | @@ -55,9 +52,7 @@ Scanner askServiceInfo = new Scanner(System.in); |
|
</details>
|
|
</details>
|
|
|
|
|
|
|
|
|
|
**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.
|
|
**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. <details><summary>See Code Snippet</summary>
|
|
|
|
|
|
<details><summary>Code Snippet</summary>
|
|
|
|
|
|
|
|
```
|
|
```
|
|
Scanner askContinue = new Scanner(System.in);
|
|
Scanner askContinue = new Scanner(System.in);
|
... | @@ -71,15 +66,17 @@ Scanner askContinue = new Scanner(System.in); |
... | @@ -71,15 +66,17 @@ Scanner askContinue = new Scanner(System.in); |
|
|
|
|
|
## Step 1: Creating a Central Class from which to Execute the Whole Programme
|
|
## Step 1: Creating a Central Class from which to Execute the Whole Programme
|
|
|
|
|
|
To make the whole programme run smoothly without the user having to figure out which classes to execute and in which order, we simply applied our previously gained knowledge about modularity and decided to create a set of non-executable classes that will be called from the main class in the correct order.
|
|
As stated above, we aimed to make the whole programme run smoothly without the user having to figure out which classes to execute and in which order. We therefore applied our newly obtained knowledge about modularity and created a set of non-executable classes that will be called from the main class ["GoogleEarthTweetMapper.java"](url) in the correct order.
|
|
The corresponding .java file for this class can be found [here](https://git.sbg.ac.at/s1080384/EoT/-/blob/main/.java%20Files/execute_programme.java).
|
|
|
|
|
|
Our concept for this approach is visualised below:
|
|
|
|
|
|
|
|
INSERT IMAGE... NEED TO MAKE IT FIRST
|
|
|
|
|
|
## Step 2: Web Map Service
|
|
## Step 2: Web Map Service
|
|
|
|
|
|
### 2.1: Connecting and Downloading WMS
|
|
### 2.1: Connecting and Downloading WMS
|
|
|
|
|
|
First, we created a [non-executable class "wms_GetMap](https://git.sbg.ac.at/s1080384/EoT/-/blob/main/Previous%20Versions%20(working%20files)/Christina%2004_07_2021/wms_GetMap.java) that contains a method `getMap()` that:
|
|
First, we created a [non-executable class "wms_GetMap"](https://git.sbg.ac.at/s1080384/EoT/-/blob/main/Java%20Codes/Previous%20Versions%20(working%20files)/Christina%2004_07_2021/wms_GetMap.java) that contains a method `getMap()` that:
|
|
> 1. creates a WebMapServer object
|
|
> 1. creates a WebMapServer object
|
|
> 2. tests the URL
|
|
> 2. tests the URL
|
|
> 3. retrieves the WMSCapabilities and information about the service
|
|
> 3. retrieves the WMSCapabilities and information about the service
|
... | @@ -89,7 +86,7 @@ First, we created a [non-executable class "wms_GetMap](https://git.sbg.ac.at/s10 |
... | @@ -89,7 +86,7 @@ First, we created a [non-executable class "wms_GetMap](https://git.sbg.ac.at/s10 |
|
|
|
|
|
When this method is called from the main class, the user will be kept updated and will see the following on the console:
|
|
When this method is called from the main class, the user will be kept updated and will see the following on the console:
|
|
|
|
|
|
<details><summary>Console Output</summary>
|
|
<details><summary>See Console Output</summary>
|
|
|
|
|
|
```
|
|
```
|
|
Accessing WMS and downloading .png of Boston to local directory at: C:\Users\Christina\Documents\EoT\boston.png...
|
|
Accessing WMS and downloading .png of Boston to local directory at: C:\Users\Christina\Documents\EoT\boston.png...
|
... | @@ -119,14 +116,14 @@ The result is this image "boston.png": |
... | @@ -119,14 +116,14 @@ The result is this image "boston.png": |
|
|
|
|
|
### 2.2: Converting WMS Image into .KML
|
|
### 2.2: Converting WMS Image into .KML
|
|
|
|
|
|
Here, we created a [non-executable class "wms_ImageToKML](https://git.sbg.ac.at/s1080384/EoT/-/blob/main/Previous%20Versions%20(working%20files)/Christina%2004_07_2021/wms_ImageToKML.java) that contains a method `wmsTOkml()` that:
|
|
Here, we created a [non-executable class "wms_ImageToKML"](https://git.sbg.ac.at/s1080384/EoT/-/blob/main/Java%20Codes/Previous%20Versions%20(working%20files)/Christina%2004_07_2021/wms_ImageToKML.java) that contains a method `wmsTOkml()` that:
|
|
|
|
|
|
> - finds the local boston.png image
|
|
> - finds the local boston.png image
|
|
> - writes a kml file (containing the image) to a local wms_kml_structure.kml
|
|
> - writes a kml file (containing the image) to a local wms_kml_structure.kml
|
|
|
|
|
|
When this method is called from the main class, the user will be kept updated and will see the following on the console:
|
|
When this method is called from the main class, the user will be kept updated and will see the following on the console:
|
|
|
|
|
|
<details><summary>Console Output</summary>
|
|
<details><summary>See Console Output</summary>
|
|
|
|
|
|
```
|
|
```
|
|
Turning local .png of Boston into kml format at: C:\Users\Christina\Documents\EoT\wms_kml_structure.kml...
|
|
Turning local .png of Boston into kml format at: C:\Users\Christina\Documents\EoT\wms_kml_structure.kml...
|
... | @@ -141,13 +138,13 @@ Step 2 completed. |
... | @@ -141,13 +138,13 @@ Step 2 completed. |
|
|
|
|
|
### 3.1: Downloading
|
|
### 3.1: Downloading
|
|
|
|
|
|
Although this step was not included in the assignment instructions, we decided it would be nice for the user to not worry about having to download the .csv file themselves. Therefore we created a [non-executable class "tweets_download"](https://git.sbg.ac.at/s1080384/EoT/-/blob/main/Previous%20Versions%20(working%20files)/Christina%2004_07_2021/tweets_download.java) that contains the methods `saveFileFromUrlWithCommonsIO()` and `downloadCSV()` that:
|
|
Although this step was not included in the assignment instructions, we decided it would be nice for the user to not worry about having to download the .csv file themselves. Therefore we created a [non-executable class "tweets_download"](https://git.sbg.ac.at/s1080384/EoT/-/blob/main/Java%20Codes/Previous%20Versions%20(working%20files)/Christina%2004_07_2021/tweets_download.java) that contains the methods `saveFileFromUrlWithCommonsIO()` and `downloadCSV()` that:
|
|
|
|
|
|
> - access and download the .csv file from a web-URL
|
|
> - access and download the .csv file from a web-URL
|
|
|
|
|
|
The user is informed of this process when the method is called from the main class:
|
|
The user is informed of this process when the method is called from the main class:
|
|
|
|
|
|
<details><summary>Console Output</summary>
|
|
<details><summary>See Console Output</summary>
|
|
|
|
|
|
```
|
|
```
|
|
Downloading online tweets.csv and storing locally ...
|
|
Downloading online tweets.csv and storing locally ...
|
... | @@ -166,14 +163,14 @@ Step 3 completed. |
... | @@ -166,14 +163,14 @@ Step 3 completed. |
|
|
|
|
|
### 4.1: Ask User to Proceed and Launch
|
|
### 4.1: Ask User to Proceed and Launch
|
|
|
|
|
|
In this final step, we merely used one [non-executable class "googleEarth_launch"](https://git.sbg.ac.at/s1080384/EoT/-/blob/main/Previous%20Versions%20(working%20files)/Christina%2004_07_2021/googleEarth_launch.java) with a method `launchGoogleEarth()` that:
|
|
In this final step, we merely used one [non-executable class "googleEarth_launch"](https://git.sbg.ac.at/s1080384/EoT/-/blob/main/Java%20Codes/Previous%20Versions%20(working%20files)/Christina%2004_07_2021/googleEarth_launch.java) with a method `launchGoogleEarth()` that:
|
|
|
|
|
|
> - asks the user if they would like to proceed or else end the programme
|
|
> - asks the user if they would like to proceed or else end the programme
|
|
> - launches google earth and opens the .kml files
|
|
> - launches google earth and opens the .kml files
|
|
|
|
|
|
Once again, we are keeping the user informed. The console will show the following:
|
|
Once again, we are keeping the user informed. The console will show the following:
|
|
|
|
|
|
<details><summary>Console Output</summary>
|
|
<details><summary>See Console Output</summary>
|
|
|
|
|
|
```
|
|
```
|
|
Would you like to proceed to launch Google Earth now? Type Y for yes or anything else for no and hit enter.
|
|
Would you like to proceed to launch Google Earth now? Type Y for yes or anything else for no and hit enter.
|
... | | ... | |