... | @@ -5,7 +5,7 @@ |
... | @@ -5,7 +5,7 @@ |
|
|
|
|
|
This End of Term (EoT) Assignment shall:
|
|
This End of Term (EoT) Assignment shall:
|
|
|
|
|
|
> - Contain an executable Java class called “GoogleEarthTweetMapper”, which integrates data from an OGC WMS and a Tweets text file, and displays them in Google Earth
|
|
> - Contain an executable Java class called `GoogleEarthTweetMapper.java`, which integrates data from an OGC WMS and a Tweets text file, and displays them in Google Earth
|
|
> - Establish a WMS connection and download it as .png
|
|
> - Establish a WMS connection and download it as .png
|
|
> - Integrate the WMS Image into Google Earth (.kml)
|
|
> - Integrate the WMS Image into Google Earth (.kml)
|
|
> - Download Tweets text file
|
|
> - Download Tweets text file
|
... | @@ -17,7 +17,7 @@ Before launching into a detailed description of our code and result, we first wa |
... | @@ -17,7 +17,7 @@ Before launching into a detailed description of our code and result, we first wa |
|
|
|
|
|
### 1. Modularity (Object-Oriented Programming)
|
|
### 1. Modularity (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, 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") that will bring all the individual steps together.
|
|
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.
|
|
|
|
|
|
### 2. User Input and Experience
|
|
### 2. User Input and Experience
|
|
|
|
|
... | @@ -27,7 +27,7 @@ Although it was not technically required by the assignment instructions, we want |
... | @@ -27,7 +27,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>Code Snippet</summary>
|
|
<details><summary>Code Snippet</summary>
|
|
|
|
|
... | @@ -41,7 +41,7 @@ System.out.println("Hello! Welcome to this Google Earth Tweet and WMS Mapper.\n\ |
... | @@ -41,7 +41,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>Code Snippet</summary>
|
|
<details><summary>Code Snippet</summary>
|
|
|
|
|
... | @@ -55,7 +55,7 @@ Scanner askServiceInfo = new Scanner(System.in); |
... | @@ -55,7 +55,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>Code Snippet</summary>
|
|
<details><summary>Code Snippet</summary>
|
|
|
|
|
... | @@ -79,7 +79,7 @@ The corresponding .java file for this class can be found [here](https://git.sbg. |
... | @@ -79,7 +79,7 @@ The corresponding .java file for this class can be found [here](https://git.sbg. |
|
|
|
|
|
### 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/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
|
... | @@ -119,7 +119,7 @@ The result is this image "boston.png": |
... | @@ -119,7 +119,7 @@ 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/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
|
... | @@ -141,7 +141,7 @@ Step 2 completed. |
... | @@ -141,7 +141,7 @@ 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/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
|
|
|
|
|
... | @@ -166,7 +166,7 @@ Step 3 completed. |
... | @@ -166,7 +166,7 @@ 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/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
|
... | | ... | |