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
bf336305
Commit
bf336305
authored
Feb 20, 2023
by
Eric Duminil
Browse files
Bug : old envelope isn't deleted
parent
a132651a
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/test/java/eu/simstadt/regionchooser/RegionExtractorTests.java
View file @
bf336305
...
...
@@ -164,5 +164,31 @@ void testExtractBuildingsFrom2Citygmls() throws Throwable {
assertEquals
(
17
+
3
,
countRegexMatches
(
gmlFromTwoGMLs
,
"<bldg:Building gml:id"
));
}
@Test
void
testExtractBuildingsAndRemoveOld
()
throws
Throwable
{
String
wktPolygon
=
"POLYGON((293229.6831819388 5623753.072371232,293681.22751166753 5623744.274551504,293668.8482257676 5623469.512992135,293197.09954629745 5623504.821467172,293229.6831819388 5623753.072371232))"
;
Path
citygmlPath
=
TEST_REPOSITORY
.
resolve
(
"Others.proj/Aachen_LoD2_293_5623_1_NW.gml"
);
StringWriter
gmlWriter
=
new
StringWriter
();
int
count
=
RegionExtractor
.
selectRegionDirectlyFromCityGML
(
wktPolygon
,
"EPSG:25832"
,
gmlWriter
,
citygmlPath
);
String
oneAachenBuilding
=
gmlWriter
.
toString
();
System
.
out
.
println
(
oneAachenBuilding
);
assertEquals
(
1
,
count
);
assertEquals
(
1
,
countRegexMatches
(
oneAachenBuilding
,
CITY_OBJECT_MEMBER_REGEX
));
assertTrue
(
oneAachenBuilding
.
contains
(
"DENW39AL10003jfi"
));
assertFalse
(
oneAachenBuilding
.
contains
(
"<gml:lowerCorner>298393.46959639067 59277.34021543693 -11.892070104139751</gml:lowerCorner>"
),
"The exported CityGML shouldn't contain the original envelope"
);
assertFalse
(
oneAachenBuilding
.
contains
(
"urn:adv:crs:ETRS89_UTM32*DE_DHHN92_NH"
),
"The exported CityGML shouldn't contain the original envelope"
);
// assertTrue(oneAachenBuilding.contains("<gml:lowerCorner>299721.46983062755 61021.99295737501 -11.89"),
// "The exported CityGML should contain a new envelope with the original altitudes");
// assertTrue(oneAachenBuilding.contains("<gml:upperCorner>299823.9079725632 61122.68126771413 547.75"),
// "The exported CityGML should contain a new envelope with the original altitudes");
assertTrue
(
oneAachenBuilding
.
contains
(
"<gml:Envelope srsName=\"EPSG:25832\" srsDimension=\"3\">"
),
"The exported CityGML should contain a new envelope with the correct EPSG"
);
}
}
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