Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Genesys PGR
Geo Tools
Commits
8d0da495
Commit
8d0da495
authored
Jan 21, 2016
by
Matija Obreza
Browse files
Include origCty and the last CSV column in the KML
parent
b805dde3
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/org/genesys/geotools/CSV2KML.java
View file @
8d0da495
...
...
@@ -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
();
}
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment