Commit 8bafe709 authored by Matthias Betz's avatar Matthias Betz
Browse files

Added citygml4j quality ade integration

Removed produce consumer from stream reading
Added -out parameter to validation streams for writing quality ade stuff
parent b0bdd91b
Pipeline #1910 failed with stage
in 38 seconds
......@@ -34,6 +34,10 @@ public class TypeFilter implements Filter {
public TypeFilter(FeatureType type) {
this.type = type;
}
public FeatureType getType() {
return type;
}
@Override
public boolean matches(CityObject co) {
......
......@@ -29,9 +29,7 @@ import de.hft.stuttgart.citydoctor2.check.CheckError;
import de.hft.stuttgart.citydoctor2.check.CheckId;
import de.hft.stuttgart.citydoctor2.check.CheckResult;
import de.hft.stuttgart.citydoctor2.check.CheckType;
import de.hft.stuttgart.citydoctor2.check.DefaultParameter;
import de.hft.stuttgart.citydoctor2.check.ResultStatus;
import de.hft.stuttgart.citydoctor2.check.Unit;
import de.hft.stuttgart.citydoctor2.check.error.PolygonInteriorDisconnectedError;
import de.hft.stuttgart.citydoctor2.datastructure.LinearRing;
import de.hft.stuttgart.citydoctor2.datastructure.Polygon;
......@@ -42,10 +40,9 @@ import de.hft.stuttgart.citydoctor2.parser.ParserConfiguration;
public class InteriorDisconnectedCheck extends Check {
private static final String EPSILON_NAME = "Epsilon";
private static final String EPSILON_NAME = "minVertexDistance";
private static final List<CheckId> dependencies;
private static final List<DefaultParameter> defaultParameters;
static {
ArrayList<CheckId> deps = new ArrayList<>();
......@@ -55,10 +52,6 @@ public class InteriorDisconnectedCheck extends Check {
deps.add(CheckId.C_GE_P_INTERSECTING_RINGS);
deps.add(CheckId.C_GE_P_NON_PLANAR);
dependencies = Collections.unmodifiableList(deps);
ArrayList<DefaultParameter> defaultParameter = new ArrayList<>();
defaultParameter.add(new DefaultParameter(EPSILON_NAME, "0.0001", Unit.METER));
defaultParameters = Collections.unmodifiableList(defaultParameter);
}
private double epsilon = 0.0001;
......@@ -160,11 +153,6 @@ public class InteriorDisconnectedCheck extends Check {
}
}
@Override
public List<DefaultParameter> getDefaultParameter() {
return defaultParameters;
}
@Override
public List<CheckId> getDependencies() {
return dependencies;
......
......@@ -24,7 +24,11 @@ import static org.junit.Assert.assertTrue;
import java.io.File;
import java.io.IOException;
import org.citygml4j.builder.jaxb.CityGMLBuilderException;
import org.citygml4j.xml.io.writer.CityGMLWriteException;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
import de.hft.stuttgart.citydoctor2.CityDoctorValidation;
import de.hft.stuttgart.citydoctor2.datastructure.Building;
......@@ -40,6 +44,9 @@ import de.hft.stuttgart.citydoctor2.parser.InvalidGmlFileException;
*/
public class CheckerTest {
@Rule
public TemporaryFolder folder = new TemporaryFolder();
@Test
public void testSchematron() throws CityGmlParseException, InvalidGmlFileException {
ValidationConfiguration config = ValidationConfiguration.loadStandardValidationConfig();
......@@ -62,41 +69,54 @@ public class CheckerTest {
}
@Test
public void testChecker() throws CityGmlParseException, IOException, InterruptedException, InvalidGmlFileException {
String[] args = new String[6];
args[0] = "-in";
args[1] = "src/test/resources/QA-CS-CONCOMP.gml";
args[2] = "-xmlReport";
args[3] = "test.xml";
args[4] = "-pdfReport";
args[5] = "test.pdf";
CityDoctorValidation.main(args);
File f = new File("test.xml");
assertTrue(f.exists());
f.delete();
File f2 = new File("test.pdf");
assertTrue(f2.exists());
f2.delete();
public void testChecker() throws CityGmlParseException, IOException, InvalidGmlFileException,
CityGMLBuilderException, CityGMLWriteException {
File f = folder.newFile();
File f2 = folder.newFile();
try {
String[] args = new String[6];
args[0] = "-in";
args[1] = "src/test/resources/QA-CS-CONCOMP.gml";
args[2] = "-xmlReport";
args[3] = f.getAbsolutePath();
args[4] = "-pdfReport";
args[5] = f2.getAbsolutePath();
CityDoctorValidation.main(args);
assertTrue(f.exists());
assertTrue(f2.exists());
} finally {
f.delete();
f2.delete();
}
}
@Test
public void testStreaming()
throws CityGmlParseException, IOException, InterruptedException, InvalidGmlFileException {
String[] args = new String[8];
args[0] = "-in";
args[1] = "src/test/resources/testarea.gml";
args[2] = "-config";
args[3] = "src/test/resources/testConfigWithStreaming.yml";
args[4] = "-pdfReport";
args[5] = "test.pdf";
args[6] = "-xmlReport";
args[7] = "test.xml";
CityDoctorValidation.main(args);
File f = new File("test.pdf");
assertTrue(f.exists());
f.delete();
File f2 = new File("test.xml");
assertTrue(f2.exists());
f2.delete();
public void testStreaming() throws CityGmlParseException, IOException, InvalidGmlFileException,
CityGMLBuilderException, CityGMLWriteException {
File f = folder.newFile();
File f2 = folder.newFile();
File f3 = folder.newFile();
try {
String[] args = new String[10];
args[0] = "-in";
args[1] = "src/test/resources/testarea.gml";
args[2] = "-config";
args[3] = "src/test/resources/testConfigWithStreaming.yml";
args[4] = "-pdfReport";
args[5] = f.getAbsolutePath();
args[6] = "-xmlReport";
args[7] = f2.getAbsolutePath();
args[8] = "-out";
args[9] = f3.getAbsolutePath();
CityDoctorValidation.main(args);
assertTrue(f.exists());
assertTrue(f2.exists());
assertTrue(f3.exists());
} finally {
f.delete();
f2.delete();
f3.delete();
}
}
}
......@@ -13,6 +13,8 @@ cd CityDoctorParent
mvn install
```
Needs the citygml4j quality ade plugin from [here](https://transfer.hft-stuttgart.de/gitlab/betzms/qualityade). Install the plugin first, then build CityDoctor2
## Usage
Once built there is a CityDoctorValidation-\<version\>.zip file in the target folder of the CityDoctorValidation folder in which the CityDoctorValidation jar can be used to start the program.
......
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