Commit bf336305 authored by Eric Duminil's avatar Eric Duminil
Browse files

Bug : old envelope isn't deleted

parent a132651a
......@@ -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");
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment