Commit 8d0da495 authored by Matija Obreza's avatar Matija Obreza
Browse files

Include origCty and the last CSV column in the KML

parent b805dde3
......@@ -12,6 +12,7 @@ public class CSV2KML {
int columnInstCode = 2;
int columnLatitude = 4;
int columnLongitude = 3;
int columnOrigCty = 5;
CSVReader reader = new CSVReader(new InputStreamReader(System.in), ',', '"', '\\', 0, false);
......@@ -23,6 +24,8 @@ public class CSV2KML {
while ((nextLine = reader.readNext()) != null) {
try {
String acceNumb = nextLine[columnAcceNumb].trim();
String remarks = nextLine[nextLine.length - 1].trim();
String origCty = nextLine[columnOrigCty].trim();
float latitude = Float.parseFloat(nextLine[columnLatitude].trim());
float longitude = Float.parseFloat(nextLine[columnLongitude].trim());
......@@ -31,9 +34,13 @@ public class CSV2KML {
System.out.print(nextLine[columnInstCode].trim());
System.out.print(": ");
System.out.print(acceNumb);
if (origCty != null)
System.out.print(" " + origCty);
System.out.println("</name>");
System.out.print("<description>");
System.out.print("https://www.genesys-pgr.org/acn/id/" + nextLine[columnGenesysId].trim());
if (remarks != null)
System.out.print("\n" + remarks);
System.out.println("</description>");
System.out.println("<Point><coordinates>");
System.out.print(longitude);
......@@ -47,7 +54,7 @@ public class CSV2KML {
}
System.out.println("</Document>");
System.out.println("</kml>");
reader.close();
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment