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
fa0b90e0
Commit
fa0b90e0
authored
Oct 11, 2022
by
Eric Duminil
Browse files
Merge branch 'develop'
parents
f6e9507e
0fc411d6
Pipeline
#6956
failed with stage
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/eu/simstadt/regionchooser/RegionChooserCLI.java
View file @
fa0b90e0
...
...
@@ -19,7 +19,7 @@
/**
* Command Line Interface for RegionChooser. Could be useful to extract large regions on server, or automate the process
* from batch/python scripts.
*
*
*/
// Usage: region_chooser [-hlV] [-e=31467] -o=output.gml -w=polygon.wkt -i=input.
...
...
@@ -109,6 +109,7 @@ public Integer call() throws Exception {
logInfo
(
"CityGML written to stdout."
);
PrintWriter
stdOut
=
spec
.
commandLine
().
getOut
();
count
=
RegionExtractor
.
selectRegionDirectlyFromCityGML
(
wktPolygon
,
localCRS
.
toString
(),
stdOut
,
citygmls
);
stdOut
.
flush
();
// To make sure the footer is written too.
}
else
{
try
(
BufferedWriter
gmlWriter
=
Files
.
newBufferedWriter
(
outputCityGML
))
{
count
=
RegionExtractor
.
selectRegionDirectlyFromCityGML
(
wktPolygon
,
localCRS
.
toString
(),
gmlWriter
,
...
...
src/test/java/eu/simstadt/regionchooser/RegionChooserCLITests.java
View file @
fa0b90e0
...
...
@@ -67,8 +67,9 @@ void testExtractRegionFromTwoCitygmls() throws IOException {
wkt
.
write
(
wktPolygon
);
}
assertFalse
(
Files
.
exists
(
outGML
));
new
CommandLine
(
new
RegionChooserCLI
()).
execute
(
"--input="
+
citygml1
+
","
+
citygml2
,
"--output="
+
outGML
,
"--wkt="
+
inWKT
,
"--epsg=31463"
,
"--local"
);
new
CommandLine
(
new
RegionChooserCLI
()).
execute
(
"--input="
+
citygml1
+
","
+
citygml2
,
"--output="
+
outGML
,
"--wkt="
+
inWKT
,
"--epsg=31463"
,
"--local"
);
assertTrue
(
Files
.
exists
(
outGML
));
assertTrue
(
Files
.
size
(
outGML
)
>
600_000
);
assertEquals
(
20
,
countBuildings
(
outGML
));
...
...
@@ -123,7 +124,8 @@ void testExtractRegionWithStandardInputAndStandardOutput() throws IOException {
assertTrue
(
err
.
toString
().
contains
(
expectedLog
),
err
.
toString
()
+
" should contain "
+
expectedLog
);
String
expectedBuilding
=
"uuid_0547df65-ae80-459e-bb15-c839c1a2e566"
;
assertTrue
(
out
.
toString
().
contains
(
expectedBuilding
),
out
.
toString
()
+
" should contain "
+
expectedBuilding
);
//TODO: Check if footer is here too
String
expectedFooter
=
"</CityModel>"
;
assertTrue
(
out
.
toString
().
contains
(
expectedFooter
),
out
.
toString
()
+
" should contain "
+
expectedFooter
);
assertFalse
(
Files
.
exists
(
noOutput
));
}
...
...
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