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

Release 3.7.0

fixed writing composite surface in building installations
parent f696936c
Pipeline #1914 failed with stage
in 19 seconds
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<parent> <parent>
<groupId>de.hft.stuttgart</groupId> <groupId>de.hft.stuttgart</groupId>
<artifactId>CityDoctorParent</artifactId> <artifactId>CityDoctorParent</artifactId>
<version>3.7.0-SNAPSHOT</version> <version>3.7.0</version>
</parent> </parent>
<artifactId>CityDoctorCheckResult</artifactId> <artifactId>CityDoctorCheckResult</artifactId>
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<parent> <parent>
<groupId>de.hft.stuttgart</groupId> <groupId>de.hft.stuttgart</groupId>
<artifactId>CityDoctorParent</artifactId> <artifactId>CityDoctorParent</artifactId>
<version>3.7.0-SNAPSHOT</version> <version>3.7.0</version>
</parent> </parent>
<artifactId>CityDoctorEdge</artifactId> <artifactId>CityDoctorEdge</artifactId>
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<parent> <parent>
<groupId>de.hft.stuttgart</groupId> <groupId>de.hft.stuttgart</groupId>
<artifactId>CityDoctorParent</artifactId> <artifactId>CityDoctorParent</artifactId>
<version>3.7.0-SNAPSHOT</version> <version>3.7.0</version>
</parent> </parent>
<properties> <properties>
......
...@@ -24,8 +24,11 @@ import java.util.List; ...@@ -24,8 +24,11 @@ import java.util.List;
import org.citygml4j.factory.GMLGeometryFactory; import org.citygml4j.factory.GMLGeometryFactory;
import org.citygml4j.model.citygml.building.AbstractBoundarySurface; import org.citygml4j.model.citygml.building.AbstractBoundarySurface;
import org.citygml4j.model.citygml.building.BoundarySurfaceProperty; import org.citygml4j.model.citygml.building.BoundarySurfaceProperty;
import org.citygml4j.model.gml.geometry.GeometryProperty;
import org.citygml4j.model.gml.geometry.aggregates.MultiSurface; import org.citygml4j.model.gml.geometry.aggregates.MultiSurface;
import org.citygml4j.model.gml.geometry.aggregates.MultiSurfaceProperty; import org.citygml4j.model.gml.geometry.aggregates.MultiSurfaceProperty;
import org.citygml4j.model.gml.geometry.complexes.CompositeSurface;
import org.citygml4j.model.gml.geometry.complexes.CompositeSurfaceProperty;
import de.hft.stuttgart.citydoctor2.check.Check; import de.hft.stuttgart.citydoctor2.check.Check;
import de.hft.stuttgart.citydoctor2.check.CheckError; import de.hft.stuttgart.citydoctor2.check.CheckError;
...@@ -48,8 +51,11 @@ public class BuildingInstallation extends CityObject { ...@@ -48,8 +51,11 @@ public class BuildingInstallation extends CityObject {
if (geom.getType() == GeometryType.MULTI_SURFACE) { if (geom.getType() == GeometryType.MULTI_SURFACE) {
MultiSurface ms = CityGmlUtils.createMultiSurface(geom, factory, config); MultiSurface ms = CityGmlUtils.createMultiSurface(geom, factory, config);
setGeometryAccordingToLod(geom.getLod(), new MultiSurfaceProperty(ms)); setGeometryAccordingToLod(geom.getLod(), new MultiSurfaceProperty(ms));
} else if (geom.getType() == GeometryType.COMPOSITE_SURFACE) {
CompositeSurface cs = CityGmlUtils.createCompositeSurface(geom, factory, config);
setGeometryAccordingToLod(geom.getLod(), new CompositeSurfaceProperty(cs));
} else { } else {
throw new IllegalStateException("BuildingInstallation can only have MultiSurface geometries"); throw new IllegalStateException("BuildingInstallation not have Solid geometries");
} }
} }
for (BoundarySurface bs : boundarySurfaces) { for (BoundarySurface bs : boundarySurfaces) {
...@@ -62,7 +68,7 @@ public class BuildingInstallation extends CityObject { ...@@ -62,7 +68,7 @@ public class BuildingInstallation extends CityObject {
throw new UnsupportedOperationException("Cannot copy BuildingInstallation"); throw new UnsupportedOperationException("Cannot copy BuildingInstallation");
} }
private void setGeometryAccordingToLod(Lod lod, MultiSurfaceProperty ms) { private void setGeometryAccordingToLod(Lod lod, GeometryProperty<?> ms) {
switch (lod) { switch (lod) {
case LOD2: case LOD2:
gmlBi.setLod2Geometry(ms); gmlBi.setLod2Geometry(ms);
......
...@@ -176,4 +176,19 @@ public final class CityGmlUtils { ...@@ -176,4 +176,19 @@ public final class CityGmlUtils {
return new MultiSurface(surfaces); return new MultiSurface(surfaces);
} }
public static CompositeSurface createCompositeSurface(Geometry geom, GMLGeometryFactory factory,
ParserConfiguration config) {
List<AbstractSurface> surfaces = new ArrayList<>();
for (Polygon cdPoly : geom.getPolygons()) {
org.citygml4j.model.gml.geometry.primitives.Polygon gmlPoly = createGmlPolygon(factory, cdPoly, config);
if (gmlPoly != null) {
surfaces.add(gmlPoly);
}
}
if (surfaces.isEmpty()) {
return null;
}
return new CompositeSurface(surfaces);
}
} }
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<parent> <parent>
<groupId>de.hft.stuttgart</groupId> <groupId>de.hft.stuttgart</groupId>
<artifactId>CityDoctorParent</artifactId> <artifactId>CityDoctorParent</artifactId>
<version>3.7.0-SNAPSHOT</version> <version>3.7.0</version>
</parent> </parent>
<artifactId>CityDoctorValidation</artifactId> <artifactId>CityDoctorValidation</artifactId>
<name>CityDoctorValidation</name> <name>CityDoctorValidation</name>
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>de.hft.stuttgart</groupId> <groupId>de.hft.stuttgart</groupId>
<artifactId>CityDoctorParent</artifactId> <artifactId>CityDoctorParent</artifactId>
<version>3.7.0-SNAPSHOT</version> <version>3.7.0</version>
<packaging>pom</packaging> <packaging>pom</packaging>
<name>CityDoctorParent</name> <name>CityDoctorParent</name>
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source> <maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target> <maven.compiler.target>1.8</maven.compiler.target>
<revision>3.7.0-SNAPSHOT</revision> <revision>${project.version}</revision>
</properties> </properties>
<build> <build>
......
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