Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Eric Duminil
RegionChooser
Commits
6c9fede7
Commit
6c9fede7
authored
Oct 05, 2022
by
Eric Duminil
Browse files
Removing debug code.
parent
e6e7fe28
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/main/java/eu/simstadt/regionchooser/RegionChooserBrowser.java
View file @
6c9fede7
...
@@ -72,14 +72,12 @@ public Void call() throws IOException {
...
@@ -72,14 +72,12 @@ public Void call() throws IOException {
public
void
downloadRegionFromCityGML
(
String
wktPolygon
,
String
project
,
String
csvCitygmls
,
String
srsName
)
public
void
downloadRegionFromCityGML
(
String
wktPolygon
,
String
project
,
String
csvCitygmls
,
String
srsName
)
throws
IOException
,
ParseException
,
XPathParseException
,
NavException
{
throws
IOException
,
ParseException
,
XPathParseException
,
NavException
{
System
.
out
.
println
(
"BEEN HERE?"
);
Path
[]
paths
=
Stream
.
of
(
csvCitygmls
.
split
(
";"
)).
map
(
s
->
citygmlPath
(
project
,
s
)).
toArray
(
Path
[]::
new
);
Path
[]
paths
=
Stream
.
of
(
csvCitygmls
.
split
(
";"
)).
map
(
s
->
citygmlPath
(
project
,
s
)).
toArray
(
Path
[]::
new
);
StringBuilder
sb
=
RegionExtractor
.
selectRegionDirectlyFromCityGML
(
wktPolygon
,
srsName
,
paths
);
StringBuilder
sb
=
RegionExtractor
.
selectRegionDirectlyFromCityGML
(
wktPolygon
,
srsName
,
paths
);
File
buildingIdsFile
=
selectSaveFileWithDialog
(
project
,
csvCitygmls
.
replace
(
";"
,
"_"
),
"selected_region"
);
File
buildingIdsFile
=
selectSaveFileWithDialog
(
project
,
csvCitygmls
.
replace
(
";"
,
"_"
).
replace
(
".gml"
,
""
),
"selected_region"
);
if
(
buildingIdsFile
!=
null
)
{
if
(
buildingIdsFile
!=
null
)
{
try
(
BufferedWriter
writer
=
Files
.
newBufferedWriter
(
buildingIdsFile
.
toPath
()))
{
try
(
BufferedWriter
writer
=
Files
.
newBufferedWriter
(
buildingIdsFile
.
toPath
()))
{
char
[]
chars
=
new
char
[
BUFFER
];
char
[]
chars
=
new
char
[
BUFFER
];
...
...
src/main/resources/eu/simstadt/regionchooser/website/script/simstadt_openlayers.js
View file @
6c9fede7
...
@@ -174,8 +174,6 @@ var regionChooser = (function(){
...
@@ -174,8 +174,6 @@ var regionChooser = (function(){
// TODO: Add checkbox + label +
// TODO: Add checkbox + label +
// TODO: Add submit.
// TODO: Add submit.
// TODO: If possible, highlight the corresponding polygon when hovering above a name.
// TODO: If possible, highlight the corresponding polygon when hovering above a name.
console
.
log
(
"
Feature name :
"
+
feature
[
"
name
"
]);
console
.
log
(
"
Feature ID :
"
+
feature
.
getId
());
if
(
fromJavaFX
)
{
if
(
fromJavaFX
)
{
link
+=
'
<input type="checkbox" id="citygml_
'
+
feature
.
getId
()
+
'
" class="select_citygml"><label for="citygml_
'
+
feature
.
getId
()
+
'
">
'
+
feature
[
'
name
'
]
+
'
</label>
'
;
link
+=
'
<input type="checkbox" id="citygml_
'
+
feature
.
getId
()
+
'
" class="select_citygml"><label for="citygml_
'
+
feature
.
getId
()
+
'
">
'
+
feature
[
'
name
'
]
+
'
</label>
'
;
}
else
{
}
else
{
...
@@ -247,12 +245,10 @@ var regionChooser = (function(){
...
@@ -247,12 +245,10 @@ var regionChooser = (function(){
$
(
"
html
"
).
addClass
(
"
wait
"
);
$
(
"
html
"
).
addClass
(
"
wait
"
);
console
.
log
(
"
Selected region is written in
"
+
srsName
+
"
coordinate system.
"
);
console
.
log
(
"
Selected region is written in
"
+
srsName
+
"
coordinate system.
"
);
try
{
try
{
console
.
log
(
"
Before JAVA
"
);
fxapp
.
downloadRegionFromCityGML
(
sketchAsWKT
(
srsName
),
project
,
citygmlNames
.
join
(
"
;
"
),
srsName
);
fxapp
.
downloadRegionFromCityGML
(
sketchAsWKT
(
srsName
),
project
,
citygmlNames
.
join
(
"
;
"
),
srsName
);
console
.
log
(
"
After JAVA
"
);
dataPanel
.
append
(
"
<h2 class='ok'>Done!</h2><br/>
\n
"
);
dataPanel
.
append
(
"
<h2 class='ok'>Done!</h2><br/>
\n
"
);
}
catch
(
e
)
{
}
catch
(
e
)
{
console
.
log
(
"
ERROR
"
+
e
);
console
.
log
(
"
ERROR
:
"
+
e
);
dataPanel
.
append
(
"
<h2 class='error'>Some problem occured!</h2><br/>
\n
"
);
dataPanel
.
append
(
"
<h2 class='error'>Some problem occured!</h2><br/>
\n
"
);
}
}
var
end
=
new
Date
().
getTime
();
var
end
=
new
Date
().
getTime
();
...
@@ -288,6 +284,9 @@ var regionChooser = (function(){
...
@@ -288,6 +284,9 @@ var regionChooser = (function(){
dataPanel
.
append
(
wgs84_coords
+
"
<br/>
\n
"
);
dataPanel
.
append
(
wgs84_coords
+
"
<br/>
\n
"
);
}
}
dataPanel
.
append
(
"
<h3 class='clean'>Area :
"
+
(
area
/
10000
).
toFixed
(
1
)
+
"
ha
\n
"
);
dataPanel
.
append
(
"
<h3 class='clean'>Area :
"
+
(
area
/
10000
).
toFixed
(
1
)
+
"
ha
\n
"
);
//TODO: Add selectAll
//TODO: Add selectNone
//TODO: Hide button if empty
dataPanel
.
append
(
'
<button type="button" onclick="regionChooser.clickety_click()" id="download" style="visibility:hidden">Download Region</button>
'
);
dataPanel
.
append
(
'
<button type="button" onclick="regionChooser.clickety_click()" id="download" style="visibility:hidden">Download Region</button>
'
);
dataPanel
.
append
(
'
<br/>
\n
'
);
dataPanel
.
append
(
'
<br/>
\n
'
);
findIntersections
();
findIntersections
();
...
@@ -372,15 +371,11 @@ var regionChooser = (function(){
...
@@ -372,15 +371,11 @@ var regionChooser = (function(){
}
}
publicScope
.
clickety_click
=
function
()
{
publicScope
.
clickety_click
=
function
()
{
console
.
log
(
"
You clicked pretty well
"
);
var
checkedBoxes
=
Array
.
from
(
document
.
querySelectorAll
(
"
input.select_citygml
"
)).
filter
(
c
=>
c
.
checked
);
var
checkedBoxes
=
Array
.
from
(
document
.
querySelectorAll
(
"
input.select_citygml
"
)).
filter
(
c
=>
c
.
checked
);
if
(
checkedBoxes
.
length
===
0
){
if
(
checkedBoxes
.
length
===
0
){
console
.
log
(
"
You should select at least one citygml, though.
"
);
console
.
log
(
"
You should select at least one citygml, though.
"
);
}
else
{
}
else
{
checkedBoxes
.
forEach
(
c
=>
{
publicScope
.
downloadRegionFromCityGML
(
checkedBoxes
.
map
(
c
=>
c
.
id
));
console
.
log
(
"
Nice! You checked Citygml
"
+
c
.
id
)
});
publicScope
.
downloadRegionFromCityGML
(
checkedBoxes
.
map
(
c
=>
c
.
id
));
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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