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

Trying to convert to Junit 5

parent ac674f49
......@@ -6,8 +6,12 @@
<artifactId>RegionChooser</artifactId>
<version>0.1.0-SNAPSHOT</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>${maven.compiler.source}</maven.compiler.target>
<junit-jupiter.version>5.6.0</junit-jupiter.version>
</properties>
<scm>
......@@ -16,13 +20,14 @@
</scm>
<dependencies>
<!-- https://mvnrepository.com/artifact/junit/junit -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>${junit-jupiter.version}</version>
<scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.osgeo/proj4j -->
<dependency>
<groupId>org.osgeo</groupId>
......@@ -123,7 +128,8 @@
</manifest>
<manifestEntries>
<Implementation-URL>http://simstadt.hft-stuttgart.de/</Implementation-URL>
<Implementation-Version>${project.version} (${scmBranch}, rev. ${buildNumber}, ${timestamp})</Implementation-Version>
<Implementation-Version>${project.version} (${scmBranch}, rev.
${buildNumber}, ${timestamp})</Implementation-Version>
</manifestEntries>
</archive>
</configuration>
......
package eu.simstadt.geo.fast_xml_parser;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;
import java.nio.file.Path;
import java.nio.file.Paths;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import com.ximpleware.XPathParseException;
......@@ -18,17 +18,17 @@
private void testNoNanInCoordinates(Path citygmlPath) throws XPathParseException {
CityGmlIterator buildingXmlNodes = new CityGmlIterator(citygmlPath);
for (BuildingXmlNode buildingXmlNode : buildingXmlNodes) {
assertTrue("Buildings should have coordinates", buildingXmlNode.hasCoordinates());
assertFalse(COORDINATE_SHOULD_BE_A_DOUBLE, Double.isNaN(buildingXmlNode.x));
assertFalse(COORDINATE_SHOULD_BE_A_DOUBLE, Double.isNaN(buildingXmlNode.y));
assertFalse(COORDINATE_SHOULD_BE_A_DOUBLE, Double.isNaN(buildingXmlNode.xMax));
assertFalse(COORDINATE_SHOULD_BE_A_DOUBLE, Double.isNaN(buildingXmlNode.yMax));
assertFalse(COORDINATE_SHOULD_BE_A_DOUBLE, Double.isNaN(buildingXmlNode.xMin));
assertFalse(COORDINATE_SHOULD_BE_A_DOUBLE, Double.isNaN(buildingXmlNode.yMin));
assertTrue(COORDINATES_SHOULD_BE_PLAUSIBLE, buildingXmlNode.xMax > buildingXmlNode.x);
assertTrue(COORDINATES_SHOULD_BE_PLAUSIBLE, buildingXmlNode.yMax > buildingXmlNode.y);
assertTrue(COORDINATES_SHOULD_BE_PLAUSIBLE, buildingXmlNode.xMin < buildingXmlNode.x);
assertTrue(COORDINATES_SHOULD_BE_PLAUSIBLE, buildingXmlNode.yMin < buildingXmlNode.y);
assertTrue(buildingXmlNode.hasCoordinates(), "Buildings should have coordinates");
assertFalse(Double.isNaN(buildingXmlNode.x), COORDINATE_SHOULD_BE_A_DOUBLE);
assertFalse(Double.isNaN(buildingXmlNode.y), COORDINATE_SHOULD_BE_A_DOUBLE);
assertFalse(Double.isNaN(buildingXmlNode.xMax), COORDINATE_SHOULD_BE_A_DOUBLE);
assertFalse(Double.isNaN(buildingXmlNode.yMax), COORDINATE_SHOULD_BE_A_DOUBLE);
assertFalse(Double.isNaN(buildingXmlNode.xMin), COORDINATE_SHOULD_BE_A_DOUBLE);
assertFalse(Double.isNaN(buildingXmlNode.yMin), COORDINATE_SHOULD_BE_A_DOUBLE);
assertTrue(buildingXmlNode.xMax > buildingXmlNode.x, COORDINATES_SHOULD_BE_PLAUSIBLE);
assertTrue(buildingXmlNode.yMax > buildingXmlNode.y, COORDINATES_SHOULD_BE_PLAUSIBLE);
assertTrue(buildingXmlNode.xMin < buildingXmlNode.x, COORDINATES_SHOULD_BE_PLAUSIBLE);
assertTrue(buildingXmlNode.yMin < buildingXmlNode.y, COORDINATES_SHOULD_BE_PLAUSIBLE);
}
}
......@@ -67,11 +67,11 @@ public void testExtractNoCoordsFromEmptyBuilding() throws XPathParseException {
CityGmlIterator buildingXmlNodes = new CityGmlIterator(citygmlPath);
int counter = 0;
for (BuildingXmlNode buildingXmlNode : buildingXmlNodes) {
assertFalse("Empty Buildings shouldn't have coordinates", buildingXmlNode.hasCoordinates());
assertTrue("Coordinate should be a Nan", Double.isNaN(buildingXmlNode.x));
assertTrue("Coordinate should be a Nan", Double.isNaN(buildingXmlNode.y));
assertFalse(buildingXmlNode.hasCoordinates(), "Empty Buildings shouldn't have coordinates");
assertTrue(Double.isNaN(buildingXmlNode.x), "Coordinate should be a Nan");
assertTrue(Double.isNaN(buildingXmlNode.y), "Coordinate should be a Nan");
counter++;
}
assertEquals("3 buildings should have been analyzed", counter, 3);
assertEquals(3, counter, "3 buildings should have been analyzed");
}
}
package eu.simstadt.geo.fast_xml_parser;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
......@@ -9,7 +9,7 @@
import java.nio.file.Paths;
import java.util.Comparator;
import java.util.concurrent.atomic.AtomicInteger;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.locationtech.jts.geom.Coordinate;
import org.locationtech.jts.geom.Geometry;
import org.locationtech.jts.geom.GeometryFactory;
......@@ -27,9 +27,9 @@
public void testExtractConvexHullFromOneBuilding() throws IOException, XPathParseException {
Path citygmlPath = repository.resolve("Gruenbuehl.proj/20140218_Gruenbuehl_LOD2_1building.gml");
Geometry hull = ConvexHullCalculator.calculateFromCityGML(citygmlPath);
assertEquals(hull.getCoordinates().length, 4 + 1); // Convex hull of a building should be a closed rectangle
assertEquals(4 + 1, hull.getCoordinates().length); // Convex hull of a building should be a closed rectangle
Point someBuildingPoint = gf.createPoint(new Coordinate(9.216845, 48.878196)); // WGS84
assertTrue("Hull should contain every building point", hull.contains(someBuildingPoint));
assertTrue(hull.contains(someBuildingPoint), "Hull should contain every building point");
}
@Test
......@@ -39,7 +39,7 @@ public void testExtractConvexHullFromOneSmallRegion() throws IOException, XPathP
assertTrue(hull.getCoordinates().length > 4); // Convex hull should have at least 4 corners
// Point somewhereBetweenBuildings = gf.createPoint(new Coordinate(3515883.6668538367, 5415843.300640578)); // Original coordinates, GSK3
Point somewhereBetweenBuildings = gf.createPoint(new Coordinate(9.21552249084, 48.87980446)); // WGS84
assertTrue("Hull should contain region between buildings", hull.contains(somewhereBetweenBuildings));
assertTrue(hull.contains(somewhereBetweenBuildings), "Hull should contain region between buildings");
}
@Test
......@@ -48,7 +48,7 @@ public void testExtractConvexHullFromStoeckachNoBuildingPart() throws IOExceptio
Geometry hull = ConvexHullCalculator.calculateFromCityGML(citygmlPath);
assertTrue(hull.getCoordinates().length > 4); // Convex hull should have at least 4 corners
Point somewhereBetweenBuildings = gf.createPoint(new Coordinate(9.195212, 48.789062)); // WGS84
assertTrue("Hull should contain region between buildings", hull.contains(somewhereBetweenBuildings));
assertTrue(hull.contains(somewhereBetweenBuildings), "Hull should contain region between buildings");
}
@Test
......@@ -63,13 +63,13 @@ public void testExtractConvexHullFromEveryCitygmlInRepository() throws IOExcepti
long gmlCount = RegionChooserUtils.everyCityGML(repository).count();
AtomicInteger hullCount = new AtomicInteger(0);
ConvexHullCalculator.extractHullsForEveryCityGML(repository, kmlHull -> {
assertTrue("KML hull should contain project name", kmlHull.contains("Data name=\"project\""));
assertTrue("KML hull should contain srs name", kmlHull.contains("Data name=\"srsName\""));
assertTrue("KML hull should contain epsg id", kmlHull.contains("<value>EPSG:"));
assertTrue("KML hull should contain coordinates", kmlHull.contains("<coordinates>"));
assertTrue(kmlHull.contains("Data name=\"project\""), "KML hull should contain project name");
assertTrue(kmlHull.contains("Data name=\"srsName\""), "KML hull should contain srs name");
assertTrue(kmlHull.contains("<value>EPSG:"), "KML hull should contain epsg id");
assertTrue(kmlHull.contains("<coordinates>"), "KML hull should contain coordinates");
hullCount.getAndIncrement();
});
assertTrue("At least " + minHullCount + " citygmls should be present in repository", gmlCount >= minHullCount);
assertTrue("At least " + minHullCount + " hulls should have been calculated", hullCount.get() >= minHullCount);
assertTrue(gmlCount >= minHullCount, "At least " + minHullCount + " citygmls should be present in repository");
assertTrue(hullCount.get() >= minHullCount, "At least " + minHullCount + " hulls should have been calculated");
}
}
package eu.simstadt.regionchooser;
import static org.junit.Assert.assertEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertThrows;
import java.io.IOException;
import java.nio.file.Path;
import java.nio.file.Paths;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import eu.simstadt.geo.RegionChooserUtils;
......@@ -13,17 +14,19 @@
private Path repo = Paths.get("src/test/resources/testdata");
private void testExtractCSRNameFromHeader(Path citygmlPath, String crsName) throws IOException {
assertEquals(crsName, RegionChooserUtils.crsFromCityGMLHeader(citygmlPath).toString());
assertEquals(RegionChooserUtils.crsFromCityGMLHeader(citygmlPath).toString(), crsName);
}
@Test
public void testExtractCRSFromStuttgart() throws IOException {
testExtractCSRNameFromHeader(repo.resolve("Stuttgart.proj/Stuttgart_LOD0_LOD1_buildings_and_trees.gml"), "EPSG:31463");
testExtractCSRNameFromHeader(repo.resolve("Stuttgart.proj/Stuttgart_LOD0_LOD1_buildings_and_trees.gml"),
"EPSG:31463");
}
@Test
public void testExtractCRSFromGruenbuehl() throws IOException {
testExtractCSRNameFromHeader(repo.resolve("Gruenbuehl.proj/20140218_Gruenbuehl_LOD2_1building.gml"), "EPSG:31467");
testExtractCSRNameFromHeader(repo.resolve("Gruenbuehl.proj/20140218_Gruenbuehl_LOD2_1building.gml"),
"EPSG:31467");
}
@Test
......@@ -46,9 +49,11 @@ public void testExtractCRSFromValladolid() throws IOException {
testExtractCSRNameFromHeader(repo.resolve("Others.proj/Valladolid_Spain_only_header.gml"), "EPSG:25830");
}
@Test(expected = IllegalArgumentException.class)
@Test
public void testDontExtractCRSFromBrokenCityGML() throws IOException {
Path citygmlPath = repo.resolve("Others.proj/SimpleSolid_MSBS.gml");
testExtractCSRNameFromHeader(citygmlPath, "Nothing found. Should throw an exception");
assertThrows(IllegalArgumentException.class, () -> {
testExtractCSRNameFromHeader(citygmlPath, "Nothing found. Should throw an exception");
});
}
}
package eu.simstadt.regionchooser;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.junit.Test;
import org.junit.jupiter.api.Test;
public class RegionExtractorTests
......@@ -37,19 +37,19 @@ public void testExtract3BuildingsFromGSK3Model() throws Throwable {
Path citygmlPath = TEST_REPOSITORY.resolve("Gruenbuehl.proj/20140218_Gruenbuehl_LOD2.gml");
String churchGMLString = RegionExtractor.selectRegionDirectlyFromCityGML(citygmlPath, wktPolygon, "EPSG:31467")
.toString();
assertEquals(countRegexMatches(churchGMLString, CITY_OBJECT_MEMBER_REGEX), 3);
assertEquals(3, countRegexMatches(churchGMLString, CITY_OBJECT_MEMBER_REGEX));
assertTrue(churchGMLString.contains("Donaustr"));
assertTrue(churchGMLString.contains("DEBW_LOD2_203056"));
assertTrue(churchGMLString.contains("DEBW_LOD2_2869"));
assertTrue(churchGMLString.contains("DEBW_LOD2_2909"));
assertTrue(churchGMLString.contains(CORE_CITY_MODEL_HEADER));
assertTrue(churchGMLString.contains(CORE_CITY_MODEL_FOOTER));
assertTrue("The exported CityGML should contain a new envelope with the correct EPSG", churchGMLString
.contains("<gml:Envelope srsName=\"EPSG:31467\" srsDimension=\"3\">"));
assertTrue("The exported CityGML should contain a new envelope", churchGMLString
.contains("<gml:lowerCorner>3515829.0815150724 5415766.204935087 "));
assertTrue("The exported CityGML should contain a new envelope", churchGMLString
.contains("<gml:upperCorner>3515876.489172751 5415823.108586172 "));
assertTrue(churchGMLString.contains("<gml:Envelope srsName=\"EPSG:31467\" srsDimension=\"3\">"),
"The exported CityGML should contain a new envelope with the correct EPSG");
assertTrue(churchGMLString.contains("<gml:lowerCorner>3515829.0815150724 5415766.204935087 "),
"The exported CityGML should contain a new envelope");
assertTrue(churchGMLString.contains("<gml:upperCorner>3515876.489172751 5415823.108586172 "),
"The exported CityGML should contain a new envelope");
}
@Test
......@@ -65,10 +65,10 @@ public void testExtractBuildingsWithoutCommentsInBetween() throws Throwable {
assertTrue(archGMLString.contains("uuid_0985cebb-922d-4b3e-95e5-15dc6089cd28"));
assertTrue(archGMLString.contains(CITY_MODEL_HEADER));
assertTrue(archGMLString.contains(CITY_MODEL_FOOTER));
assertFalse("Comments between buildings shouldn't be extracted",
archGMLString.contains("comment between buildings")); // Comment
assertFalse("Comments after buildings shouldn't be extracted",
archGMLString.contains("comment after last building")); // Comment
assertFalse(archGMLString.contains("comment between buildings"),
"Comments between buildings shouldn't be extracted");
assertFalse(archGMLString.contains("comment after last building"),
"Comments after buildings shouldn't be extracted");
}
@Test
......@@ -77,18 +77,22 @@ public void testExtractBuildingsAndChangeEnvelope() throws Throwable {
Path citygmlPath = TEST_REPOSITORY.resolve("NewYork.proj/FamilyCourt_LOD2_with_PLUTO_attributes.gml");
String familyCourtBuilding = RegionExtractor
.selectRegionDirectlyFromCityGML(citygmlPath, wktPolygon, EPSG_32118).toString();
assertEquals(countRegexMatches(familyCourtBuilding, CITY_OBJECT_MEMBER_REGEX), 1);
assertEquals(1, countRegexMatches(familyCourtBuilding, CITY_OBJECT_MEMBER_REGEX));
assertTrue(familyCourtBuilding.contains("Bldg_12210021066"));
assertFalse("The exported CityGML shouldn't contain the original envelope", familyCourtBuilding
.contains("<gml:lowerCorner>298393.46959639067 59277.34021543693 -11.892070104139751</gml:lowerCorner>"));
assertFalse("The exported CityGML shouldn't contain the original envelope", familyCourtBuilding
.contains("<gml:upperCorner>305641.79529639013 67101.44881543722 547.7591871983744</gml:upperCorner>"));
assertTrue("The exported CityGML should contain a new envelope with the original altitudes", familyCourtBuilding
.contains("<gml:lowerCorner>299721.46983062755 61021.99295737501 -11.89"));
assertTrue("The exported CityGML should contain a new envelope with the original altitudes", familyCourtBuilding
.contains("<gml:upperCorner>299823.9079725632 61122.68126771413 547.75"));
assertTrue("The exported CityGML should contain a new envelope with the correct EPSG", familyCourtBuilding
.contains("<gml:Envelope srsName=\"EPSG:32118\" srsDimension=\"3\">"));
assertFalse(
familyCourtBuilding.contains(
"<gml:lowerCorner>298393.46959639067 59277.34021543693 -11.892070104139751</gml:lowerCorner>"),
"The exported CityGML shouldn't contain the original envelope");
assertFalse(
familyCourtBuilding.contains(
"<gml:upperCorner>305641.79529639013 67101.44881543722 547.7591871983744</gml:upperCorner>"),
"The exported CityGML shouldn't contain the original envelope");
assertTrue(familyCourtBuilding.contains("<gml:lowerCorner>299721.46983062755 61021.99295737501 -11.89"),
"The exported CityGML should contain a new envelope with the original altitudes");
assertTrue(familyCourtBuilding.contains("<gml:upperCorner>299823.9079725632 61122.68126771413 547.75"),
"The exported CityGML should contain a new envelope with the original altitudes");
assertTrue(familyCourtBuilding.contains("<gml:Envelope srsName=\"EPSG:32118\" srsDimension=\"3\">"),
"The exported CityGML should contain a new envelope with the correct EPSG");
}
@Test
......@@ -98,7 +102,7 @@ public void testExtract0BuildingsWithWrongCoordinates() throws Throwable {
Path citygmlPath = TEST_REPOSITORY.resolve("NewYork.proj/ManhattanSmall.gml");
String emptyGMLString = RegionExtractor.selectRegionDirectlyFromCityGML(citygmlPath, wktPolygon, EPSG_32118)
.toString();
assertEquals(countRegexMatches(emptyGMLString, CITY_OBJECT_MEMBER_REGEX), 0);
assertEquals(0, countRegexMatches(emptyGMLString, CITY_OBJECT_MEMBER_REGEX));
assertTrue(emptyGMLString.contains(CITY_MODEL_HEADER));
assertTrue(emptyGMLString.contains(CITY_MODEL_FOOTER));
}
......@@ -110,7 +114,7 @@ public void testExtract0BuildingsFromEmptyGML() throws Throwable {
Path citygmlPath = TEST_REPOSITORY.resolve("NewYork.proj/empty_model.gml");
String emptyGMLString = RegionExtractor.selectRegionDirectlyFromCityGML(citygmlPath, wktPolygon, EPSG_32118)
.toString();
assertEquals(countRegexMatches(emptyGMLString, CITY_OBJECT_MEMBER_REGEX), 0);
assertEquals(0, countRegexMatches(emptyGMLString, CITY_OBJECT_MEMBER_REGEX));
assertTrue(emptyGMLString.contains(CORE_CITY_MODEL_HEADER));
assertTrue(emptyGMLString.contains(CORE_CITY_MODEL_FOOTER));
}
......@@ -122,7 +126,7 @@ public void testExtract0BuildingsFromWeirdGML() throws Throwable {
Path citygmlPath = TEST_REPOSITORY.resolve("NewYork.proj/broken_nyc_lod2.gml");
String emptyGMLString = RegionExtractor.selectRegionDirectlyFromCityGML(citygmlPath, wktPolygon, EPSG_32118)
.toString();
assertEquals(countRegexMatches(emptyGMLString, CITY_OBJECT_MEMBER_REGEX), 0);
assertEquals(0, countRegexMatches(emptyGMLString, CITY_OBJECT_MEMBER_REGEX));
assertTrue(emptyGMLString.contains(CORE_CITY_MODEL_HEADER));
assertTrue(emptyGMLString.contains(CORE_CITY_MODEL_FOOTER));
}
......@@ -133,6 +137,6 @@ public void testExtractBuildingsFromCitygmlWithoutZinEnvelope() throws Throwable
Path citygmlPath = TEST_REPOSITORY.resolve("Stuttgart.proj/Stuttgart_LOD0_LOD1_small.gml");
String emptyGMLString = RegionExtractor.selectRegionDirectlyFromCityGML(citygmlPath, wktPolygon, "EPSG:31463")
.toString();
assertEquals(countRegexMatches(emptyGMLString, "<bldg:Building gml:id"), 2);
assertEquals(2, countRegexMatches(emptyGMLString, "<bldg:Building gml:id"));
}
}
package eu.simstadt.regionchooser;
import static org.junit.Assert.assertTrue;
import static org.junit.jupiter.api.Assertions.assertTrue;
import java.io.IOException;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Arrays;
import java.util.stream.Collectors;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.locationtech.jts.geom.Polygon;
import org.locationtech.jts.io.ParseException;
import org.locationtech.jts.io.WKTReader;
......@@ -36,8 +36,8 @@ public void testExtractRegionWithLocalCRS()
CoordinateReferenceSystem localCRS = RegionChooserUtils.crsFromCityGMLHeader(citygmlPath);
StringBuilder sb = RegionExtractor.selectRegionDirectlyFromCityGML(citygmlPath, wktPolygon, localCRS.getName());
assertTrue("One weird shaped roof should be inside the region",
sb.toString().contains("gml_ZVHMQQ6BZGRT0O3Q6RGXF12BDOV49QIZ58XB"));
assertTrue(sb.toString().contains("gml_ZVHMQQ6BZGRT0O3Q6RGXF12BDOV49QIZ58XB"),
"One weird shaped roof should be inside the region");
}
//NOTE: This test can be adapted to download a region which is too large for the server. Here with WGS84 coordinates
......@@ -52,11 +52,12 @@ public void testExtractRegionWithWGS84()
Polygon wgs84Polygon = (Polygon) WKT_READER.read(wgs84WktPolygon);
CoordinateReferenceSystem localCRS = RegionChooserUtils.crsFromCityGMLHeader(citygmlPath);
String localWktPolygon = WKT_WRITER.write(RegionChooserUtils.changePolygonCRS(wgs84Polygon, RegionChooserUtils.WGS84, localCRS));
String localWktPolygon = WKT_WRITER
.write(RegionChooserUtils.changePolygonCRS(wgs84Polygon, RegionChooserUtils.WGS84, localCRS));
StringBuilder sb = RegionExtractor.selectRegionDirectlyFromCityGML(citygmlPath, localWktPolygon,
localCRS.getName());
assertTrue("One weird shaped roof should be inside the region",
sb.toString().contains("gml_ZVHMQQ6BZGRT0O3Q6RGXF12BDOV49QIZ58XB"));
assertTrue(sb.toString().contains("gml_ZVHMQQ6BZGRT0O3Q6RGXF12BDOV49QIZ58XB"),
"One weird shaped roof should be inside the region");
}
//NOTE: This test can be adapted to download a region which is too large for the server. Here with old coordinates from WebSimstadt
......@@ -100,12 +101,13 @@ public void testExtractRegionWithOldCoordinates()
Polygon wgs84Polygon = (Polygon) WKT_READER.read(wgs84WktPolygon);
CoordinateReferenceSystem localCRS = RegionChooserUtils.crsFromCityGMLHeader(citygmlPath);
String localWktPolygon = WKT_WRITER.write(RegionChooserUtils.changePolygonCRS(wgs84Polygon, RegionChooserUtils.WGS84, localCRS));
String localWktPolygon = WKT_WRITER
.write(RegionChooserUtils.changePolygonCRS(wgs84Polygon, RegionChooserUtils.WGS84, localCRS));
StringBuilder sb = RegionExtractor.selectRegionDirectlyFromCityGML(citygmlPath, localWktPolygon,
localCRS.getName());
assertTrue("One weird shaped roof should be inside the region",
sb.toString().contains("gml_ZVHMQQ6BZGRT0O3Q6RGXF12BDOV49QIZ58XB"));
assertTrue(sb.toString().contains("gml_ZVHMQQ6BZGRT0O3Q6RGXF12BDOV49QIZ58XB"),
"One weird shaped roof should be inside the region");
}
//TODO: Write a method to merge RegionChooser results from multiple gmls
......
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