... | @@ -162,13 +162,13 @@ At the outset we began gathering ideas and drawing up concepts for our approach. |
... | @@ -162,13 +162,13 @@ At the outset we began gathering ideas and drawing up concepts for our approach. |
|
|
|
|
|

|
|

|
|
|
|
|
|
### The Main Executable Class
|
|
## The Main Executable Class: GoogleEarthTweetMapper.java
|
|
|
|
|
|
Although this class could not be completed until we had created all other classes, we will begin with this class since it provides a neat summary of how all components for our project come together.
|
|
Although this class could not be completed until we had created all other classes, we will begin with this class since it provides a neat summary of how all components for our project come together.
|
|
|
|
|
|
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 hope that it may demonstrate how we applied our newly obtained knowledge about modularity, to make the whole programme run smoothly and without the user having to figure our which classes to execute and in which order. To see the main class ["GoogleEarthTweetMapper.java"](url) 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 hope that it may demonstrate how we applied our newly obtained knowledge about modularity, to make the whole programme run smoothly and without the user having to figure our which classes to execute and in which order. To see the main class ["GoogleEarthTweetMapper.java"](https://git.sbg.ac.at/s1080384/EoT/-/blob/main/Java%20Codes/Final%20Version/GoogleEarthTweetMapper.java) in the correct order.
|
|
|
|
|
|
<details><summary> See the Code for the "GoogleEarthTweetMapper.java" class here</summary>
|
|
<details><summary> See the Code for the GoogleEarthTweetMapper.java class here</summary>
|
|
|
|
|
|
```java
|
|
```java
|
|
|
|
|
... | @@ -227,7 +227,7 @@ public class GoogleEarthTweetMapper { |
... | @@ -227,7 +227,7 @@ public class GoogleEarthTweetMapper { |
|
|
|
|
|
## User Input 1
|
|
## User Input 1
|
|
|
|
|
|
In this first step we ask the user to give us the "thumbs up" for downloading the required files onto their PC. We set the default directory to "C:/Users/Public/Documents", which is given on any PC. Nonetheless, we wanted to let the user specify a different directory if they prefer that.
|
|
In this first step we ask the user to give us the "thumbs up" for downloading the required files onto their PC. We set the default directory to "C:/Users/Public/Documents", which is given on any PC. Nonetheless, we wanted to let the user specify a different directory if they prefer that. This was implemented in the non-executable [user_Input.java](https://git.sbg.ac.at/s1080384/EoT/-/blob/main/Java%20Codes/Final%20Version/User_input.java) class.
|
|
|
|
|
|
<details><summary> See the Code for the "userInput.java class here</summary>
|
|
<details><summary> See the Code for the "userInput.java class here</summary>
|
|
|
|
|
... | @@ -344,7 +344,7 @@ New directory set to: C:\Users\Christina\Documents\Test Folder |
... | @@ -344,7 +344,7 @@ New directory set to: C:\Users\Christina\Documents\Test Folder |
|
|
|
|
|
## Connecting to WMS and Downloading Image
|
|
## Connecting to WMS and Downloading Image
|
|
|
|
|
|
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:
|
|
First, we created a non-executable [wms_GetMap.java](https://git.sbg.ac.at/s1080384/EoT/-/blob/main/Java%20Codes/Final%20Version/WMS_GetMap.java) class which 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
|
... | @@ -482,16 +482,14 @@ Image was successfully saved at: C:\Users\Christina\Documents\Test Folder\boston |
... | @@ -482,16 +482,14 @@ Image was successfully saved at: C:\Users\Christina\Documents\Test Folder\boston |
|
|
|
|
|
|
|
|
|
|
|
|
|
The result is this image "boston.png":
|
|
The result is this image "boston.png": http://maps.heigit.org/osm-wms/service?REQUEST=GetMap&FORMAT=image%2Fpng&SRS=EPSG:4326&BBOX=-71.13,42.32,-71.03,42.42&VERSION=1.1.1&STYLES=default&SERVICE=WMS&WIDTH=1000&HEIGHT=1000&TRANSPARENT=TRUE&LAYERS=osm_auto%3Aall
|
|
|
|
|
|

|
|
|
|
|
|
|
|
## Converting WMS Image into .KML
|
|
## Converting WMS Image into .KML
|
|
|
|
|
|
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:
|
|
Here, we created a non-executable [wms_ImageToKML"](https://git.sbg.ac.at/s1080384/EoT/-/blob/main/Java%20Codes/Final%20Version/WMS_ImageToKML.java) class which 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
|
|
|
|
|
|
<details><summary>See Code for the "wms_ImageToKML.java" class here</summary>
|
|
<details><summary>See Code for the "wms_ImageToKML.java" class here</summary>
|
|
|
|
|
... | @@ -583,9 +581,7 @@ Image converted to kml and stored at: C:\Users\Christina\Documents\Test Folder\b |
... | @@ -583,9 +581,7 @@ Image converted to kml and stored at: C:\Users\Christina\Documents\Test Folder\b |
|
|
|
|
|
## Downloading Twitter.csv File
|
|
## Downloading Twitter.csv File
|
|
|
|
|
|
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:
|
|
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 [tweets_download.java] (https://git.sbg.ac.at/s1080384/EoT/-/blob/main/Java%20Codes/Final%20Version/Tweets_download.java) class that contains the methods `saveFileFromUrlWithCommonsIO()` and `downloadCSV()` that access and download the .csv file from this web-URL: http://www.berndresch.com/work/twitter.csv
|
|
|
|
|
|
> - access and download the .csv file from a web-URL
|
|
|
|
|
|
|
|
|
|
|
|
<details><summary>See the Code for the "tweets_download.java" Class</summary>
|
|
<details><summary>See the Code for the "tweets_download.java" Class</summary>
|
... | @@ -649,7 +645,7 @@ CSV file downloaded and stored at :C:\Users\Christina\Documents\Test Folder\twee |
... | @@ -649,7 +645,7 @@ CSV file downloaded and stored at :C:\Users\Christina\Documents\Test Folder\twee |
|
|
|
|
|
## Converting Tweets.csv into Tweets.kml
|
|
## Converting Tweets.csv into Tweets.kml
|
|
|
|
|
|
This step proved to be the most complex one. In the end we used two methods within the tweets_polygons.java class. The first method dynamically determines a colour-code for the placemarks depending on the time of the tweet. The second method creates a kml file that contains 3D polygons for the point locations, with pop-up boxes, time-stamps, and a colour-coded visualisation of the time of the tweet.
|
|
This step proved to be the most complex one. In the end we used two methods within the non-executable [tweets_polygons.java](https://git.sbg.ac.at/s1080384/EoT/-/blob/main/Java%20Codes/Final%20Version/Tweets_polygons.java) class. The first method dynamically determines a colour-code for the placemarks depending on the time of the tweet. The second method creates a kml file that contains 3D polygons for the point locations, with pop-up boxes, time-stamps, and a colour-coded visualisation of the time of the tweet.
|
|
|
|
|
|
In the process of creating this class we had to deal with a few challenges:
|
|
In the process of creating this class we had to deal with a few challenges:
|
|
|
|
|
... | @@ -867,7 +863,7 @@ All 1163 placemarks have been integrated into a single KML file, which is saved |
... | @@ -867,7 +863,7 @@ All 1163 placemarks have been integrated into a single KML file, which is saved |
|
|
|
|
|
## Creating a KML Tour
|
|
## Creating a KML Tour
|
|
|
|
|
|
Although not technically required, we though it would improve the user experience to be guided through the results in Google Earth. We therefore created our own KML tour and integrated it into a non-executable .java class that stores the tour.kml locally.
|
|
Although not technically required, we though it would improve the user experience to be guided through the results in Google Earth. We therefore created our own KML tour and integrated it into a non-executable [googleEarth_Tour.java](https://git.sbg.ac.at/s1080384/EoT/-/blob/main/Java%20Codes/Final%20Version/GoogleEarth_tour.java) class that stores the tour.kml locally.
|
|
|
|
|
|
<details><summary>See the Code for the googleEarth_Tour.java Class</summary>
|
|
<details><summary>See the Code for the googleEarth_Tour.java Class</summary>
|
|
|
|
|
... | @@ -1085,7 +1081,7 @@ KML Tour created and stored at C:\Users\Christina\Documents\Test Folder\A Little |
... | @@ -1085,7 +1081,7 @@ KML Tour created and stored at C:\Users\Christina\Documents\Test Folder\A Little |
|
|
|
|
|
## User Input 2
|
|
## User Input 2
|
|
|
|
|
|
Before launching the Google Earth application, we wanted to ask the user to confirm that they want to launch the programme. For this, we simply used a scanner to prompt the user to enter some form of "yes" to launch the programme. If something else is entered, we end the programme. We called the askUser2() method from the user_Input.java class.
|
|
Before launching the Google Earth application, we wanted to ask the user to confirm that they want to launch the programme. For this, we simply used a scanner to prompt the user to enter some form of "yes" to launch the programme. If something else is entered, we end the programme. We called the askUser2() method from the non-executable [user_Input.java](https://git.sbg.ac.at/s1080384/EoT/-/blob/main/Java%20Codes/Final%20Version/User_input.java) class.
|
|
|
|
|
|
<details><summary>See the Code for the user_Input.java Class</summary>
|
|
<details><summary>See the Code for the user_Input.java Class</summary>
|
|
|
|
|
... | @@ -1191,9 +1187,7 @@ Continued. |
... | @@ -1191,9 +1187,7 @@ Continued. |
|
|
|
|
|
## Launch Google Earth
|
|
## Launch Google Earth
|
|
|
|
|
|
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:
|
|
In this final step, we merely used one [non-executable class "googleEarth_launch"](https://git.sbg.ac.at/s1080384/EoT/-/blob/main/Java%20Codes/Final%20Version/GoogleEarth_launch.java) with a method `launchGoogleEarth()` that launches google earth and opens all .kml files, including the tour.
|
|
|
|
|
|
> - launches google earth and opens all .kml files, including the tour
|
|
|
|
|
|
|
|
<details><summary>See the Code for the googleEarth_launch.java Class</summary>
|
|
<details><summary>See the Code for the googleEarth_launch.java Class</summary>
|
|
|
|
|
... | @@ -1260,7 +1254,7 @@ Launch complete. |
... | @@ -1260,7 +1254,7 @@ Launch complete. |
|
|
|
|
|
## Further Information
|
|
## Further Information
|
|
|
|
|
|
For further information on this project, don't hesitate to contact the authors:
|
|
For further information on this project, or to offer feedback, please don't hesitate to contact the authors/ creators:
|
|
|
|
|
|
> katharina.woehs@stud.sbg.ac.at
|
|
> katharina.woehs@stud.sbg.ac.at
|
|
>
|
|
>
|
... | | ... | |