Commit 2a68a8f0 authored by Matthias Betz's avatar Matthias Betz
Browse files

fixing test with different minVertexDistance parameter

parent f8ac427e
Pipeline #1343 passed with stage
in 2 minutes and 36 seconds
......@@ -115,6 +115,9 @@ public class BoundingBoxCalculator {
private static void findMinMax(Vector3d low, Vector3d high, CityObject co) {
for (Geometry geom : co.getGeometries()) {
if (geom.getVertices() == null) {
continue;
}
for (Vertex v : geom.getVertices()) {
if (v.getX() < low.getX()) {
low.setX(v.getX());
......
......@@ -21,8 +21,6 @@ package de.hft.stuttgart.citydoctor2.systemtest;
import static org.junit.Assert.assertEquals;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import org.junit.Test;
......@@ -35,9 +33,9 @@ import de.hft.stuttgart.citydoctor2.datastructure.CityDoctorModel;
import de.hft.stuttgart.citydoctor2.datastructure.LinearRing;
import de.hft.stuttgart.citydoctor2.datastructure.Polygon;
import de.hft.stuttgart.citydoctor2.parser.CityGmlParseException;
import de.hft.stuttgart.citydoctor2.parser.ParserConfiguration;
import de.hft.stuttgart.citydoctor2.parser.CityGmlParser;
import de.hft.stuttgart.citydoctor2.parser.InvalidGmlFileException;
import de.hft.stuttgart.citydoctor2.parser.ParserConfiguration;
/**
*
......@@ -122,11 +120,7 @@ public class RingSelfIntersectionTest {
@Test
public void testSelfIntPoints6() throws CityGmlParseException, IOException, InvalidGmlFileException {
Map<String, String> param = new HashMap<>();
param.put("minVertexDistance", "0.1");
Map<CheckId, Map<String, String>> params = new HashMap<>();
params.put(CheckId.C_GE_R_SELF_INTERSECTION, param);
CityDoctorModel c = TestUtil.loadAndCheckCityModel("src/test/resources/SimpleSolid_SrefBS-GE-gml-LR-0004-T0005.gml", params);
CityDoctorModel c = TestUtil.loadAndCheckCityModel("src/test/resources/SimpleSolid_SrefBS-GE-gml-LR-0004-T0005.gml", 8, 0.1);
Polygon p = TestUtil.getPolygonById("_Simple_BD.1_PG.2", c);
LinearRing r = p.getExteriorRing();
CheckResult cr = r.getCheckResult(CheckId.C_GE_R_SELF_INTERSECTION);
......
......@@ -60,6 +60,18 @@ public class TestUtil {
}
public static CityDoctorModel loadAndCheckCityModel(String path, int numberOfRoundingPlaces, double minVertexDistance)
throws CityGmlParseException, IOException, InvalidGmlFileException {
ValidationConfiguration config = ValidationConfiguration.loadStandardValidationConfig();
config.setNumberOfRoundingPlaces(numberOfRoundingPlaces);
config.setMinVertexDistance(minVertexDistance);
CityDoctorModel m = CityGmlParser.parseCityGmlFile(path, config.getParserConfiguration());
Checker c = new Checker(config, m);
c.runChecks();
return m;
}
public static CityDoctorModel loadAndCheckCityModel(String path, Map<CheckId, Map<String, String>> paramMap)
throws CityGmlParseException, IOException, InvalidGmlFileException {
ValidationConfiguration valConfig = ValidationConfiguration.loadStandardValidationConfig();
......
Supports Markdown
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