Commit 5571f382 authored by Luna Riegel's avatar Luna Riegel
Browse files

Merge branch 'dev' into 'master'

CityDoctor Version 3.18.0

See merge request !37
parents 87dba3fa 61859d4f
Pipeline #12247 passed with stage
in 2 minutes and 31 seconds
package de.hft.stuttgart.citydoctor2.utils;
import de.hft.stuttgart.citydoctor2.datastructure.CityDoctorModel;
import de.hft.stuttgart.citydoctor2.zip.CityGmlZipArchive;
import de.hft.stuttgart.citydoctor2.zip.CityGmlZipEntry;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.FilenameUtils;
import org.apache.commons.io.IOUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import java.io.*;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;
public class ArchivePacker {
private static final Logger logger = LogManager.getLogger(ArchivePacker.class);
private ArchivePacker(){}
public static void packArchive(String targetPath, CityGmlZipArchive archive){
Path outputPath = Path.of(targetPath);
outputPath = outputPath.getParent().resolve(
FilenameUtils.removeExtension(outputPath.getFileName().toString()) + ".zip");
Path tmpDir = null;
try{
tmpDir = Files.createTempDirectory("zipTmp");
tmpDir.toFile().deleteOnExit();
for (CityGmlZipEntry entry : archive.getEntries()) {
if (entry.getErrorType() != null || !entry.isLoaded()) {
continue;
}
CityDoctorModel model = entry.getModel();
Path filePath = tmpDir.resolve(entry.getEntrySubPath());
Files.createDirectories(filePath.getParent());
model.saveAs(filePath.toString(), model.isValidated());
}
zipFolder(tmpDir.toFile(), outputPath.toFile());
}catch (Exception e){
logger.error(e);
} finally {
if (tmpDir != null) {
try {
FileUtils.deleteDirectory(tmpDir.toFile());
} catch (IOException e) {
logger.error(e);
}
}
}
}
public static void zipFolder(File folder, File zipFile) throws IOException {
zipFolder(folder, new FileOutputStream(zipFile));
}
public static void zipFolder(File folder, OutputStream outputStream) throws IOException {
try (ZipOutputStream zipOutputStream = new ZipOutputStream(outputStream)) {
processFolder(folder, zipOutputStream, folder.getPath().length() + 1);
}
}
private static void processFolder(File folder, ZipOutputStream zipOutputStream, int prefixLength)
throws IOException {
for (File file : folder.listFiles()) {
if (file.isFile()) {
ZipEntry zipEntry = new ZipEntry(file.getPath().substring(prefixLength));
zipOutputStream.putNextEntry(zipEntry);
try (FileInputStream inputStream = new FileInputStream(file)) {
IOUtils.copy(inputStream, zipOutputStream);
}
zipOutputStream.closeEntry();
} else if (file.isDirectory()) {
processFolder(file, zipOutputStream, prefixLength);
}
}
}
public static void packAndDeleteDirectory(String directoryPath) throws IOException {
Path sourcePath = Path.of(directoryPath);
if (!Files.exists(sourcePath)) {
throw new IllegalStateException("Directory " + directoryPath + " does not exist");
}
if (!Files.isDirectory(sourcePath)) {
throw new IllegalStateException("Path " + directoryPath + " is not a directory");
}
Path outputPath = sourcePath.getParent().resolve(sourcePath.getFileName() + ".zip");
zipFolder(sourcePath.toFile(), outputPath.toFile());
FileUtils.deleteDirectory(sourcePath.toFile());
}
}
......@@ -26,12 +26,10 @@ import de.hft.stuttgart.citydoctor2.datastructure.CityDoctorModel;
import de.hft.stuttgart.citydoctor2.datastructure.CityObject;
import de.hft.stuttgart.citydoctor2.datastructure.Geometry;
import de.hft.stuttgart.citydoctor2.datastructure.Polygon;
import de.hft.stuttgart.citydoctor2.datastructure.TopLevelTransportFeature;
import de.hft.stuttgart.citydoctor2.datastructure.TrafficSpaceObject;
import de.hft.stuttgart.citydoctor2.datastructure.TransportationObject;
import de.hft.stuttgart.citydoctor2.datastructure.TransportationSpace;
import de.hft.stuttgart.citydoctor2.datastructure.Vertex;
import de.hft.stuttgart.citydoctor2.math.Vector3d;
import de.hft.stuttgart.citydoctor2.utils.visitors.CityObjectCollector;
import de.hft.stuttgart.citydoctor2.utils.visitors.MinMaxExtentVisitor;
/**
* Utility class for calculating axis aligned bounding boxes for different
......@@ -99,24 +97,10 @@ public class BoundingBoxCalculator {
* @return the bounding box of the model
*/
public static BoundingBox calculateBoundingBox(CityDoctorModel model) {
Vector3d low = new Vector3d(Double.MAX_VALUE, Double.MAX_VALUE, Double.MAX_VALUE);
Vector3d high = new Vector3d(Double.NEGATIVE_INFINITY, Double.NEGATIVE_INFINITY, Double.NEGATIVE_INFINITY);
MinMaxExtentVisitor mima = new MinMaxExtentVisitor();
model.accept(mima);
//TODO: Rework this using visitors
findMinMax(low, high, model.getBuildings());
findMinMax(low, high, model.getBridges());
findMinMax(low, high, model.getLand());
findMinMaxTransport(low, high, model.getTransportation());
findMinMax(low, high, model.getWater());
findMinMax(low, high, model.getVegetation());
findMinMax(low, high, model.getTunnels());
findMinMax(low, high, model.getCityFurniture());
findMinMax(low, high, model.getGenericCityObjects());
Vector3d[] result = new Vector3d[2];
result[0] = low;
result[1] = high;
return BoundingBox.of(result);
return BoundingBox.of(mima.getMinMaxExtent());
}
public static BoundingBox calculateBoundingBoxFromPoints(List<? extends Vector3d> points) {
......@@ -159,28 +143,21 @@ public class BoundingBoxCalculator {
}
}
//TODO: Implement this properly with visitor. Quick and dirty fix for the renderer
private static void findMinMaxTransport(Vector3d low, Vector3d high, List<? extends TransportationObject> features) {
for (TransportationObject to : features) {
findMinMax(low, high, to);
if (to instanceof TransportationSpace ts) {
findMinMaxTransport(low, high, ts.getTrafficSpaces());
findMinMaxTransport(low, high, ts.getAuxTrafficSpaces());
if (to instanceof TopLevelTransportFeature top) {
findMinMaxTransport(low, high, top.getSections());
findMinMaxTransport(low, high, top.getIntersections());
}
} else if (to instanceof TrafficSpaceObject tso) {
findMinMaxTransport(low, high, tso.getTrafficAreas());
}
}
}
private static void findMinMax(Vector3d low, Vector3d high, CityObject co) {
for (Geometry geom : co.getGeometries()) {
CityObjectCollector collector = new CityObjectCollector();
co.accept(collector);
for (CityObject object : collector.getCityObjects()) {
for (Geometry geom : object.getGeometries()) {
if (geom.getVertices() == null) {
geom.updateVertices();
}
findMinMax(low, high, geom);
}
}
}
private static void findMinMax(Vector3d low, Vector3d high, Geometry geom) {
for (Vertex v : geom.getVertices()) {
if (v.getX() < low.getX()) {
low.setX(v.getX());
......@@ -202,6 +179,5 @@ public class BoundingBoxCalculator {
}
}
}
}
}
package de.hft.stuttgart.citydoctor2.utils;
import java.text.ChoiceFormat;
public final class TimeFormatter {
private TimeFormatter(){}
private static final String LESS_THAN_A_SECOND =
Localization.getText("TimeFormatter.lessThanASecond");
private static final ChoiceFormat SECONDS =
new ChoiceFormat(
new double[]{1, 2},
new String[]{Localization.getText("TimeFormatter.oneSecond"),
Localization.getText("TimeFormatter.seconds")}
);
private static final ChoiceFormat MINUTES =
new ChoiceFormat(
new double[]{1, 2},
new String[]{Localization.getText("TimeFormatter.oneMinute"),
Localization.getText("TimeFormatter.minutes")}
);
private static final ChoiceFormat HOURS =
new ChoiceFormat(
new double[] {1, 2},
new String[]{Localization.getText("TimeFormatter.oneHour"),
Localization.getText("TimeFormatter.hours")}
);
/**
* Formats a time measurement in milliseconds as a localized String representation.
*
* <p>
* The String representation will return the time as a rounded down integer of the biggest fitting TimeUnit
* (seconds, minutes or hours), returning "< 1 second" for times under a second.
* <p/>
* @param millis
* @return A localized String representation of the timespan
*/
public static String format(long millis) {
if (millis < 1000) {
return LESS_THAN_A_SECOND;
}else if (millis < 60_000) {
long seconds = millis / 1000;
String pattern = SECONDS.format(seconds);
return pattern.replace("{0}", Long.toString(seconds));
}else if (millis < 3_600_000){
long minutes = millis / 60_000;
String pattern = MINUTES.format(minutes);
return pattern.replace("{0}", Long.toString(minutes));
} else {
long hours = millis / 3_600_000;
String pattern = HOURS.format(hours);
return pattern.replace("{0}", Long.toString(hours));
}
}
}
\ No newline at end of file
package de.hft.stuttgart.citydoctor2.utils.visitors;
import de.hft.stuttgart.citydoctor2.check.Checkable;
import de.hft.stuttgart.citydoctor2.check.CheckableUtilsVisitor;
import de.hft.stuttgart.citydoctor2.datastructure.CityObject;
import de.hft.stuttgart.citydoctor2.datastructure.Geometry;
import de.hft.stuttgart.citydoctor2.datastructure.ImplicitGeometryHolder;
import de.hft.stuttgart.citydoctor2.datastructure.Vertex;
import de.hft.stuttgart.citydoctor2.math.Vector3d;
public class MinMaxExtentVisitor extends CheckableUtilsVisitor {
Vector3d low;
Vector3d high;
public MinMaxExtentVisitor() {
low = new Vector3d(Double.POSITIVE_INFINITY, Double.POSITIVE_INFINITY, Double.POSITIVE_INFINITY);
high = new Vector3d(Double.NEGATIVE_INFINITY, Double.NEGATIVE_INFINITY, Double.NEGATIVE_INFINITY);
}
public Vector3d[] getMinMaxExtent() {
Vector3d[] result = new Vector3d[2];
result[0] = low;
result[1] = high;
return result;
}
@Override
public void check(CityObject co) {
for (Geometry geom : co.getGeometries()) {
if (geom.getVertices() == null) {
geom.updateVertices();
}
for (Vertex v : geom.getVertices()) {
if (v.getX() < low.getX()) {
low.setX(v.getX());
}
if (v.getX() > high.getX()) {
high.setX(v.getX());
}
if (v.getY() < low.getY()) {
low.setY(v.getY());
}
if (v.getY() > high.getY()) {
high.setY(v.getY());
}
if (v.getZ() < low.getZ()) {
low.setZ(v.getZ());
}
if (v.getZ() > high.getZ()) {
high.setZ(v.getZ());
}
}
}
}
}
......@@ -22,12 +22,12 @@ import java.io.File;
import java.time.ZonedDateTime;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import java.util.UUID;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.Stream;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
......@@ -92,7 +92,7 @@ public class CityGMLWriterUtils {
storeCityObjects(model.getTransportation(), gmlFactory, model, cModel, val);
storeCityObjects(model.getWater(), gmlFactory, model, cModel, val);
storeCityObjects(model.getCityFurniture(), gmlFactory, model, cModel, val);
storeCityObjects(model.getGenericCityObjects(), gmlFactory, model, cModel, val);
storeCityObjects(model.getOtherCityObjects(), gmlFactory, model, cModel, val);
storeCityObjects(model.getTunnels(), gmlFactory, model, cModel, val);
writer.write(cModel);
......@@ -135,12 +135,13 @@ public class CityGMLWriterUtils {
de.hft.stuttgart.quality.model.enums.ErrorId adeId = QualityADEUtils.mapErrorIdToAdeId(e.getKey());
if (adeId == null) {
// error that is not part of the ade standard
logger.warn("Found error {} that cannot be converted to ADE error. It will not be written", e.getKey());
logger.warn(Localization.getText("CityGmlWriterUtils.unknownADEError"), e.getKey());
continue;
}
stats.setName(adeId);
statistics.getErrors().add(new ErrorProperty(stats));
}
// TODO: Quality ADE update to CityGML 3.0
statistics.setNumErrorBuildings(new FeatureStatisticsProperty(countValidatedCityObjects(model.getBuildings())));
statistics.setNumErrorBridgeObjects(new FeatureStatisticsProperty(countValidatedCityObjects(model.getBridges())));
statistics.setNumErrorLandObjects(new FeatureStatisticsProperty(countValidatedCityObjects(model.getLand())));
......@@ -152,29 +153,30 @@ public class CityGMLWriterUtils {
return val;
}
private static FeatureStatistics countValidatedCityObjects(List<? extends CityObject> cos) {
int numChecked = 0;
int numError = 0;
for (CityObject co : cos) {
private static FeatureStatistics countValidatedCityObjects(Stream<? extends CityObject> cos) {
AtomicInteger numChecked = new AtomicInteger();
AtomicInteger numError = new AtomicInteger();
cos.forEach(co -> {
if (co.isValidated()) {
numChecked++;
numChecked.getAndIncrement();
if (co.containsAnyError()) {
numError++;
numError.getAndIncrement();
}
}
}
return new FeatureStatistics(numChecked, numError);
});
return new FeatureStatistics(numChecked.get(), numError.get());
}
private static void storeCityObjects(List<? extends CityObject> cos, GeometryFactory gmlFactory, CityDoctorModel model, CityModel cModel, Validation val) {
for (CityObject co : cos) {
private static void storeCityObjects(Stream<? extends CityObject> cos, GeometryFactory gmlFactory, CityDoctorModel model, CityModel cModel, Validation val) {
cos.forEach(co -> {
if (model.isValidated() && val != null) {
QualityADEUtils.writeQualityAde(co, val);
}
co.reCreateGeometries(gmlFactory, model.getParserConfig());
cModel.getCityObjectMembers().add(new AbstractCityObjectProperty(co.getGmlObject()));
}
});
}
}
package de.hft.stuttgart.citydoctor2.zip;
import de.hft.stuttgart.citydoctor2.parser.ParserConfiguration;
import de.hft.stuttgart.citydoctor2.utils.ArchivePacker;
import de.hft.stuttgart.citydoctor2.utils.Localization;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.Serial;
import java.io.Serializable;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.List;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;
import java.util.zip.ZipInputStream;
/**
* This class serves as a representation of a ZIP-archive containing CityGml files. The contained files are represented
* by {@link CityGmlZipEntry} objects.
*/
public class CityGmlZipArchive implements Serializable {
private static final Logger logger = LogManager.getLogger(CityGmlZipArchive.class);
@Serial
private static final long serialVersionUID = 2168389511043362615L;
private List<CityGmlZipEntry> entries;
private final Path archivePath;
private final String archiveNameRE;
/**
* Registers a ZIP-file as an archive. All contained XML and GML files will be registered as {@link CityGmlZipEntry} objects.
*
* @param zipFile path of the ZIP-file
* @return A {@link CityGmlZipArchive} object representing the archive, or null if read-access for the ZIP-file was denied
* @throws MalformedZipFileException if the ZIP-file has encoding errors
*/
public static CityGmlZipArchive register(String zipFile) throws MalformedZipFileException {
ArrayList<CityGmlZipEntry> archiveEntries = new ArrayList<>();
CityGmlZipArchive cgmlArchive = new CityGmlZipArchive(Path.of(zipFile));
try (ZipInputStream zis = new ZipInputStream(new FileInputStream(zipFile))) {
ZipEntry ze;
while ((ze = zis.getNextEntry()) != null) {
if (ze.isDirectory()) {
continue;
}
if (ze.getName().endsWith(".gml") || ze.getName().endsWith(".xml")) {
// Ignore report files generated by CityDoctor
if (ze.getName().endsWith("_report.xml")) {
continue;
}
archiveEntries.add(CityGmlZipEntry.register(ze, cgmlArchive));
}
}
cgmlArchive.setEntries(archiveEntries);
return cgmlArchive;
} catch (IOException e) {
logger.error(Localization.getText("CityGmlZipArchive.ioError"));
logger.debug(e.getMessage(), e);
return null;
} catch (IllegalArgumentException e) {
logger.error(Localization.getText("CityGmlZipArchive.malformedZipFile"));
throw new MalformedZipFileException(Localization.getText("CityGmlZipArchive.malformedZipFile"));
} catch (Exception e) {
logger.error(Localization.getText("CityGmlZipArchive.generalException"));
logger.debug(e.getMessage(), e);
throw (e);
}
}
/**
* Attempts to load all contained {@link CityGmlZipEntry} objects into memory.
*
* @param config Parser configuration for the entries
*/
public void mountArchive(ParserConfiguration config) {
try (ZipFile zip = new ZipFile(archivePath.toFile())) {
for (CityGmlZipEntry entry : entries) {
entry.loadEntry(config);
}
} catch (IOException e) {
logger.error(e);
}
}
private CityGmlZipArchive(Path archivePath) {
this.archivePath = archivePath;
this.archiveNameRE = archivePath.getFileName().toString().replace(".zip", "") + File.separator;
}
private void setEntries(List<CityGmlZipEntry> entries) {
this.entries = entries;
}
/**
* Saves this archive as a ZIP-file.
* @param path target path for the export
*/
public void exportToZipFile(String path) {
ArchivePacker.packArchive(path, this);
}
/**
* Gets an entry in this archive by its subpath.
*
* @param subpath subpath to the entry from this archive's root directory
* @return the corresponding entry, or null if entry could not be found
*/
public CityGmlZipEntry getEntry(String subpath) {
subpath = stripArchivePath(subpath);
for (CityGmlZipEntry entry : entries) {
String entryName = stripArchivePath(entry.getEntrySubPath());
if (entryName.equals(subpath)) {
return entry;
}
}
return null;
}
/**
* Strips the root directory name of this archive from an entry subpath.
* @param path the relative path to the entry
* @return String of the path without the root directory
*/
private String stripArchivePath(String path) {
Path systemPath = Path.of(path);
return systemPath.toString().replace(archiveNameRE, "");
}
/**
* Gets the path to the ZIP-file associated with this archive.
* @return path of the ZIP-file
*/
public Path getArchivePath() {
return archivePath;
}
/**
* Gets the entry list of this archive.
* @return the entry list
*/
public List<CityGmlZipEntry> getEntries() {
return entries;
}
}
package de.hft.stuttgart.citydoctor2.zip;
import de.hft.stuttgart.citydoctor2.datastructure.CityDoctorModel;
import de.hft.stuttgart.citydoctor2.parser.CityGmlParseException;
import de.hft.stuttgart.citydoctor2.parser.CityGmlParser;
import de.hft.stuttgart.citydoctor2.parser.InvalidGmlFileException;
import de.hft.stuttgart.citydoctor2.parser.ParserConfiguration;
import de.hft.stuttgart.citydoctor2.parser.ProgressListener;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import java.io.IOException;
import java.io.Serial;
import java.io.Serializable;
import java.nio.file.Path;
import java.util.zip.ZipEntry;
/**
* This class serves as a representation of a CityGml file in a ZIP archive.
* <p/>
* The {@link CityDoctorModel} of the associated file can only be accessed after loading the corresponding entry.
*/
public class CityGmlZipEntry implements Serializable {
private static final Logger logger = LogManager.getLogger(CityGmlZipEntry.class);
@Serial
private static final long serialVersionUID = -5732913269959043262L;
private final Path filePath;
private final String fileName;
private final String displayName;
private transient CityDoctorModel model;
private CityGmlZipArchive parentArchive;
private boolean inMemory;
private long fileSize = -1L;
private static final long MB = 1024 * 1024L;
private ZipEntryErrorType errorType = null;
/**
* Attempts to parse the CityGML model associated with this entry and loads it into memory.
* <p/>
* In the event of a parsing error, the entry will be flagged by assigning the appropriate
* {@link ZipEntryErrorType} to the errorType field.
*
* @param config Parser configuration for this model
*/
public void loadEntry(ParserConfiguration config) {
loadEntry(config, null);
}
/**
* Attempts to parse the CityGML model associated with this entry and loads it into memory.
* <p/>
* In the event of a parsing error, the entry will be flagged by assigning the appropriate
* {@link ZipEntryErrorType} to the errorType field.
*
* @param config Parser configuration for this model
* @param l ProgressListener for tracking parsing progress
*/
public void loadEntry(ParserConfiguration config, ProgressListener l) {
if (inMemory) {
return;
}
if (errorType != null) {
logger.warn("Tried loading erroneous CityGmlZipEntry");
return;
}
try {
this.model = CityGmlParser.parseCityGmlZipEntry(this, config, l);
this.inMemory = true;
} catch (CityGmlParseException | InvalidGmlFileException e) {
logger.error(e);
this.errorType = ZipEntryErrorType.INVALID_CITY_GML_FILE;
} catch (IOException e) {
logger.error(e);
this.errorType = ZipEntryErrorType.IO_ERROR;
}
}
/**
* Registers a {@link ZipEntry ZipEntry} in a ZIP-archive as a {@link CityGmlZipEntry}.
* <p/>
* If the filesize of the associated file exceeds the total available system memory, or read access is denied,
* the entry will be flagged by assigning the appropriate {@link ZipEntryErrorType} to the errorType field.
*
* @param entry The ZipEntry object
* @param parentArchive The parent archive for this entry
* @return A corresponding CityGmlZipEntry object
*/
public static CityGmlZipEntry register(ZipEntry entry, CityGmlZipArchive parentArchive) {
CityGmlZipEntry cgzEntry = new CityGmlZipEntry(entry, parentArchive, false);
try {
if (!cgzEntry.entrySizeWithinMemoryLimits()) {
cgzEntry.errorType = ZipEntryErrorType.EXCESSIVE_FILESIZE;
}
} catch (IOException e) {
logger.error(e);
cgzEntry.errorType = ZipEntryErrorType.IO_ERROR;
}
return cgzEntry;
}
/**
* Checks if the filesize of this entry would exceed the system's available memory.
*
* @return true if within limits, false otherwise
* @throws IOException if read access to the ZIP-archive is denied
*/
private boolean entrySizeWithinMemoryLimits() throws IOException {
long memoryLimit = (long) Math.ceil(((double) Runtime.getRuntime().maxMemory() / MB) * 0.9);
if (fileSize == -1L) {
try (CityGmlZipEntryFile entryFile = new CityGmlZipEntryFile(this)) {
long filesize = entryFile.getFileSize();
if (filesize != -1) {
this.fileSize = filesize;
} else {
return false;
}
} catch (Exception e) {
throw new IOException(e);
}
}
return memoryLimit > (fileSize / MB);
}
private CityGmlZipEntry(ZipEntry entry, CityGmlZipArchive parentArchive, boolean inMemory) {
this.fileName = entry.getName();
this.filePath = Path.of(entry.getName());
this.displayName = filePath.getFileName().toString();
if (entry.getSize() != -1) {
this.fileSize = entry.getSize();
}
this.model = null;
this.inMemory = inMemory;
this.parentArchive = parentArchive;
}
/**
* Gets the parent archive of this entry.
* @return the archive
*/
public CityGmlZipArchive getArchive() {
return parentArchive;
}
/**
* Gets the sub-path in the archive of the file associated with this entry.
*
* @return the relative sub-path from the archive root directory
*/
public String getEntrySubPath() {
return fileName;
}
/**
* Gets the name of the file associated with this entry.
* @return the filename
*/
public String getDisplayName() {
return displayName;
}
/**
* Gets the {@link ZipEntryErrorType} of this entry.
* @return the error type, or null if this entry is not erroneous
*/
public ZipEntryErrorType getErrorType() {
return errorType;
}
/**
* Gets the {@link CityDoctorModel} of this entry.
* @return The model, or null if the entry has not been loaded or is erroneous
*/
public CityDoctorModel getModel() {
return model;
}
public void setFileSize(long size) {
fileSize = size;
}
/**
* Resolves the reference path of a {@link de.hft.stuttgart.citydoctor2.datastructure.LibraryObject LibraryObject}
* in the {@link CityDoctorModel} of this entry.
* @param libraryObjectPath The reference path to the LibraryObject's CityGml file
* @return Relative sub-path within the archive to the CityGml file
*/
public Path resolveLibraryObjectPath(String libraryObjectPath) {
return filePath.getParent().resolve(libraryObjectPath);
}
/**
* Checks if the {@link CityDoctorModel} of this entry has been loaded into memory.
*
* @return true if it is loaded, false otherwise
*/
public boolean isLoaded() {
return inMemory;
}
/**
* Returns the estimated uncompressed filesize of this entry.
*
* @return filesize in bytes, -1L if filesize is unknown
*/
public long getFileSize() {
return fileSize;
}
}
package de.hft.stuttgart.citydoctor2.zip;
import java.io.BufferedInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;
/**
* This class serves as a resource for read-access to the file that is being represented by
* a CityGmlZipEntry object.
* <p/>
* Does not decompress the file or the parent ZIP-archive.
*/
public class CityGmlZipEntryFile implements AutoCloseable {
private final ZipFile zip;
private final ZipEntry zipEntry;
private final CityGmlZipEntry cgmlZipEntry;
private boolean closed = false;
/**
* Creates a {@link CityGmlZipEntryFile} for a {@link CityGmlZipEntry} object's referenced file.
*
* @param entry the requested entry
* @throws IOException if read access to the ZIP-archive is denied.
*/
public CityGmlZipEntryFile(CityGmlZipEntry entry) throws IOException {
CityGmlZipArchive archive = entry.getArchive();
zip = new ZipFile(archive.getArchivePath().toFile());
zipEntry = zip.getEntry(entry.getEntrySubPath());
this.cgmlZipEntry = entry;
}
/**
* Gets a new InputStream of this file.
* <p/>
* Returned streams are independent of each other, but will all be closed when the {@link CityGmlZipEntryFile} object
* is closed.
* @return an InputStream of this file.
* @throws IOException when this method is called after the file has been closed.
*/
public InputStream getInputStream() throws IOException {
if (closed){
throw new IOException("CityGmlZipEntryFile closed");
}
return zip.getInputStream(zipEntry);
}
/**
* Gets an estimation of this file's filesize.
* @return filesize in bytes, -1L if unknown
* @throws IOException when this method is called after the file has been closed.
*/
public long getFileSize() throws IOException {
if (closed){
throw new IOException("CityGmlZipEntryFile closed");
}
if (cgmlZipEntry.getFileSize() == -1L) {
if (zipEntry.getSize() == -1) {
long bytes = 0;
InputStream is = new BufferedInputStream(this.getInputStream());
for (int i = is.read(); i != -1; i = is.read()) {
bytes++;
}
cgmlZipEntry.setFileSize(bytes);
} else {
cgmlZipEntry.setFileSize(zipEntry.getSize());
}
}
return cgmlZipEntry.getFileSize();
}
@Override
public void close() throws IOException {
zip.close();
closed = true;
}
}
package de.hft.stuttgart.citydoctor2.zip;
import java.util.zip.ZipException;
/**
* Signals that a ZIP-file is corrupted and couldn't be parsed.
*/
public class MalformedZipFileException extends ZipException {
public MalformedZipFileException() {
super();
}
public MalformedZipFileException(String message) {
super(message);
}
}
package de.hft.stuttgart.citydoctor2.zip;
/**
* Error types for {@link CityGmlZipEntry} objects.
*/
public enum ZipEntryErrorType {
INVALID_CITY_GML_FILE, EXCESSIVE_FILESIZE, IO_ERROR
}
package de.hft.stuttgart.citydoctor2.zip;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
public class ZipParser {
private static final Logger logger = LogManager.getLogger(ZipParser.class);
}
CityDoctorValidation.Version=${versionString}
DistanceError.distanceFromPlane=distance from plane
AboutDialog.developedBy=Developed by
AboutDialog.closeBtn=Close
AboutDialog.contact=Contact
AboutDialog.developedBy=Developed by
AboutDialog.title=CityDoctor 3 - About
AboutDialog.closeBtn=Close
CheckDialog.title=Check Configuration
CheckDialog.schematronFiles=Schematron Files
CheckDialog.schematronChooserTitle=Choose schematron file..
CheckDialog.validationConfiguration=Validation Configuration
CheckDialog.startingChecks=Starting checks
CheckDialog.checksDone=Checks done
CheckDialog.failedChecks=Failed to execute checks
CheckDialog.schematronFileNotExisting=Schematron file does not exist, ignoring
CheckContainer.error=Unexpected exception while executing check: {}
CheckDialog.availableChecksLabel=Available Checks
CheckDialog.cancelBtn=Cancel
CheckDialog.checkBtn=Check
CheckDialog.checkEnabled=Enabled
CheckDialog.checkName=Name
CheckDialog.parameterValue=Value
CheckDialog.checksDone=Checks done
CheckDialog.checksReenabledAlert=Some checks have been reenabled so that other wanted checks can be executed\nSee the log for more information.
CheckDialog.checksTab=Checks
CheckDialog.failedChecks=Failed to execute checks
CheckDialog.filterTab=Filter
CheckDialog.geometricChecksLabel=Geometric Checks
CheckDialog.globalParametersLabel=Global Parameters
CheckDialog.noPathError=Output path is missing!
CheckDialog.outputPathBtn=Select
CheckDialog.outputPathLabel=Output directory (Required):
CheckDialog.parameterUnit=Unit
CheckDialog.parameterValue=Value
CheckDialog.pdfReportsOption=Create PDF reports
CheckDialog.schematronChooserTitle=Choose schematron file ...
CheckDialog.schematronFileLabel=Schematron File:
CheckDialog.schematronFileNotExisting=Schematron file does not exist, Schematron will be skipped
CheckDialog.schematronFiles=Schematron Files
CheckDialog.selectBtn=Select
CheckDialog.semanticChecksLabel=Semantic Checks
CheckDialog.startingChecks=Starting checks
CheckDialog.streamCheckLabel=Citymodels are not loaded and kept in memory. Check results are saved to the QualityADE in copies of the input files.
CheckDialog.streamCheckOption=Use low memory mode
CheckDialog.title=Check Configuration
CheckDialog.validationConfiguration=Validation Configuration
CheckDialog.xmlReportsOption=Create XML reports
Checker.checkFeature=Checking feature: {}
Checker.checksFinished=Finished executing checks. Total time: {0}
Checker.dbStillUnresponsive=Checker still unable to load some CityObjects from database!
Checker.dbUnresponsive=Checker could not load some CityObjects from database!
Checker.executeCheck=Executing check: {}
Checker.failPdf=Failed to write PDF Report.
Checker.failReports=Failed to write reports.
Checker.failXml=Failed to write XML Error Report.
Checker.finishedSchematron=Finished Schematron validation
Checker.futuresCheckFailures=Encountered check failures due to the following errors:
Checker.noCheckSatisfiesRequirement=Could not find any check that satisfies requirement {}, it will not be checked
Checker.schematronCompleted=Schematron completed
Checker.schematronFileNotFound=Schematron file {} could not be found
Checker.schematronInterrupted=Main Thread was interrupted while waiting for Schematron
Checker.schematronStillRunning=Schematron is still running. Waiting for completion, this may take some time
Checker.schematronValidation=Schematron-validation thread started
Checker.shutdownInterrupted=Main Thread got interrupted during ThreadPool shutdown
Checker.validationInterrupted=Validation aborted: Checker got interrupted
Checker.waitAndRetry=Waiting a second before retrying...
Checks.missingCheck=Could not find check for id: {}
CityDoctorController.exportSuccess=Successfully exported feature
CityDoctorController.noDatamodel=Datamodel is null, no checks could be done
CityDoctorController.noSourceFile=Source file is null, no checks could be done
CityDoctorController.noZipFile=ZIP archive is null, no checks could be done
CityDoctorController.exportSuccess=Successfully exported feature
CityDoctorController.saveZipArchiveReports=Successfully exported validation reports!
CityDoctorValidation.Version=${versionString}
CityDoctorValidation.inputFileNotExisting= Input file '{}' does not exist.
CityDoctorValidation.loadingDefaultConfig=No configuration file given, loading default configuration
CityDoctorValidation.noConfig=No configuration file specified with -config [FILE]
CityDoctorValidation.noInputFile=No input file specified. (-in [FILE])
CityDoctorValidation.noOutputFile=No output file specified. (-out [FILE])
CityDoctorValidation.notExactlyOneConfigFile=Specify exactly one file as configuration
CityDoctorValidation.notExactlyOneInputFile=Specify exactly one file as input.
CityDoctorValidation.notExactlyOneOutputFile=Specify exactly one file as output.
CityDoctorValidation.notExactlyOnePDFOutput=Specify exactly one file as pdfReport
CityDoctorValidation.notExactlyOneXMLOutput=Specify exactly one file as xmlReport
CityDoctorValidation.wrongInputFileFormat=Input file '{}' does not end with .gml or .xml
CityGmlParser.chunkReadFailed=Failed to read GML file in chunks, falling back to reading the complete file
CityGmlParser.convertCrsToUtmZoneN=Converting coordinate system to UTM zone {}N
CityGmlParser.convertCrsToUtmZoneS=Converting coordinate system to UTM zone {}S
CityGmlParser.creating4jContextFailed=Unable to create citygml4j context
CityGmlParser.creatingAdePluginsFailed=Unable to add ADE plugins to citygml4j
CityGmlParser.errorReadingGmlFile=Error while reading city gml file\n{}
CityGmlParser.errorWritingGmlFile=Error while writing city gml file\n{}
CityGmlParser.failedEPSGParse=Could not read EPSG code, fallback to metric system
CityGmlParser.missingCityModel=File does not contain a CityModel definition! Temporary CityModel will be created.
CityGmlParser.missingEPSGCode=No EPSG code found, assuming metric system
CityGmlParser.noConversionNeeded=Coordinate system is in meters, no conversion done
CityGmlParser.notValidGmlFile=This is not a valid GML-File\n
CityGmlParser.parsedObjects=Parsed model with {} objects
CityGmlWriterUtils.unknownADEError= Found error {} that cannot be converted to ADE error. It will not be written
CityGmlZipArchive.generalException=Encountered an unexpected error while reading the ZIP archive
CityGmlZipArchive.ioError=Accessing the ZIP archive failed
CityGmlZipArchive.malformedZipFile=Parsing of ZIP archive aborted, ZIP file is malformed!
DatabaseHandler.batchCommitFailure=Batch-commit aborted: Critical failure while trying to write CityObject {} to database!
DatabaseHandler.connectionFailure=Connection to embedded database could not be opened!
DatabaseHandler.fetchErrorIdsFailure=Fetching list of GmlIDs of CityObjects with errors failed!
DatabaseHandler.getAllCityObjectsFailure=Fetching of all CityObjects failed!
DatabaseHandler.getBBoxIntersectFailure= Connection to database failed while trying to fetch bbox intersecting objects of CityObject {}
DatabaseHandler.getBufferIntersectFailure=Connection to database failed while trying to fetch buffer intersecting objects of CityObject {}
DatabaseHandler.getFeatureCountFailure=Connection to database failed while trying to get count of CityObjects!
DatabaseHandler.marshallingFailure=Writing CityObject {} to database failed!
DatabaseHandler.serializationFailure=Serialization of CityObject {} failed!
DatabaseHandler.setupFailure=FATAL ERROR: Creation of embedded database failed!
DatabaseHandler.tableFailure=FATAL ERROR: Creation of features table failed!
DatabaseHandler.unmarshallingFailure=Loading of CityObject {} from embedded database failed!
DistanceError.distanceFromPlane=distance from plane
ErrorItemVisitor.childId=Child id
ErrorItemVisitor.component=Component
ErrorItemVisitor.degeneratedRing=Degenerated ring
ErrorItemVisitor.deviation=Deviation
ErrorItemVisitor.distance=Distance
ErrorItemVisitor.intersection=Intersection
ErrorItemVisitor.nameOfAttribute=Name of attribute
ErrorItemVisitor.pointTouchesEdge=Point touches edge
ErrorItemVisitor.triangles=Triangles
ExceptionDialog.stacktrace=The exception stacktrace was:
FilterPane.buildings=Buildings
FeatureMapper.polygonUnreferenced=Polygon {} is referenced but not found in feature polygons
FilterPane.bridges=Bridges
FilterPane.buildings=Buildings
FilterPane.landUse=Land Use
FilterPane.transportation=Transportation
FilterPane.vegetation=Vegetation
FilterPane.water=Water
MainToolBar.wireframe=Show/Hide Wireframe
GeometryMapper.emptyPolygon=Found polygon without exterior ring, ignoring
LibraryObject.fileMissing=Implicit geometry references non-existing library object file {}
LibraryObject.parsingError=Encountered an error while parsing library object {}
MainToolBar.culling=Enable/Disable Culling
MainToolBar.writeReports=Write Reports
MainToolBar.executeChecks=Execute Checks
MainToolBar.showWorld=Show entire city model
MainToolBar.resetCamera=Reset view
MainToolBar.hideRoof=Show/Hide roof BoundarySurfaces
MainToolBar.resetCamera=Reset view
MainToolBar.showWorld=Show entire city model
MainToolBar.wireframe=Show/Hide Wireframe
MainToolBar.writeReports=Write Reports
MainToolBar.zip=Open zip-entry selection window
MainWindow.missingConfig=Could not find configuration file.
MainWindow.loadGivenFile=Loading given file, please wait
MainWindow.finishedLoading=Finished loading
MainWindow.checking=Checking, please wait
MainWindow.writeXml=Writing xml report
MainWindow.finishedXml=Finished xml report
MainWindow.writePdf=Writing pdf report
MainWindow.finishedPdf=Finished pdf report
MainWindow.loadFailed=Failed to load given gml file: {}
MainWindow.all=All
MainWindow.withErrors=With errors
MainWindow.export=Export feature
MainWindow.attributeTab=Attributes
MainWindow.availableLabel=Available:
MainWindow.bridgeTab=Bridges
MainWindow.buildingsTab=Buildings
MainWindow.checking=Checking, please wait
MainWindow.cityfurnitureTab=CityFurniture
MainWindow.clearBtn=Clear
MainWindow.copyId=Copy GML-ID
MainWindow.delete=Delete feature
MainWindow.infoTopLevelExport=Only top-level object can be exported!
MainWindow.edgesTab=Edges
MainWindow.errorsTab=Errors
MainWindow.export=Export feature
MainWindow.finishedLoading=Finished loading
MainWindow.finishedPdf=Finished pdf report
MainWindow.finishedXml=Finished xml report
MainWindow.focusCityObject=Focus object
MainWindow.globalErrorsTab=Global Errors
MainWindow.infoTopLevelCopyID=GML-ID can only be copied from top-level object!
mainWindow.warnCopyIdFailed=Could not copy GML-ID!
OpenFileDialog.select=Select CityGML file
MainWindow.infoTopLevelExport=Only top-level object can be exported!
MainWindow.languageChange=For the change in language to apply, restart CityDoctor2.
MainWindow.buildingsTab=Buildings
MainWindow.vegetationTab=Vegetation
MainWindow.transportationTab=Transportation
MainWindow.tunnelTab=Tunnels
MainWindow.bridgeTab=Bridges
MainWindow.waterTab=Water
MainWindow.terrainTab=Terrain
MainWindow.cityfurnitureTab=CityFurniture
MainWindow.loadFailed=Failed to load given gml file: {}
MainWindow.loadGivenFile=Loading given file, please wait
MainWindow.logTab=Log
MainWindow.memoryLabel=Memory:
MainWindow.missingConfig=Could not find configuration file.
MainWindow.otherObjectsTab=Other
MainWindow.viewLabel=View
MainWindow.showLabel=Show:
MainWindow.searchLabel=Search:
MainWindow.searchBtn=Search
MainWindow.clearBtn=Clear
MainWindow.errorsTab=Errors
MainWindow.polygonsTab=Polygons
MainWindow.edgesTab=Edges
MainWindow.searchBtn=Search
MainWindow.searchLabel=Search:
MainWindow.showLabel=Show:
MainWindow.terrainTab=Terrain
MainWindow.transportationTab=Transportation
MainWindow.tunnelTab=Tunnels
MainWindow.vegetationTab=Vegetation
MainWindow.verticesTab=Vertices
MainWindow.attributeTab=Attributes
MainWindow.logTab=Log
MainWindow.globalErrorsTab=Global Errors
MainWindow.focusCityObject=Focus object
MainWindow.viewLabel=View
MainWindow.warnCopyIdFailed=Could not copy GML-ID!
MainWindow.waterTab=Water
MainWindow.withErrors=With errors
MainWindow.writePdf=Writing pdf report
MainWindow.writeXml=Writing xml report
OpenFileDialog.cancelBtn=Cancel
OpenFileDialog.fileLabel=File:
OpenFileDialog.selectBtn=Select
OpenFileDialog.loadBtn=Load
OpenFileDialog.settingsPane=Parser Preferences
OpenFileDialog.loadFailed=Failed to load CityGML File
OpenFileDialog.lowMemoryLabel=Low Memory Consumption Mode
OpenFileDialog.roundingPlacesLabel=NumberOfRoundingPlaces
OpenFileDialog.select=Select CityGML file
OpenFileDialog.selectBtn=Select
OpenFileDialog.settingsPane=Parser Preferences
OpenFileDialog.xmlValidationLabel=Use XML Validation
Checker.failXml=Failed to write XML Error Report.
Checker.failPdf=Failed to write PDF Report.
Checker.checksFinished=Finished executing checks
Checker.schematronValidation=Starting Schematron validation
Checker.finishedSchematron=Finished Schematron validation
Checker.failReports=Failed to write reports.
Checker.checkFeature=Checking feature: {}
Checker.executeCheck=Executing check: {}
ValidationConfiguration.reenable={} has been disabled but {} depends on it, reenabling
TimeFormatter.hours={0} hours
TimeFormatter.lessThanASecond=< 1 second
TimeFormatter.minutes={0} minutes
TimeFormatter.oneHour=1 hour
TimeFormatter.oneMinute=1 minute
TimeFormatter.oneSecond=1 second
TimeFormatter.seconds={0} seconds
Unit.Degree=Degree
Unit.Radian=Radian
ValidationConfiguration.missingSchematron={} is not an existing file, disabling schematron check
CheckContainer.error=Unexpected exception while executing check: {}
Checks.missingCheck=Could not find check for id: {}
OpenFileDialog.cancelBtn=Cancel
CheckDialog.checksTab=Checks
CheckDialog.filterTab=Filter
CheckDialog.globalParametersLabel=Global Parameters
CheckDialog.availableChecksLabel=Available Checks
CheckDialog.geometricChecksLabel=Geometric Checks
CheckDialog.semanticChecksLabel=Semantic Checks
CheckDialog.schematronFileLabel=Schematron File:
CheckDialog.selectBtn=Select
CheckDialog.checkBtn=Check
CheckDialog.cancelBtn=Cancel
CheckDialog.streamCheckOption=Use low memory mode
CheckDialog.streamCheckLabel=Citymodels are not loaded and kept in memory. Check results are saved to the QualityADE in copies of the input files.
CheckDialog.outputPathLabel=Output directory (Required):
CheckDialog.outputPathBtn=Select
CheckDialog.pdfReportsOption=Create PDF reports
CheckDialog.xmlReportsOption=Create XML reports
CheckDialog.noPathError=Output path is missing!
ZipEntryManager.title=Zip-entry manager
ZipEntryManager.entryListTitle=Zip-entries
ZipEntryManager.metadata=Metadata
ZipEntryManager.subpathLbl=Subpath:
ZipEntryManager.erroneousLbl=Erroneous:
ZipEntryManager.excessiveFileSize=Filesize exceeds memory
ZipEntryManager.invalidCityGml=Invalid CityGML file
ZipEntryManager.ioError=Unable to access file
ZipEntryManager.filesizeLbl=Filesize:
ZipEntryManager.validatedLbl=Validated:
ZipEntryManager.objectCountLbl=Object count:
ZipEntryManager.loadBtn=Load CityGML model
ZipEntryManager.decompressBtn=Unpack file
ZipEntryManager.decompressAllBtn=Unpack all files
ZipEntryManager.checkAllBtn=Check all files
ZipEntryManager.showReportBtn=Show error statistic
ZipEntryManager.saveBtn=Export validation results
ZipEntryManager.cancelBtn=Cancel
ZipEntryManager.unknownValue=N/A
ZipEntryManager.yes=Yes
ZipEntryManager.no=No
CityGmlZipArchive.ioError=Accessing the ZIP archive failed
CityGmlZipArchive.malformedZipFile=Parsing of ZIP archive aborted, ZIP file is malformed!
CityGmlZipArchive.generalException=Encountered an unexpected error while reading the ZIP archive
WriteReportDialog.writeBtn=Save
ValidationConfiguration.reenable={} has been disabled but {} depends on it, reenabling
WriteReportDialog.cancelBtn=Cancel
WriteReportDialog.errorStatisticsLabel=Error Statistics
WriteReportDialog.saveImageBtn=Save Image...
WriteReportDialog.selectPdfBtn=Select
WriteReportDialog.selectXmlFile=Select
WriteReportDialog.writeBtn=Save
WriteReportDialog.xAxisLabel=Error
WriteReportDialog.yAxisLabel=Count
\ No newline at end of file
Unit.Radian=Radian
Unit.Degree=Degree
FeatureMapper.polygonUnreferenced=Polygon {} is referenced but not found in feature polygons
GeometryMapper.emptyPolygon=Found polygon without exterior ring, ignoring
CityGmlParser.parsedObjects=Parsed model with {} objects
CityGmlParser.chunkReadFailed=Failed to read GML file in chunks, falling back to reading the complete file
CityGmlParser.notValidGmlFile=This is not a valid GML-File\n
CityGmlParser.errorReadingGmlFile=Error while reading city gml file\n{}
CityGmlParser.errorWritingGmlFile=Error while writing city gml file\n{}
CityGmlParser.noConversionNeeded=Coordinate system is in meters, no conversion done
CityGmlParser.failedEPSGParse=Could not read EPSG code, fallback to metric system
CityGmlParser.missingEPSGCode=No EPSG code found, assuming metric system
OpenFileDialog.loadFailed=Failed to load CityGML File
MainWindow.memoryLabel=Memory:
CheckDialog.checksReenabledAlert=Some checks have been reenabled so that other wanted checks can be executed\nSee the log for more information.
MainWindow.availableLabel=Available:
OpenFileDialog.lowMemoryLabel=Low Memory Consumption Mode
ErrorItemVisitor.intersection=Intersection
ErrorItemVisitor.component=Component
ErrorItemVisitor.nameOfAttribute=Name of attribute
ErrorItemVisitor.childId=Child id
ErrorItemVisitor.distance=Distance
ErrorItemVisitor.pointTouchesEdge=Point touches edge
ErrorItemVisitor.degeneratedRing=Degenerated ring
ErrorItemVisitor.deviation=Deviation
ErrorItemVisitor.triangles=Triangles
\ No newline at end of file
DistanceError.distanceFromPlane=Abstand von der Ebene
AboutDialog.developedBy=Entwickelt von
AboutDialog.closeBtn=Schlie\u00DFen
AboutDialog.contact=Kontakt
AboutDialog.developedBy=Entwickelt von
AboutDialog.title=CityDoctor 3 - \u00DCber
AboutDialog.closeBtn=Schlie\u00DFen
CheckDialog.title=Pr\u00fcfungskonfiguration
CheckDialog.schematronFiles=Schematron Dateien
CheckDialog.schematronChooserTitle=W\u00e4hle Schematron Datei..
CheckDialog.validationConfiguration=Validierungs Konfiguration
CheckDialog.startingChecks=Starte Pr\u00fcfung
CheckContainer.error=Unerwarteter Fehler bei der Ausf\u00fchrung von Pr\u00fcfung: {}
CheckDialog.availableChecksLabel=Verf\u00fcgbare Pr\u00fcfungen
CheckDialog.cancelBtn=Abbrechen
CheckDialog.checkBtn=Pr\u00fcfen
CheckDialog.checkEnabled=Aktiv
CheckDialog.checkName=Name
CheckDialog.checksDone=Pr\u00fcfung abgeschlossen
CheckDialog.checksReenabledAlert=Manche Pr\u00fcfungen wurden reaktiviert damit andere gewollte Pr\u00fcfungen durchgef\u00fchrt werden k\u00f6nnen\nMehr Details sind im Log geschrieben
CheckDialog.checksTab=Pr\u00fcfungen
CheckDialog.failedChecks=Konnte Pr\u00fcfungen nicht ausf\u00fchren
CheckDialog.schematronFileNotExisting=Schematron Datei existiert nicht, ignoriere
CheckDialog.checkEnabled=Aktiv
CheckDialog.parameterValue=Wert
CheckDialog.filterTab=Filter
CheckDialog.geometricChecksLabel=Geometrische Pr\u00fcfungen
CheckDialog.globalParametersLabel=Globale Parameter
CheckDialog.noPathError=Ausgabepfad wurde nicht gesetzt!
CheckDialog.outputPathBtn=Ausw\u00e4hlen
CheckDialog.outputPathLabel=Ausgabeordner (Pflichtfeld):
CheckDialog.parameterUnit=Einheit
CityDoctorController.noDatamodel=Datenmodell ist null, keine Pr\u00fcfungen konnten ausgef\u00fchrt werden
CityDoctorController.noSourceFile=Quelldatei ist null, keine Pr\u00fcfungen konnten ausgef\u00fchrt werden
CityDoctorController.noZipFile=ZIP-Archiv ist null, keine Pr\u00fcfungen konnten ausgef\u00fchrt werden
CityDoctorController.exportSuccess=Feature export erfolgreich abgeschlossen
CheckDialog.parameterValue=Wert
CheckDialog.pdfReportsOption=PDF-Berichte erstellen
CheckDialog.schematronChooserTitle=W\u00e4hle Schematron Datei ...
CheckDialog.schematronFileLabel=Schematron Datei:
CheckDialog.schematronFileNotExisting=Schematron Datei existiert nicht, Schematron-Pr\u00fcfung wird \u00fcbersprungen
CheckDialog.schematronFiles=Schematron Dateien
CheckDialog.selectBtn=Ausw\u00e4hlen
CheckDialog.semanticChecksLabel=Semantische Pr\u00fcfungen
CheckDialog.startingChecks=Starte Pr\u00fcfung
CheckDialog.streamCheckLabel=Stadtmodelle werden nicht in den Arbeitsspeicher geladen. Ergebnisse werden in der QualityADE in Kopien der Eingangsdateien gespeichert.
CheckDialog.streamCheckOption=Niedrigen Arbeitsspeicherverbrauchsmodus aktivieren
CheckDialog.title=Pr\u00fcfungskonfiguration
CheckDialog.validationConfiguration=Validierungskonfiguration
CheckDialog.xmlReportsOption=XML-Berichte erstellen
Checker.checkFeature=Pr\u00fcfe Feature: {}
Checker.checksFinished=Durchf\u00fchrung der Pr\u00fcfungen abgeschlossen. Gesamtzeit: {0}
Checker.dbStillUnresponsive=Pr\u00fcfung konnte weiterhin einige CityObjects nicht aus der Datenbank laden!
Checker.dbUnresponsive=Pr\u00fcfung konnte einige CityObjects nicht aus der Datenbank laden!
Checker.executeCheck=F\u00fchre Pr\u00fcfung aus: {}
Checker.failPdf=Konnte PDF-Fehlerbericht nicht schreiben.
Checker.failReports=Konnte Pr\u00fcfberichte nicht schreiben.
Checker.failXml=Konnte XML-Fehlerbericht nicht schreiben.
Checker.finishedSchematron=Schematron-Pr\u00fcfung abgeschlossen
Checker.futuresCheckFailures=Einige Pr\u00fcfungen sind aufgrund folgender Fehler fehlgeschlagen:
Checker.noCheckSatisfiesRequirement=Keine Pr\u00fcfung erf\u00fcllt die Anforderung {}, Anforderung wird nicht gepr\u00fcft
Checker.schematronCompleted=Schematron-Pr\u00fcfung abgeschlossen
Checker.schematronFileNotFound=Schematron Datei {} konnte nicht gefunden werden
Checker.schematronInterrupted=Main Thread hat Interrupt-Befehl w\u00e4hrend dem Warten auf Schematron Abschluss erhalten!
Checker.schematronStillRunning=Schematron-Pr\u00fcfung ist noch nicht abgeschlossen. Warten auf Abschluss der Pr\u00fcfung, dies kann einiges an Zeit beanspruchen
Checker.schematronValidation=Schematron-Pr\u00fcfung gestartet
Checker.shutdownInterrupted=Main-Thread hat einen Interrupt-Befehl w\u00e4hrend dem ThreadPool shutdown erhalten
Checker.validationInterrupted=Validierung abgebrochen: Pr\u00fcfung hat Interrupt-Befehl erhalten
Checker.waitAndRetry=Wiederhole Pr\u00fcfung nach kurzer Wartezeit ...
Checks.missingCheck=Konnte keine Pr\u00fcfung f\u00fcr id {} finden
CityDoctorController.exportSuccess=Exportieren des Features erfolgreich abgeschlossen
CityDoctorController.noDatamodel=Datenmodell ist NULL, keine Pr\u00fcfungen konnten ausgef\u00fchrt werden
CityDoctorController.noSourceFile=Quelldatei ist NULL, keine Pr\u00fcfungen konnten ausgef\u00fchrt werden
CityDoctorController.noZipFile=ZIP-Archiv ist NULL, keine Pr\u00fcfungen konnten ausgef\u00fchrt werden
CityDoctorController.saveZipArchiveReports=Validierungsberichte erfolgreich exportiert!
CityDoctorValidation.Version=${versionString}
CityDoctorValidation.inputFileNotExisting=Eingabedatei '{}' existiert nicht.
CityDoctorValidation.loadingDefaultConfig=Keine Konfigurationsdatei angegeben, Standardkonfiguration wird geladen.
CityDoctorValidation.noConfig=Keine Konfigurationsdatei angegeben. (-config [DATEIPFAD])
CityDoctorValidation.noInputFile=Keine Eingabedatei angegeben. (-in [DATEIPFAD])
CityDoctorValidation.noOutputFile=Keinen Ausgabedateipfad angegeben. (-out [DATEIPFAD])
CityDoctorValidation.notExactlyOneConfigFile=Es muss exakt eine Konfigurationsdatei angegeben werden.
CityDoctorValidation.notExactlyOneInputFile=Es muss exakt eine Eingabedatei angegeben werden.
CityDoctorValidation.notExactlyOneOutputFile=Es muss exakt ein Ausgabedateipfad angegeben werden.
CityDoctorValidation.notExactlyOnePDFOutput=Es muss exakt ein Ausgabedateipfad f\u00fcr den PDF-Bericht angegeben werden.
CityDoctorValidation.notExactlyOneXMLOutput=Es muss exakt ein Ausgabedateipfad f\u00fcr den XML-Bericht angegeben werden.
CityDoctorValidation.wrongInputFileFormat=Eingabedatei '{}' ist keine .gml oder .xml Datei.
CityGmlParser.chunkReadFailed=Konnte Datei nicht in St\u00fccken lesen, versuche komplett zu lesen
CityGmlParser.convertCrsToUtmZoneN=Konvertiere Koordinatensystem zu UTM Zone {}N
CityGmlParser.convertCrsToUtmZoneS=Konvertiere Koordinatensystem zu UTM Zone {}S
CityGmlParser.creating4jContextFailed=Erstellen des Citygml4j Kontext fehlgeschlagen
CityGmlParser.creatingAdePluginsFailed=Erstellen des ADE Plugins f\u00fcr citygml4j fehlgeschlagen
CityGmlParser.errorReadingGmlFile=Fehler beim lesen der CityGML Datei\n{}
CityGmlParser.errorWritingGmlFile=Fehler beim schreiben der CityGML Datei\n{}
CityGmlParser.failedEPSGParse=Lesen des EPSG-Codes fehlgeschlagen, greife auf metrisches System zur\u00fcck
CityGmlParser.missingCityModel=Datei enth\u00e4lt kein CityModel! Tempor\u00e4res CityModel wird erstellt.
CityGmlParser.missingEPSGCode=Kein EPSG-Code wurde gefunden! Gehe von metrischem System aus
CityGmlParser.noConversionNeeded=Koordinatensystem in Metern, keine Konvertierung notwendig
CityGmlParser.notValidGmlFile=Dies ist keine korrekte CityGML Datei
CityGmlParser.parsedObjects=Modell mit {} Objekten gelesen
CityGmlWriterUtils.unknownADEError= Fehler {} kann nicht zu einem ADE-Fehler konvertiert werden. Fehler wird nicht ausgegeben
CityGmlZipArchive.generalException=Unerwarteter Fehler beim Einlesen des ZIP-Archivs
CityGmlZipArchive.ioError=Zugriff auf ZIP-Datei fehlgeschlagen
CityGmlZipArchive.malformedZipFile=Einlesen des ZIP-Archivs abgebrochen, ZIP-Datei ist fehlerhaft!
DatabaseHandler.batchCommitFailure=Batch-commit abgebrochen: Auftreten eines kritischen Fehlers beim Versuch CityObject {} in die Datenbank zu schreiben!
DatabaseHandler.connectionFailure=Verbindung zur eingebetteten Datenbank konnte nicht hergestellt werden!
DatabaseHandler.fetchErrorIdsFailure=Abfragen der Liste von CityObjects mit Fehlern ist fehlgeschlagen!
DatabaseHandler.getAllCityObjectsFailure=Abfragen der Liste aller CityObjects ist fehlgeschlagen!
DatabaseHandler.getBBoxIntersectFailure=Verbindung zur Datenbank konnte nicht hergestellt werden, abfragen der BoundingBox-\u00dcberschneidungen von CityObject {} fehlgeschlagen!
DatabaseHandler.getBufferIntersectFailure=Verbindung zur Datenbank konnte nicht hergestellt werden, abfragen der Buffer-\u00dcberschneidungen von CityObject {} fehlgeschlagen!
DatabaseHandler.getFeatureCountFailure=Verbindung zur Datenbank konnte nicht hergestellt werden, abfragen der Anzahl an CityObjects fehlgeschlagen!
DatabaseHandler.marshallingFailure=Schreiben des CityObject {} in die Datenbank fehlgeschlagen!
DatabaseHandler.serializationFailure=Serialisierung des CityObject {} fehlgeschlagen!
DatabaseHandler.setupFailure=KRITISCHER FEHLER: Erstellen der eingebetteten Datenbank fehlgeschlagen!
DatabaseHandler.tableFailure=KRITISCHER FEHLER: Erstellen der "features" Tabelle fehlgeschlagen!
DatabaseHandler.unmarshallingFailure=Laden des CityObject {} aus der Datenbank fehlgeschlagen!
DistanceError.distanceFromPlane=Abstand von der Ebene
ErrorItemVisitor.childId=Kind ID
ErrorItemVisitor.component=Komponente
ErrorItemVisitor.degeneratedRing=Degenerierter Ring
ErrorItemVisitor.deviation=Abweichung
ErrorItemVisitor.distance=Distanz
ErrorItemVisitor.intersection=Verschneidung
ErrorItemVisitor.nameOfAttribute=Name des Attributs
ErrorItemVisitor.pointTouchesEdge=Punkt ber\u00fchrt Kante
ErrorItemVisitor.triangles=Dreiecke
ExceptionDialog.stacktrace=Der Stacktrace des Fehlers war:
FilterPane.buildings=Geb\u00e4ude
FeatureMapper.polygonUnreferenced=Polygon {} wurde referenziert, konnte aber nicht gefunden werden!
FilterPane.bridges=Br\u00fccken
FilterPane.buildings=Geb\u00e4ude
FilterPane.landUse=Landnutzung
FilterPane.transportation=Transport
FilterPane.vegetation=Vegetation
FilterPane.water=Wasser
MainToolBar.wireframe=Zeige/Verstecke Gitternetz
MainToolBar.culling=Aktiviere/Deaktiviere Entfernen der R\u00fcckseiten
MainToolBar.writeReports=Schreibe Reports
GeometryMapper.emptyPolygon=Polygon ohne externen Ring gefunden. Polygon wird ignoriert
LibraryObject.fileMissing=Die ImplicitGeometry eines Features verweist auf eine nicht vorhandene LibraryObject-Datei {}
LibraryObject.parsingError=LibraryObject-Datei {} konnte aufgrund eines Fehlers nicht ausgelesen werden
MainToolBar.culling=Aktiviere/Deaktiviere Entfernen der Polygon-R\u00fcckseiten
MainToolBar.executeChecks=F\u00fchre Pr\u00fcfungen aus
MainToolBar.showWorld=Gesamtes Stadtmodell anzeigen
MainToolBar.resetCamera=Ansicht zur\u00fccksetzen
MainToolBar.hideRoof=Zeige/Verstecke Dach BoundarySurfaces
MainToolBar.hideRoof=Zeige/Verstecke Dach-BoundarySurfaces
MainToolBar.resetCamera=Kamera-Ansicht zur\u00fccksetzen
MainToolBar.showWorld=Zeige gesamtes Stadtmodell an
MainToolBar.wireframe=Aktiviere/Deaktiviere Gitternetz-Modus
MainToolBar.writeReports=Schreibe Berichte
MainToolBar.zip=Zip-eintrag Auswahlfenster \u00f6ffnen
MainWindow.missingConfig=Konnte Konfigurationsdatei nicht finden.
MainWindow.loadGivenFile=Lade vorhandene Datei, bitte warten
MainWindow.finishedLoading=Fertig geladen
MainWindow.checking=Pr\u00fcfe, bitte warten
MainWindow.writeXml=Schreibe Xml Report
MainWindow.finishedXml=Xml Report abgeschlossen
MainWindow.writePdf=Schreibe Pdf Report
MainWindow.finishedPdf=Pdf Report abgeschlossen
MainWindow.loadFailed=Konnte GML-Datei nicht laden: {}
MainWindow.all=Alle
MainWindow.withErrors=Mit Fehlern
MainWindow.export=Feature Exportieren
MainWindow.attributeTab=Attribute
MainWindow.availableLabel=Verf\u00fcgbar:
MainWindow.bridgeTab=Br\u00fccken
MainWindow.buildingsTab=Geb\u00e4ude
MainWindow.checking=Pr\u00fcfe, bitte warten
MainWindow.cityfurnitureTab=Stadtm\u00f6bel
MainWindow.clearBtn=Leeren
MainWindow.copyId=GML-ID kopieren
MainWindow.delete=Feature L\u00f6schen
MainWindow.infoTopLevelExport=Export ist nur f\u00fcr Featureobjekt basis m\u00f6glich!
MainWindow.edgesTab=Kanten
MainWindow.errorsTab=Fehler
MainWindow.export=Feature Exportieren
MainWindow.finishedLoading=Fertig geladen
MainWindow.finishedPdf=Pdf-Bericht abgeschlossen
MainWindow.finishedXml=Xml-Bericht abgeschlossen
MainWindow.focusCityObject=Objekt fokussieren
MainWindow.globalErrorsTab=Globale Fehler
MainWindow.infoTopLevelCopyID=GML-ID kann nur von Featureobjekt basis kopiert werden!
mainWindow.warnCopyIdFailed=Kopieren der ID fehlgeschlagen!
OpenFileDialog.select=W\u00e4hle CityGML Datei aus
MainWindow.infoTopLevelExport=Export ist nur f\u00fcr Featureobjekt basis m\u00f6glich!
MainWindow.languageChange=Um die Spracheinstellung zu \u00fcbernehmen muss CityDoctor2 neugestartet werden.
MainWindow.buildingsTab=Geb\u00e4ude
MainWindow.vegetationTab=Vegetation
MainWindow.transportationTab=Verkehrsobjekte
MainWindow.tunnelTab=Tunnel
MainWindow.bridgeTab=Br\u00fccken
MainWindow.waterTab=Gew\u00e4sser
MainWindow.terrainTab=Gel\u00e4nde
MainWindow.cityfurnitureTab=Stadtm\u00f6bel
MainWindow.loadFailed=Konnte GML-Datei nicht laden: {}
MainWindow.loadGivenFile=Lade vorhandene Datei, bitte warten
MainWindow.logTab=Log
MainWindow.memoryLabel=Speicher:
MainWindow.missingConfig=Konnte Konfigurationsdatei nicht finden.
MainWindow.otherObjectsTab=Andere
MainWindow.viewLabel=Ansicht
MainWindow.showLabel=Zeige:
MainWindow.searchLabel=Suche:
MainWindow.searchBtn=Suche
MainWindow.clearBtn=Leeren
MainWindow.errorsTab=Fehler
MainWindow.polygonsTab=Polygone
MainWindow.edgesTab=Kanten
MainWindow.searchBtn=Suche
MainWindow.searchLabel=Suche:
MainWindow.showLabel=Zeige:
MainWindow.terrainTab=Gel\u00e4nde
MainWindow.transportationTab=Verkehrsobjekte
MainWindow.tunnelTab=Tunnel
MainWindow.vegetationTab=Vegetation
MainWindow.verticesTab=Punkte
MainWindow.attributeTab=Attribute
MainWindow.logTab=Log
MainWindow.globalErrorsTab=Globale Fehler
MainWindow.focusCityObject=Objekt fokussieren
MainWindow.viewLabel=Ansicht
MainWindow.warnCopyIdFailed=Kopieren der ID fehlgeschlagen!
MainWindow.waterTab=Gew\u00e4sser
MainWindow.withErrors=Mit Fehlern
MainWindow.writePdf=Schreibe Pdf-Bericht
MainWindow.writeXml=Schreibe Xml-Bericht
OpenFileDialog.cancelBtn=Abbrechen
OpenFileDialog.fileLabel=Datei:
OpenFileDialog.selectBtn=Ausw\u00e4hlen
OpenFileDialog.loadBtn=Laden
OpenFileDialog.loadFailed=Konnte CityGML Datei nicht laden
OpenFileDialog.lowMemoryLabel=Reduzierter Speicherverbrauchsmodus
OpenFileDialog.roundingPlacesLabel=Anzahl der Rundungsstellen
OpenFileDialog.select=W\u00e4hle CityGML Datei aus
OpenFileDialog.selectBtn=Ausw\u00e4hlen
OpenFileDialog.settingsPane=Parser Einstellungen
OpenFileDialog.roundingPlacesLabel=NumberOfRoundingPlaces
OpenFileDialog.xmlValidationLabel=F\u00fchre XML-Validierung aus
Checker.failXml=Konnte XML Fehlerbericht nicht schreiben.
Checker.failPdf=Konnte PDF Fehlerbericht nicht schreiben.
Checker.checksFinished=Pr\u00fcfungen beendet
Checker.schematronValidation=Starte Schematron Pr\u00fcfung
Checker.finishedSchematron=Schematron Pr\u00fcfung abgeschlossen
Checker.failReports=Konnte Pr\u00fcfberichte nicht schreiben.
Checker.checkFeature=Pr\u00fcfe Feature: {}
Checker.executeCheck=F\u00fchre Pr\u00fcfung aus: {}
ValidationConfiguration.reenable={} ist deaktiviert wird aber von {} ben\u00f6tigt, reaktiviere
TimeFormatter.hours={0} Stunden
TimeFormatter.lessThanASecond=< 1 Sekunde
TimeFormatter.minutes={0} Minuten
TimeFormatter.oneHour=1 Stunde
TimeFormatter.oneMinute=1 Minute
TimeFormatter.oneSecond=1 Sekunde
TimeFormatter.seconds={0} Sekunden
Unit.Degree=Grad
Unit.Radian=Radiant
ValidationConfiguration.missingSchematron={} existiert nicht, deaktiviere Schematron Pr\u00fcfung
CheckContainer.error=Unerwarteter Fehler bei der Ausf\u00fchrung von Pr\u00fcfung: {}
Checks.missingCheck=Konnte keine Pr\u00fcfung f\u00fcr id {} finden
OpenFileDialog.cancelBtn=Abbrechen
CheckDialog.checksTab=Pr\u00fcfungen
CheckDialog.filterTab=Filter
CheckDialog.globalParametersLabel=Globale Parameter
CheckDialog.availableChecksLabel=Verf\u00fcgbare Pr\u00fcfungen
CheckDialog.geometricChecksLabel=Geometrische Pr\u00fcfungen
CheckDialog.semanticChecksLabel=Semantische Pr\u00fcfungen
CheckDialog.schematronFileLabel=Schematron Datei
CheckDialog.selectBtn=Ausw\u00e4hlen
CheckDialog.checkBtn=Pr\u00fcfen
CheckDialog.cancelBtn=Abbrechen
CheckDialog.streamCheckOption=Niedrigen Arbeitsspeicherverbrauchsmodus aktivieren
CheckDialog.streamCheckLabel=Stadtmodelle werden nicht in den Arbeitsspeicher geladen. Ergebnisse werden in der QualityADE in Kopien der Eingangsdateien gespeichert.
CheckDialog.outputPathLabel=Ausgabeordner (Pflichtfeld):
CheckDialog.outputPathBtn=Ausw\u00e4hlen
CheckDialog.pdfReportsOption=PDF Berichte erstellen
CheckDialog.xmlReportsOption=XML Berichte erstellen
CheckDialog.noPathError=Ausgabepfad wurde nicht gesetzt!
ZipEntryManager.title=Zipeintrag Manager
ZipEntryManager.entryListTitle=Zipeintr\u00e4ge
ZipEntryManager.metadata=Metadaten
ZipEntryManager.subpathLbl=Unterpfad:
ZipEntryManager.erroneousLbl=Fehlerhaft:
ZipEntryManager.excessiveFileSize=Datei zu gro\u00DF
ZipEntryManager.invalidCityGml=Ung\u00fcltige CityGML Datei
ZipEntryManager.ioError=Dateizugriff fehlgeschlagen
ZipEntryManager.filesizeLbl=Dateigr\u00f6\u00DFe:
ZipEntryManager.validatedLbl=Validiert:
ZipEntryManager.objectCountLbl=Objektanzahl:
ZipEntryManager.loadBtn=CityGML Modell laden
ZipEntryManager.decompressBtn=Datei entpacken
ZipEntryManager.decompressAllBtn=Alle Dateien entpacken
ZipEntryManager.checkAllBtn=Alle Dateien pr\u00fcfen
ZipEntryManager.showReportBtn=Fehlerstatistik anzeigen
ZipEntryManager.saveBtn=Validierungsergebnisse exportieren
ZipEntryManager.cancelBtn=Abbruch
ZipEntryManager.unknownValue=Unbekannt
ZipEntryManager.yes=Ja
ZipEntryManager.no=Nein
CityGmlZipArchive.ioError=Zugriff auf ZIP-Datei fehlgeschlagen
CityGmlZipArchive.malformedZipFile=Einlesen des ZIP-Archivs abgebrochen, ZIP-Datei ist fehlerhaft!
CityGmlZipArchive.generalException=Unerwarteter Fehler beim Einlesen des ZIP-Archivs
WriteReportDialog.writeBtn=Speichern
ValidationConfiguration.reenable={} ist deaktiviert wird aber von {} ben\u00f6tigt, reaktiviere
WriteReportDialog.cancelBtn=Abbrechen
WriteReportDialog.errorStatisticsLabel=Fehler Statistik
WriteReportDialog.saveImageBtn=Bild Speichern
WriteReportDialog.selectPdfBtn=Ausw\u00e4hlen
WriteReportDialog.selectXmlFile=Ausw\u00e4hlen
WriteReportDialog.writeBtn=Speichern
WriteReportDialog.xAxisLabel=Fehler
WriteReportDialog.yAxisLabel=Anzahl
\ No newline at end of file
Unit.Radian=Radiant
Unit.Degree=Grad
FeatureMapper.polygonUnreferenced=Polygon {} ist referenziert, konnte aber nicht gefunden werden
GeometryMapper.emptyPolygon=Polygon ohne externen Ring gefunden, ignoriere
CityGmlParser.parsedObjects=Modell mit {} Objekten gelesen
CityGmlParser.chunkReadFailed=Konnte Datei nicht in St\u00fccken lesen, versuche komplett zu lesen
CityGmlParser.notValidGmlFile=Dies ist keine korrekte CityGML Datei\n
CityGmlParser.errorReadingGmlFile=Fehler beim lesen der CityGML Datei\n{}
CityGmlParser.errorWritingGmlFile=Fehler beim schreiben der CityGML Datei\n{}
CityGmlParser.noConversionNeeded=Koordinatensystem in Metern, keine Konvertierung notwendig
CityGmlParser.failedEPSGParse=Lesen des EPSG Codes fehlgeschlagen, greife auf metrisches System zur\u00fcck
CityGmlParser.missingEPSGCode=Kein EPSG Code gefunden, nehme metrisches System an
OpenFileDialog.loadFailed=Konnte CityGML Datei nicht laden
MainWindow.memoryLabel=Speicher:
CheckDialog.checksReenabledAlert=Manche Pr\u00fcfungen wurden reaktiviert damit andere gewollte Pr\u00fcfungen durchgef\u00fchrt werden k\u00f6nnen\nMehr Details sind im Log geschrieben
MainWindow.availableLabel=Verf\u00fcgbar:
OpenFileDialog.lowMemoryLabel=Reduzierter Speicherverbrauchsmodus
ErrorItemVisitor.intersection=Verschneidung
ErrorItemVisitor.component=Komponente
ErrorItemVisitor.nameOfAttribute=Name des Attributs
ErrorItemVisitor.childId=Kind ID
ErrorItemVisitor.distance=Distanz
ErrorItemVisitor.pointTouchesEdge=Punkt ber\u00fchrt Kante
ErrorItemVisitor.degeneratedRing=Degenerierter Ring
ErrorItemVisitor.deviation=Abweichung
ErrorItemVisitor.triangles=Dreiecke
\ No newline at end of file
......@@ -14,5 +14,8 @@
<Logger name="org.apache.fop" level="INFO">
<AppenderRef ref="console" />
</Logger>
<Logger name="com.zaxxer.hikari" level="INFO" additivity="false">
<AppenderRef ref="console"/>
</Logger>
</Loggers>
</Configuration>
\ No newline at end of file
package de.hft.stuttgart.citydoctor2.database;
import de.hft.stuttgart.citydoctor2.datastructure.Building;
import de.hft.stuttgart.citydoctor2.datastructure.CityDoctorModel;
import de.hft.stuttgart.citydoctor2.datastructure.CityObject;
import de.hft.stuttgart.citydoctor2.datastructure.ConcretePolygon;
import de.hft.stuttgart.citydoctor2.datastructure.Geometry;
import de.hft.stuttgart.citydoctor2.datastructure.GeometryTestUtils;
import de.hft.stuttgart.citydoctor2.datastructure.GeometryType;
import de.hft.stuttgart.citydoctor2.datastructure.GmlId;
import de.hft.stuttgart.citydoctor2.datastructure.LinearRing;
import de.hft.stuttgart.citydoctor2.datastructure.Lod;
import de.hft.stuttgart.citydoctor2.datastructure.Vertex;
import de.hft.stuttgart.citydoctor2.parser.CityGmlParseException;
import de.hft.stuttgart.citydoctor2.parser.CityGmlParser;
import de.hft.stuttgart.citydoctor2.parser.InvalidGmlFileException;
import de.hft.stuttgart.citydoctor2.parser.ParserConfiguration;
import org.citygml4j.core.model.building.AbstractBuilding;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mockito;
import java.util.List;
import static de.hft.stuttgart.citydoctor2.database.SerializationTest.assertCityObjectEquality;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.fail;
public class EmbeddedDataBaseHandlerTest {
private EmbeddedDatabaseHandler handler;
@Before
public void resetDatabase() {
try {
handler = new EmbeddedDatabaseHandler();
handler.setupFeaturesTable();
} catch (Exception e) {
fail(e.getMessage());
}
}
@Test
public void testGetBboxIntersectingObjects() {
Building b = new Building();
Building b2 = new Building();
b2.setGmlObject(Mockito.mock(AbstractBuilding.class));
Building b3 = new Building();
Building b4 = new Building();
b4.addGeometry(GeometryTestUtils.createDummyGeometry(GeometryType.SOLID, Lod.LOD0));
Geometry geom = new Geometry(GeometryType.SOLID, Lod.LOD0, Geometry.Orientation.OUTWARD);
ConcretePolygon polygon = new ConcretePolygon();
geom.getPolygons().add(polygon);
polygon.setParent(geom);
LinearRing lr = new LinearRing(LinearRing.LinearRingType.EXTERIOR);
polygon.setExteriorRing(lr);
Vertex v1 = new Vertex(10, 10, 8);
lr.getVertices().add(v1);
Vertex v2 = new Vertex(14, 15, 7);
lr.getVertices().add(v2);
Vertex v3 = new Vertex(14, 15, 3);
lr.getVertices().add(v3);
Vertex v4 = new Vertex(10, 10, 3);
lr.getVertices().add(v4);
lr.getVertices().add(v1);
geom.updateEdgesAndVertices();
b.addGeometry(geom);
Geometry geom2 = new Geometry(GeometryType.SOLID, Lod.LOD0, Geometry.Orientation.OUTWARD);
ConcretePolygon polygon2 = new ConcretePolygon();
geom2.getPolygons().add(polygon2);
polygon2.setParent(geom2);
LinearRing lr2 = new LinearRing(LinearRing.LinearRingType.EXTERIOR);
polygon2.setExteriorRing(lr2);
Vertex v1b2 = new Vertex(6, 6, 8);
lr2.getVertices().add(v1b2);
Vertex v2b2 = new Vertex(11, 13, 7);
lr2.getVertices().add(v2b2);
Vertex v3b2 = new Vertex(11, 13, 3);
lr2.getVertices().add(v3b2);
Vertex v4b2 = new Vertex(6, 6, 3);
lr2.getVertices().add(v4b2);
lr2.getVertices().add(v1b2);
geom2.updateEdgesAndVertices();
b2.addGeometry(geom2);
Geometry geom3 = new Geometry(GeometryType.SOLID, Lod.LOD0, Geometry.Orientation.OUTWARD);
ConcretePolygon polygon3 = new ConcretePolygon();
geom3.getPolygons().add(polygon3);
polygon3.setParent(geom3);
LinearRing lr3 = new LinearRing(LinearRing.LinearRingType.EXTERIOR);
polygon3.setExteriorRing(lr3);
Vertex v1b3 = new Vertex(6, 6, 8);
lr3.getVertices().add(v1b3);
Vertex v2b3 = new Vertex(10, 9.999, 7);
lr3.getVertices().add(v2b3);
Vertex v3b3 = new Vertex(10, 9.999, 3);
lr3.getVertices().add(v3b3);
Vertex v4b3 = new Vertex(6, 6, 3);
lr3.getVertices().add(v4b3);
lr3.getVertices().add(v1b3);
geom3.updateEdgesAndVertices();
b3.addGeometry(geom3);
handler.marshallCityObject(b);
handler.marshallCityObject(b2);
handler.marshallCityObject(b3);
handler.marshallCityObject(b4);
assertEquals(4, handler.getFeatureCount());
List<GmlId> objects = handler.getGeometryCollisionCandidates(b);
assertEquals(1, objects.size());
assertEquals(4, handler.getFeatureCount());
CityObject co = handler.unmarshallCityObject(objects.get(0));
assertNotNull(co);
assertCityObjectEquality(b2, co);
}
@Test
public void testGetBboxBufferIntersectingObjects() {
Building b = new Building();
Building b2 = new Building();
b2.setGmlObject(Mockito.mock(AbstractBuilding.class));
Building b3 = new Building();
Building b4 = new Building();
b4.addGeometry(GeometryTestUtils.createDummyGeometry(GeometryType.SOLID, Lod.LOD0));
Geometry geom = new Geometry(GeometryType.SOLID, Lod.LOD0, Geometry.Orientation.OUTWARD);
ConcretePolygon polygon = new ConcretePolygon();
geom.getPolygons().add(polygon);
polygon.setParent(geom);
LinearRing lr = new LinearRing(LinearRing.LinearRingType.EXTERIOR);
polygon.setExteriorRing(lr);
Vertex v1 = new Vertex(10, 10, 8);
lr.getVertices().add(v1);
Vertex v2 = new Vertex(14, 15, 7);
lr.getVertices().add(v2);
Vertex v3 = new Vertex(14, 15, 3);
lr.getVertices().add(v3);
Vertex v4 = new Vertex(10, 10, 3);
lr.getVertices().add(v4);
lr.getVertices().add(v1);
geom.updateEdgesAndVertices();
b.addGeometry(geom);
Geometry geom2 = new Geometry(GeometryType.SOLID, Lod.LOD0, Geometry.Orientation.OUTWARD);
ConcretePolygon polygon2 = new ConcretePolygon();
geom2.getPolygons().add(polygon2);
polygon2.setParent(geom2);
LinearRing lr2 = new LinearRing(LinearRing.LinearRingType.EXTERIOR);
polygon2.setExteriorRing(lr2);
Vertex v1b2 = new Vertex(6, 6, 8);
lr2.getVertices().add(v1b2);
Vertex v2b2 = new Vertex(9, 9, 7);
lr2.getVertices().add(v2b2);
Vertex v3b2 = new Vertex(9, 9, 3);
lr2.getVertices().add(v3b2);
Vertex v4b2 = new Vertex(6, 6, 3);
lr2.getVertices().add(v4b2);
lr2.getVertices().add(v1b2);
geom2.updateEdgesAndVertices();
b2.addGeometry(geom2);
Geometry geom3 = new Geometry(GeometryType.SOLID, Lod.LOD0, Geometry.Orientation.OUTWARD);
ConcretePolygon polygon3 = new ConcretePolygon();
geom3.getPolygons().add(polygon3);
polygon3.setParent(geom3);
LinearRing lr3 = new LinearRing(LinearRing.LinearRingType.EXTERIOR);
polygon3.setExteriorRing(lr3);
Vertex v1b3 = new Vertex(4, 4, 8);
lr3.getVertices().add(v1b3);
Vertex v2b3 = new Vertex(8.999, 8.999, 7);
lr3.getVertices().add(v2b3);
Vertex v3b3 = new Vertex(8.999, 8.999, 3);
lr3.getVertices().add(v3b3);
Vertex v4b3 = new Vertex(4, 4, 3);
lr3.getVertices().add(v4b3);
lr3.getVertices().add(v1b3);
geom3.updateEdgesAndVertices();
b3.addGeometry(geom3);
handler.marshallCityObject(b);
handler.marshallCityObject(b2);
handler.marshallCityObject(b3);
handler.marshallCityObject(b4);
assertEquals(4, handler.getFeatureCount());
List<GmlId> objects = handler.getBufferCollisionCandidates(b, Math.sqrt(2));
assertEquals(1, objects.size());
assertEquals(4, handler.getFeatureCount());
CityObject co = handler.unmarshallCityObject(objects.get(0));
assertNotNull(co);
assertCityObjectEquality(b2, co);
}
@Test
public void testMarshallingRoundTripSimpleSolid() throws InvalidGmlFileException, CityGmlParseException {
ParserConfiguration config = new ParserConfiguration(8, false);
CityDoctorModel model = CityGmlParser.parseCityGmlFile("src/test/resources/SimpleSolid_SrefBS.gml", config);
Building b = model.getBuildings().toList().get(0);
assertNotNull(b);
handler.marshallCityObject(b);
assertEquals(1, handler.getFeatureCount());
CityObject b2 = handler.unmarshallCityObject(b.getGmlId());
assertNotNull(b2);
assertEquals(1, handler.getFeatureCount());
assertCityObjectEquality(b, b2);
}
@Test
public void testMarshallingRoundTripFzk() throws InvalidGmlFileException, CityGmlParseException {
ParserConfiguration config = new ParserConfiguration(8, false);
CityDoctorModel model = CityGmlParser.parseCityGmlFile("src/test/resources/FZK_haus.gml", config);
Building b = model.getBuildings().toList().get(0);
assertNotNull(b);
assertEquals(1, handler.getFeatureCount());
handler.marshallCityObject(b);
assertEquals(1, handler.getFeatureCount());
CityObject b2 = handler.unmarshallCityObject(b.getGmlId());
assertNotNull(b2);
assertEquals(1, handler.getFeatureCount());
assertCityObjectEquality(b, b2);
}
}
package de.hft.stuttgart.citydoctor2.database;
import de.hft.stuttgart.citydoctor2.datastructure.*;
import org.citygml4j.core.model.building.AbstractBuilding;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertThrows;
import static org.mockito.Mockito.mock;
public class FeatureCacheTest {
@Test
public void testPut(){
FeatureCache cache = new FeatureCache();
Building b = new Building();
b.setGmlObject(mock(AbstractBuilding.class));
b.setGmlId(new GmlId("test"));
b.addGeometry(GeometryTestUtils.createDummyGeometry(GeometryType.SOLID, Lod.LOD0));
assertEquals(0, cache.getTotalFeatureCount());
cache.put(b);
cache.synchronize();
assertEquals(1, cache.getTotalFeatureCount());
}
@Test
public void testGet(){
FeatureCache cache = new FeatureCache();
assertNull(cache.get(new GmlId("test")));
Building b = new Building();
b.setGmlObject(mock(AbstractBuilding.class));
b.setGmlId(new GmlId("test"));
b.addGeometry(GeometryTestUtils.createDummyGeometry(GeometryType.SOLID, Lod.LOD0));
assertEquals(0, cache.getTotalFeatureCount());
cache.put(b);
cache.synchronize();
CityObject b2 = cache.get(new GmlId("test"));
assertEquals(b.getGmlId(), b2.getGmlId());
}
@Test
public void testStateHandlingFromIdle(){
FeatureCache cache = new FeatureCache();
assertEquals(FeatureCache.CacheState.IDLE, cache.getState());
AutoCloseable parsingContext = cache.startParsingMode();
try(parsingContext){
assertEquals(FeatureCache.CacheState.PARSING, cache.getState());
} catch (Exception e){
throw new RuntimeException(e);
}
assertEquals(FeatureCache.CacheState.IDLE, cache.getState());
AutoCloseable checkingContext = cache.startCheckingMode();
try(checkingContext){
assertEquals(FeatureCache.CacheState.CHECKING, cache.getState());
} catch (Exception e){
throw new RuntimeException(e);
}
assertEquals(FeatureCache.CacheState.IDLE, cache.getState());
}
@Test
public void testCheckingModeStateCollision(){
FeatureCache cache = new FeatureCache();
assertEquals(FeatureCache.CacheState.IDLE, cache.getState());
AutoCloseable checkingContext = cache.startCheckingMode();
try(checkingContext){
assertEquals(FeatureCache.CacheState.CHECKING, cache.getState());
assertThrows(IllegalStateException.class, cache::startParsingMode);
} catch (Exception e){
throw new RuntimeException(e);
}
}
@Test
public void testParsingModeStateCollision(){
FeatureCache cache = new FeatureCache();
assertEquals(FeatureCache.CacheState.IDLE, cache.getState());
AutoCloseable parsingContext = cache.startParsingMode();
try(parsingContext){
assertEquals(FeatureCache.CacheState.PARSING, cache.getState());
assertThrows(IllegalStateException.class, cache::startCheckingMode);
} catch (Exception e){
throw new RuntimeException(e);
}
}
}
package de.hft.stuttgart.citydoctor2.database;
import de.hft.stuttgart.citydoctor2.datastructure.Building;
import de.hft.stuttgart.citydoctor2.datastructure.CityDoctorModel;
import de.hft.stuttgart.citydoctor2.datastructure.CityObject;
import de.hft.stuttgart.citydoctor2.parser.CityGmlParseException;
import de.hft.stuttgart.citydoctor2.parser.CityGmlParser;
import de.hft.stuttgart.citydoctor2.parser.InvalidGmlFileException;
import de.hft.stuttgart.citydoctor2.parser.ParserConfiguration;
import de.hft.stuttgart.citydoctor2.utils.visitors.CityObjectCollector;
import org.apache.commons.lang3.SerializationUtils;
import org.junit.Test;
import java.util.Set;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
public class SerializationTest {
static void assertCityObjectEquality(CityObject c1, CityObject c2) {
assertEquals(c1.getGmlId(), c2.getGmlId());
assertEquals(c1.getFeatureType(), c2.getFeatureType());
assertEquals(c1.getGmlObject().getId(), c2.getGmlObject().getId());
CityObjectCollector collector = new CityObjectCollector();
c1.accept(collector);
Set<CityObject> coB = collector.getCityObjects();
collector = new CityObjectCollector();
c2.accept(collector);
Set<CityObject> coB2 = collector.getCityObjects();
assertEquals(coB.size(), coB2.size());
}
@Test
public void testRoundtripSimpleSolid() throws CityGmlParseException, InvalidGmlFileException {
ParserConfiguration config = new ParserConfiguration(8, false);
CityDoctorModel model = CityGmlParser.parseCityGmlFile("src/test/resources/SimpleSolid_SrefBS.gml", config);
Building b = model.getBuildings().toList().get(0);
assertNotNull(b);
Building b2 = SerializationUtils.roundtrip(b);
assertNotNull(b2);
assertCityObjectEquality(b, b2);
}
@Test
public void testRoundtripFzk() throws CityGmlParseException, InvalidGmlFileException {
ParserConfiguration config = new ParserConfiguration(8, false);
CityDoctorModel model = CityGmlParser.parseCityGmlFile("src/test/resources/FZK_haus.gml", config);
Building b = model.getBuildings().toList().get(0);
assertNotNull(b);
Building b2 = SerializationUtils.roundtrip(b);
assertCityObjectEquality(b, b2);
}
}
......@@ -51,11 +51,9 @@ import de.hft.stuttgart.citydoctor2.parser.ParserConfiguration;
public class BoundarySurfaceTest {
//Todo: Check this class for rework potential with the new Visitors
@Test
public void testVisitorPropagation() {
BoundarySurface bs = new BoundarySurface(SurfaceFeatureType.BUILDING, BoundarySurfaceType.WALL, null);
BoundarySurface bs = new BoundarySurface(BoundarySurfaceType.WALL, null);
Opening oMock = Mockito.mock(Opening.class);
bs.addOpening(oMock);
......@@ -68,7 +66,7 @@ public class BoundarySurfaceTest {
@Test
public void testAccept() {
BoundarySurface bs = new BoundarySurface(SurfaceFeatureType.BUILDING, BoundarySurfaceType.WALL, null);
BoundarySurface bs = new BoundarySurface(BoundarySurfaceType.WALL, null);
Opening oMock = Mockito.mock(Opening.class);
bs.addOpening(oMock);
AtomicInteger bsCounter = new AtomicInteger(0);
......@@ -86,7 +84,7 @@ public class BoundarySurfaceTest {
@Test
public void testAcceptWithoutFittingCheck() {
BoundarySurface bs = new BoundarySurface(SurfaceFeatureType.BUILDING, BoundarySurfaceType.WALL, null);
BoundarySurface bs = new BoundarySurface(BoundarySurfaceType.WALL, null);
Opening oMock = Mockito.mock(Opening.class);
bs.addOpening(oMock);
AtomicInteger bsCounter = new AtomicInteger(0);
......@@ -104,7 +102,7 @@ public class BoundarySurfaceTest {
@Test
public void testPrepareForChecking() {
BoundarySurface bs = new BoundarySurface(SurfaceFeatureType.BUILDING, BoundarySurfaceType.WALL, null);
BoundarySurface bs = new BoundarySurface(BoundarySurfaceType.WALL, null);
Geometry geom = new Geometry(GeometryType.MULTI_SURFACE, Lod.LOD2, Orientation.OUTWARD);
Geometry spyGeom = Mockito.spy(geom);
bs.addGeometry(spyGeom);
......@@ -114,7 +112,7 @@ public class BoundarySurfaceTest {
@Test
public void testContainsError() {
BoundarySurface bs = new BoundarySurface(SurfaceFeatureType.BUILDING, BoundarySurfaceType.WALL, null);
BoundarySurface bs = new BoundarySurface(BoundarySurfaceType.WALL, null);
assertFalse(bs.containsError(CheckId.C_GE_P_HOLE_OUTSIDE));
bs.addCheckResult(
new CheckResult(CheckId.C_GE_P_HOLE_OUTSIDE, ResultStatus.ERROR, Mockito.mock(CheckError.class)));
......@@ -124,9 +122,9 @@ public class BoundarySurfaceTest {
@Test
public void testContainsErrorInOpening() {
BoundarySurface bs = new BoundarySurface(SurfaceFeatureType.BUILDING, BoundarySurfaceType.WALL, null);
BoundarySurface bs = new BoundarySurface(BoundarySurfaceType.WALL, null);
assertFalse(bs.containsError(CheckId.C_GE_P_HOLE_OUTSIDE));
Opening o = new Opening(OpeningType.WINDOW, SurfaceFeatureType.BUILDING, bs, null);
Opening o = new Opening(OpeningType.WINDOW, bs, null);
bs.addOpening(o);
o.addCheckResult(
new CheckResult(CheckId.C_GE_P_HOLE_OUTSIDE, ResultStatus.ERROR, Mockito.mock(CheckError.class)));
......@@ -136,7 +134,7 @@ public class BoundarySurfaceTest {
@Test
public void testClearAllContainedCheckResults() {
BoundarySurface bs = new BoundarySurface(SurfaceFeatureType.BUILDING, BoundarySurfaceType.WALL, null);
BoundarySurface bs = new BoundarySurface(BoundarySurfaceType.WALL, null);
Opening oMock = Mockito.mock(Opening.class);
bs.addCheckResult(
new CheckResult(CheckId.C_GE_P_HOLE_OUTSIDE, ResultStatus.ERROR, Mockito.mock(CheckError.class)));
......@@ -149,7 +147,7 @@ public class BoundarySurfaceTest {
@Test
public void testContainsAnyError() {
BoundarySurface bs = new BoundarySurface(SurfaceFeatureType.BUILDING, BoundarySurfaceType.WALL, null);
BoundarySurface bs = new BoundarySurface(BoundarySurfaceType.WALL, null);
assertFalse(bs.containsAnyError());
bs.addCheckResult(
new CheckResult(CheckId.C_GE_P_HOLE_OUTSIDE, ResultStatus.ERROR, Mockito.mock(CheckError.class)));
......@@ -159,19 +157,18 @@ public class BoundarySurfaceTest {
@Test
public void testCollectContainedErrors() {
BoundarySurface bs = new BoundarySurface(SurfaceFeatureType.BUILDING, BoundarySurfaceType.WALL, null);
BoundarySurface bs = new BoundarySurface(BoundarySurfaceType.WALL, null);
bs.addCheckResult(
new CheckResult(CheckId.C_GE_P_HOLE_OUTSIDE, ResultStatus.ERROR, Mockito.mock(CheckError.class)));
List<CheckError> errors = new ArrayList<>();
bs.collectContainedErrors(errors);
assertEquals(1, errors.size());
;
}
@Test
public void testReCreateGeometriesWithoutId() {
WallSurface ws = new WallSurface();
BoundarySurface bs = new BoundarySurface(SurfaceFeatureType.BUILDING, BoundarySurfaceType.WALL, ws);
BoundarySurface bs = new BoundarySurface(BoundarySurfaceType.WALL, ws);
bs.reCreateGeometries(GeometryFactory.newInstance(), new ParserConfiguration(8, false));
assertNotNull(ws.getId());
}
......@@ -180,7 +177,7 @@ public class BoundarySurfaceTest {
public void testReCreateGeometriesWithId() {
WallSurface ws = new WallSurface();
ws.setId("test");
BoundarySurface bs = new BoundarySurface(SurfaceFeatureType.BUILDING, BoundarySurfaceType.WALL, ws);
BoundarySurface bs = new BoundarySurface(BoundarySurfaceType.WALL, ws);
bs.reCreateGeometries(GeometryFactory.newInstance(), new ParserConfiguration(8, false));
// nothing has changed
assertEquals("test", ws.getId());
......@@ -190,89 +187,52 @@ public class BoundarySurfaceTest {
}
@Test
public void testReCreateGeometriesMultiSurfaceLod2() {
WallSurface ws = new WallSurface();
BoundarySurface bs = new BoundarySurface(SurfaceFeatureType.BUILDING, BoundarySurfaceType.WALL, ws);
bs.addGeometry(GeometryTestUtils.createDummyGeometry(GeometryType.MULTI_SURFACE));
bs.reCreateGeometries(GeometryFactory.newInstance(), new ParserConfiguration(8, false));
assertNotNull(ws.getLod2MultiSurface());
assertNull(ws.getLod3MultiSurface());
assertNull(ws.getDeprecatedProperties().getLod4MultiSurface());
}
@Test
public void testReCreateGeometriesMultiSurfaceBridgeLod2() {
WallSurface ws = new WallSurface();
BoundarySurface bs = new BoundarySurface(SurfaceFeatureType.BRIDGE, BoundarySurfaceType.WALL, ws);
bs.addGeometry(GeometryTestUtils.createDummyGeometry(GeometryType.MULTI_SURFACE));
bs.reCreateGeometries(GeometryFactory.newInstance(), new ParserConfiguration(8, false));
assertNotNull(ws.getLod2MultiSurface());
assertNull(ws.getLod3MultiSurface());
assertNull(ws.getDeprecatedProperties().getLod4MultiSurface());
}
@Test
public void testReCreateGeometriesMultiSurfaceBridgeLod3() {
public void testReCreateGeometriesMultiSurfaceLod0() {
WallSurface ws = new WallSurface();
BoundarySurface bs = new BoundarySurface(SurfaceFeatureType.BRIDGE, BoundarySurfaceType.WALL, ws);
bs.addGeometry(GeometryTestUtils.createDummyGeometry(GeometryType.MULTI_SURFACE, Lod.LOD3));
BoundarySurface bs = new BoundarySurface(BoundarySurfaceType.WALL, ws);
bs.addGeometry(GeometryTestUtils.createDummyGeometry(GeometryType.MULTI_SURFACE, Lod.LOD0));
bs.reCreateGeometries(GeometryFactory.newInstance(), new ParserConfiguration(8, false));
assertNotNull(ws.getLod0MultiSurface());
assertNull(ws.getLod1MultiSurface());
assertNull(ws.getLod2MultiSurface());
assertNotNull(ws.getLod3MultiSurface());
assertNull(ws.getLod3MultiSurface());
assertNull(ws.getDeprecatedProperties().getLod4MultiSurface());
}
@Test
public void testReCreateGeometriesMultiSurfaceBridgeLod4() {
public void testReCreateGeometriesMultiSurfaceLod1() {
WallSurface ws = new WallSurface();
BoundarySurface bs = new BoundarySurface(SurfaceFeatureType.BRIDGE, BoundarySurfaceType.WALL, ws);
bs.addGeometry(GeometryTestUtils.createDummyGeometry(GeometryType.MULTI_SURFACE, Lod.LOD4));
BoundarySurface bs = new BoundarySurface(BoundarySurfaceType.WALL, ws);
bs.addGeometry(GeometryTestUtils.createDummyGeometry(GeometryType.MULTI_SURFACE, Lod.LOD1));
bs.reCreateGeometries(GeometryFactory.newInstance(), new ParserConfiguration(8, false));
assertNull(ws.getLod0MultiSurface());
assertNotNull(ws.getLod1MultiSurface());
assertNull(ws.getLod2MultiSurface());
assertNull(ws.getLod3MultiSurface());
assertNotNull(ws.getDeprecatedProperties().getLod4MultiSurface());
assertNull(ws.getDeprecatedProperties().getLod4MultiSurface());
}
@Test
public void testReCreateGeometriesMultiSurfaceTunnelLod2() {
public void testReCreateGeometriesMultiSurfaceLod2() {
WallSurface ws = new WallSurface();
BoundarySurface bs = new BoundarySurface(SurfaceFeatureType.TUNNEL, BoundarySurfaceType.WALL, ws);
BoundarySurface bs = new BoundarySurface(BoundarySurfaceType.WALL, ws);
bs.addGeometry(GeometryTestUtils.createDummyGeometry(GeometryType.MULTI_SURFACE));
bs.reCreateGeometries(GeometryFactory.newInstance(), new ParserConfiguration(8, false));
assertNull(ws.getLod0MultiSurface());
assertNull(ws.getLod1MultiSurface());
assertNotNull(ws.getLod2MultiSurface());
assertNull(ws.getLod3MultiSurface());
assertNull(ws.getDeprecatedProperties().getLod4MultiSurface());
}
@Test
public void testReCreateGeometriesMultiSurfaceTunnelLod3() {
WallSurface ws = new WallSurface();
BoundarySurface bs = new BoundarySurface(SurfaceFeatureType.TUNNEL, BoundarySurfaceType.WALL, ws);
bs.addGeometry(GeometryTestUtils.createDummyGeometry(GeometryType.MULTI_SURFACE, Lod.LOD3));
bs.reCreateGeometries(GeometryFactory.newInstance(), new ParserConfiguration(8, false));
assertNull(ws.getLod2MultiSurface());
assertNotNull(ws.getLod3MultiSurface());
assertNull(ws.getDeprecatedProperties().getLod4MultiSurface());
}
@Test
public void testReCreateGeometriesMultiSurfaceTunnelLod4() {
WallSurface ws = new WallSurface();
BoundarySurface bs = new BoundarySurface(SurfaceFeatureType.TUNNEL, BoundarySurfaceType.WALL, ws);
bs.addGeometry(GeometryTestUtils.createDummyGeometry(GeometryType.MULTI_SURFACE, Lod.LOD4));
bs.reCreateGeometries(GeometryFactory.newInstance(), new ParserConfiguration(8, false));
assertNull(ws.getLod2MultiSurface());
assertNull(ws.getLod3MultiSurface());
assertNotNull(ws.getDeprecatedProperties().getLod4MultiSurface());
}
@Test
public void testReCreateGeometriesMultiSurfaceLod3() {
WallSurface ws = new WallSurface();
ws.setId("test");
BoundarySurface bs = new BoundarySurface(SurfaceFeatureType.BUILDING, BoundarySurfaceType.WALL, ws);
BoundarySurface bs = new BoundarySurface( BoundarySurfaceType.WALL, ws);
bs.addGeometry(GeometryTestUtils.createDummyGeometry(GeometryType.MULTI_SURFACE, Lod.LOD3));
bs.reCreateGeometries(GeometryFactory.newInstance(), new ParserConfiguration(8, false));
assertNull(ws.getLod0MultiSurface());
assertNull(ws.getLod1MultiSurface());
assertNull(ws.getLod2MultiSurface());
assertNotNull(ws.getLod3MultiSurface());
assertNull(ws.getDeprecatedProperties().getLod4MultiSurface());
......@@ -281,30 +241,21 @@ public class BoundarySurfaceTest {
@Test
public void testReCreateGeometriesMultiSurfaceLod4() {
WallSurface ws = new WallSurface();
ws.setId("test");
BoundarySurface bs = new BoundarySurface(SurfaceFeatureType.BUILDING, BoundarySurfaceType.WALL, ws);
BoundarySurface bs = new BoundarySurface(BoundarySurfaceType.WALL, ws);
bs.addGeometry(GeometryTestUtils.createDummyGeometry(GeometryType.MULTI_SURFACE, Lod.LOD4));
bs.reCreateGeometries(GeometryFactory.newInstance(), new ParserConfiguration(8, false));
assertNull(ws.getLod0MultiSurface());
assertNull(ws.getLod1MultiSurface());
assertNull(ws.getLod2MultiSurface());
assertNull(ws.getLod3MultiSurface());
assertNotNull(ws.getDeprecatedProperties().getLod4MultiSurface());
}
@Test
public void testReCreateGeometriesMultiSurfaceLod0() {
WallSurface ws = new WallSurface();
ws.setId("test");
BoundarySurface bs = new BoundarySurface(SurfaceFeatureType.BUILDING, BoundarySurfaceType.WALL, ws);
bs.addGeometry(GeometryTestUtils.createDummyGeometry(GeometryType.MULTI_SURFACE, Lod.LOD0));
bs.reCreateGeometries(GeometryFactory.newInstance(), new ParserConfiguration(8, false));
assertNotNull(ws.getLod0MultiSurface());
}
@Test(expected = IllegalStateException.class)
public void testReCreateGeometriesSolid() {
WallSurface ws = new WallSurface();
ws.setId("test");
BoundarySurface bs = new BoundarySurface(SurfaceFeatureType.BUILDING, BoundarySurfaceType.WALL, ws);
BoundarySurface bs = new BoundarySurface(BoundarySurfaceType.WALL, ws);
bs.addGeometry(GeometryTestUtils.createDummyGeometry(GeometryType.SOLID));
bs.reCreateGeometries(GeometryFactory.newInstance(), new ParserConfiguration(8, false));
}
......@@ -312,8 +263,7 @@ public class BoundarySurfaceTest {
@Test
public void testReCreateGeometriesOpenings() {
WallSurface ws = new WallSurface();
ws.setId("test");
BoundarySurface bs = new BoundarySurface(SurfaceFeatureType.BUILDING, BoundarySurfaceType.WALL, ws);
BoundarySurface bs = new BoundarySurface(BoundarySurfaceType.WALL, ws);
Opening oMock = Mockito.mock(Opening.class);
bs.addOpening(oMock);
GeometryFactory factory = GeometryFactory.newInstance();
......@@ -325,7 +275,7 @@ public class BoundarySurfaceTest {
@Test
public void testGetGmlObject() {
WallSurface ws = new WallSurface();
BoundarySurface bs = new BoundarySurface(SurfaceFeatureType.BUILDING, BoundarySurfaceType.WALL, ws);
BoundarySurface bs = new BoundarySurface(BoundarySurfaceType.WALL, ws);
assertEquals(ws, bs.getGmlObject());
}
......@@ -338,7 +288,7 @@ public class BoundarySurfaceTest {
assertNotNull(ws.getLod2MultiSurface());
assertNotNull(ws.getLod3MultiSurface());
assertNotNull(ws.getDeprecatedProperties().getLod4MultiSurface());
BoundarySurface bs = new BoundarySurface(SurfaceFeatureType.BUILDING, BoundarySurfaceType.WALL, ws);
BoundarySurface bs = new BoundarySurface(BoundarySurfaceType.WALL, ws);
Opening oMock = Mockito.mock(Opening.class);
bs.addOpening(oMock);
bs.accept(new UnsetGeometriesVisitor());
......@@ -348,41 +298,9 @@ public class BoundarySurfaceTest {
assertNull(ws.getDeprecatedProperties().getLod4MultiSurface());
}
@Test
public void testUnsetGmlGeometriesBridge() {
WallSurface ws = new WallSurface();
ws.setLod2MultiSurface(new MultiSurfaceProperty());
ws.setLod3MultiSurface(new MultiSurfaceProperty());
ws.getDeprecatedProperties().setLod4MultiSurface(new MultiSurfaceProperty());
assertNotNull(ws.getLod2MultiSurface());
assertNotNull(ws.getLod3MultiSurface());
assertNotNull(ws.getDeprecatedProperties().getLod4MultiSurface());
BoundarySurface bs = new BoundarySurface(SurfaceFeatureType.BRIDGE, BoundarySurfaceType.WALL, ws);
bs.unsetGmlGeometries();
assertNull(ws.getLod2MultiSurface());
assertNull(ws.getLod3MultiSurface());
assertNull(ws.getDeprecatedProperties().getLod4MultiSurface());
}
@Test
public void testUnsetGmlGeometriesTunnel() {
WallSurface ws = new WallSurface();
ws.setLod2MultiSurface(new MultiSurfaceProperty());
ws.setLod3MultiSurface(new MultiSurfaceProperty());
ws.getDeprecatedProperties().setLod4MultiSurface(new MultiSurfaceProperty());
assertNotNull(ws.getLod2MultiSurface());
assertNotNull(ws.getLod3MultiSurface());
assertNotNull(ws.getDeprecatedProperties().getLod4MultiSurface());
BoundarySurface bs = new BoundarySurface(SurfaceFeatureType.TUNNEL, BoundarySurfaceType.WALL, ws);
bs.unsetGmlGeometries();
assertNull(ws.getLod2MultiSurface());
assertNull(ws.getLod3MultiSurface());
assertNull(ws.getDeprecatedProperties().getLod4MultiSurface());
}
@Test
public void testGetFeatureType() {
BoundarySurface bs = new BoundarySurface(SurfaceFeatureType.TUNNEL, BoundarySurfaceType.WALL, null);
BoundarySurface bs = new BoundarySurface(BoundarySurfaceType.WALL, null);
assertEquals(FeatureType.BOUNDARY_SURFACE, bs.getFeatureType());
}
......@@ -393,16 +311,10 @@ public class BoundarySurfaceTest {
assertEquals(aco, bs.getGmlObject());
}
@Test
public void testSetFeatureType() {
BoundarySurface bs = new BoundarySurface(SurfaceFeatureType.TUNNEL, BoundarySurfaceType.WALL, null);
bs.setFeatureType(SurfaceFeatureType.BRIDGE);
assertEquals(SurfaceFeatureType.BRIDGE, bs.getSurfaceFeatureType());
}
@Test
public void testSetType() {
BoundarySurface bs = new BoundarySurface(SurfaceFeatureType.TUNNEL, BoundarySurfaceType.WALL, null);
BoundarySurface bs = new BoundarySurface(BoundarySurfaceType.WALL, null);
bs.setType(BoundarySurfaceType.ROOF);
assertEquals(BoundarySurfaceType.ROOF, bs.getType());
}
......
......@@ -51,7 +51,6 @@ import de.hft.stuttgart.citydoctor2.utils.visitors.UnsetGeometriesVisitor;
public class BridgeObjectTest {
//TODO: Rework this class with the new Visitors
@Test
public void testAccept() {
......
......@@ -64,7 +64,7 @@ public class BuildingTest {
b.setCityGmlBuilding(createCityGmlBuilding());
RoofSurface rs = new RoofSurface();
rs.setId("testRoof");
BoundarySurface surface = new BoundarySurface(SurfaceFeatureType.BUILDING, BoundarySurfaceType.ROOF, rs);
BoundarySurface surface = new BoundarySurface(BoundarySurfaceType.ROOF, rs);
Geometry geomSurface = new Geometry(GeometryType.MULTI_SURFACE, Lod.LOD2, Orientation.OUTWARD);
geomSurface.addPolygon(new LinkedPolygon(p, geomSurface));
geomSurface.updateEdgesAndVertices();
......@@ -76,6 +76,7 @@ public class BuildingTest {
assertEquals(b.getGmlId(), copy.getGmlId());
copy.prepareForChecking();
Geometry copyGeom = copy.getGeometries().get(0);
assertNotSame(geom, copyGeom);
......
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