Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Eric Duminil
RegionChooser
Commits
19bb3024
Commit
19bb3024
authored
Mar 12, 2018
by
Eric Duminil
Browse files
RegionChooser: Reading hulls.
parent
8f38b58f
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/eu/simstadt/regionchooser/RegionChooserBrowser.java
View file @
19bb3024
...
@@ -10,6 +10,7 @@
...
@@ -10,6 +10,7 @@
import
java.nio.file.Path
;
import
java.nio.file.Path
;
import
java.nio.file.Paths
;
import
java.nio.file.Paths
;
import
java.util.Enumeration
;
import
java.util.Enumeration
;
import
java.util.List
;
import
java.util.prefs.Preferences
;
import
java.util.prefs.Preferences
;
import
java.util.zip.ZipEntry
;
import
java.util.zip.ZipEntry
;
import
java.util.zip.ZipFile
;
import
java.util.zip.ZipFile
;
...
@@ -55,8 +56,30 @@ public JavaScriptFXBridge() {
...
@@ -55,8 +56,30 @@ public JavaScriptFXBridge() {
}
}
}
}
public
void
refreshHulls
()
{
public
String
refreshHulls
()
throws
IOException
{
System
.
out
.
println
(
"SHOULD REFRESH : "
+
repo
);
System
.
out
.
println
(
"Look for hulls in "
+
repo
);
Path
url
=
Paths
.
get
(
"just_a_test.kml"
);
try
(
BufferedWriter
bw
=
Files
.
newBufferedWriter
(
url
))
{
bw
.
write
(
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
+
"<kml>\n"
+
" <Document>\n"
);
Files
.
walk
(
repo
)
.
filter
(
Files:
:
isRegularFile
)
.
filter
(
p
->
p
.
toString
().
contains
(
".cache"
)
&&
p
.
toString
().
endsWith
(
".xyz"
))
.
forEach
(
p
->
{
System
.
out
.
println
(
"Parsing "
+
p
);
try
{
List
<
String
>
lines
=
Files
.
readAllLines
(
p
);
for
(
String
line
:
lines
)
{
bw
.
write
(
line
+
"\n"
);
}
}
catch
(
IOException
ex
)
{
ex
.
printStackTrace
();
}
});
bw
.
write
(
" </Document>\n"
+
"</kml>"
);
}
catch
(
Exception
ex
)
{
ex
.
printStackTrace
();
}
return
Paths
.
get
(
"src/eu/simstadt/regionchooser/website"
).
relativize
(
url
).
toString
();
}
}
public
void
downloadRegion
(
String
wktPolygon
,
String
productName
,
JSObject
novaFactoryLayer
)
public
void
downloadRegion
(
String
wktPolygon
,
String
productName
,
JSObject
novaFactoryLayer
)
...
...
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