Commit bdb267ae authored by Matthias Betz's avatar Matthias Betz
Browse files

Merge branch 'master' into dev

parents 5b46132b 0b601bff
Pipeline #8775 passed with stage
in 54 seconds
......@@ -18,16 +18,39 @@
*/
package de.hft.stuttgart.citydoctor2.utils;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
public class Copy {
private Copy() {
}
@SuppressWarnings("unchecked")
public static <T extends Copyable> T copy(T original) {
CopyHandler handler = new CopyHandler();
return handler.copy(original);
ByteArrayOutputStream out = new ByteArrayOutputStream();
try {
ObjectOutputStream oos = new ObjectOutputStream(out);
oos.writeObject(original);
oos.flush();
oos.close();
byte[] byteArray = out.toByteArray();
ByteArrayInputStream in = new ByteArrayInputStream(byteArray);
ObjectInputStream ois = new ObjectInputStream(in);
return (T) ois.readObject();
} catch (IOException e) {
e.printStackTrace();
} catch (ClassNotFoundException e) {
e.printStackTrace();
}
throw new IllegalStateException();
// CopyHandler handler = new CopyHandler();
// return handler.copy(original);
}
}
......@@ -18,6 +18,7 @@
*/
package de.hft.stuttgart.citydoctor2.utils;
import java.io.Serializable;
import java.util.List;
import de.hft.stuttgart.citydoctor2.datastructure.ConcretePolygon;
......@@ -30,7 +31,9 @@ import de.hft.stuttgart.citydoctor2.math.Segment3d;
* @author Matthias Betz
*
*/
public class PolygonIntersection {
public class PolygonIntersection implements Serializable {
private static final long serialVersionUID = -6301963226688351725L;
public enum IntersectionType {
NONE, LINE, POLYGON
......
......@@ -26,12 +26,14 @@ import org.junit.Test;
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;
public class CopyTest {
@Test
public void testCopy() {
Geometry geometry = GeometryTestUtils.createDummyGeometry(GeometryType.COMPOSITE_SURFACE);
geometry.setGmlId(new GmlId("test"));
Geometry copy = Copy.copy(geometry);
assertEquals(geometry.getType(), copy.getType());
assertEquals(geometry.getLod(), copy.getLod());
......
......@@ -4,10 +4,16 @@
CityDoctor2 is a Java program for validating CityGML files. It checks whether certain criteria for e.g. geometries are met and outputs a report on the results.
## Installation
## Releases
You can download releases from the BHT page [here](https://projekt.bht-berlin.de/citydoctor2/downloads/) or from a git repository [here](https://gitlab.com/volkercoors/CiD4Sim/-/tree/master/CityDoctorExtension).
Since version 3.12.0 CityDoctor2 requires java version 17, older version are based on version 1.8. The GUI version requires Javafx which is included in Java 1.8 but not in Java 17. You can download a Java version with Javafx included from [here](https://bell-sw.com/pages/downloads/#/java-17-lts). Choose your platform and then choose to download the full JRE or JDK which includes Javafx.
The releases include builds for the validation library (CityDoctorValidation-x.x.x) and the grahpic user interface (CityDoctorGUI-x.x.x). While the GUI is not open source it is free to use.
## Build
Use [Maven](https://maven.apache.org/) to build CityDoctor2.
```bash
......@@ -19,9 +25,10 @@ CityDoctor2 uses the [quality ade plugin](https://transfer.hft-stuttgart.de/gitl
## Usage
Since version 3.12.0 CityDoctor2 requires java version 17, older version are based on version 1.8.
Once built there is a CityDoctorValidation-\<version\>.zip file in the target folder of the CityDoctorValidation folder in which the CityDoctorValidation jar can be used to start the program.
There is a start script included in the binary releases of citydoctor. An example start command looks like this:
```bash
java -classpath libs/*;plugins/*;CityDoctorValidation-<version>.jar de.hft.stuttgart.citydoctor2.CityDoctorValidation -in <path-to-gml-file>.gml -config <path-to-validation-config>.yml -xmlReport <path-to-xml-output>.xml -pdfReport <path-to-pdf-output>.pdf -out <path-to-output-gml>.gml
```
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment