Update End of Term Assignment authored by Zorenböhmer Christina's avatar Zorenböhmer Christina
......@@ -449,6 +449,52 @@ Step 3 completed.
### 3.2: Converting .csv into .kml
.....
The conversion into a '.kml' file required some research about
**Time Stamp**
After some initial [research](https://developers.google.com/kml/documentation/kmlreference#timestamp) into typical kml conform time stamps and comparing them to the tweets.csv, we identified chose to aim for a time stamp that was already in most parts given in the .csv, but with a few differences:
> kml time stamp: 1997-07-16T10:30:15+03:00
> tweets.csv time format: 2012-11-05 15:47:16+01
We therefore concluded that we needed to add in the "T" where the blank space is and add ":00" at the end.
<details><summary>This is how we created the kml-conform time stamp</summary>
```java
try {
BufferedReader br = new BufferedReader(new FileReader(twitter_csv));
while((line = br.readLine()) != null) {
if(count != 0) {
String[] column = line.split(splitBy);
String[] time = column[6].split(" "); // split the "created_at" column entry by a blank space, since there is a blank where we need to add a "T"
kmlcontent.add("<Placemark>\n" +
"<name>"+ count +"</name>\n" +
"<description><![CDATA[\n"+ // pop-up box with some descriptions
"<h1>Tweet Description</h1>\n" +
"<span style='color:blue'>Additional Infos:</span>\n" +
"<table border=1>\n" +
"<tr><td>Hashtags </td><td>" + column[3] + "</td></tr>\n" +
"<tr><td>Tweet Content</td><td>" + column[5] + "</td></tr>\n" +
"<tr><td>Time of Tweet</td><td>" + column[6] + "</td></tr>\n" +
"</table>\n"+
"]]></description>\n" +
"<Point>\n" +
"<coordinates>" + column[1] + "," + column[2] + ",0</coordinates>\n" +
"</Point>\n" +
"<TimeStamp>\n" +
"<when>" + time[0] + "T" + time[1] + ":00</when>\n" + // .kml conform formatting
"</TimeStamp>\n" +
"</Placemark>\n");
}
```
</details>
## Step 4: Launch Google Earth
......
......