diff --git a/CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/utils/BoundingBoxCalculator.java b/CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/utils/BoundingBoxCalculator.java index c9d36e94ab9e85992055bacc9884651ed124a1fd..5ff2bf86d2ce9000aef0974a1557daae6b20b349 100644 --- a/CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/utils/BoundingBoxCalculator.java +++ b/CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/utils/BoundingBoxCalculator.java @@ -116,7 +116,7 @@ public class BoundingBoxCalculator { private static void findMinMax(Vector3d low, Vector3d high, CityObject co) { for (Geometry geom : co.getGeometries()) { if (geom.getVertices() == null) { - continue; + geom.updateVertices(); } for (Vertex v : geom.getVertices()) { if (v.getX() < low.getX()) { diff --git a/CityDoctorParent/CityDoctorValidation/src/test/resources/schematronTest.xml b/CityDoctorParent/CityDoctorValidation/src/test/resources/schematronTest.xml index 39c81af1a05113c69a1d77aa093622cca0e0b57e..7049740c2f338b81b14587640bbbb296e9d7763a 100644 --- a/CityDoctorParent/CityDoctorValidation/src/test/resources/schematronTest.xml +++ b/CityDoctorParent/CityDoctorValidation/src/test/resources/schematronTest.xml @@ -1,19 +1,17 @@ <?xml version="1.0" encoding="UTF-8"?> <schema xmlns="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2"> - <!-- semantic requirements SimStadt monthly energy balance --> <ns prefix="gml" uri="http://www.opengis.net/gml"/> <ns prefix="bldg" uri="http://www.opengis.net/citygml/building/2.0"/> <pattern> - <rule context="//Building | //bldg:Building"> - <assert test="@gml:id | @id">Attribute gml:id is missing in one building. </assert> - <assert test="count(lod1Solid) = 1"><value-of select="@gml:id | @id"/>: SE_MISSING_ELEMENT lod1Solid</assert> - <assert test="count(yearOfConstruction) >= 1"><value-of select="@gml:id | @id"/>: SE_MISSING_ELEMENT yearOfConstruction</assert> - <assert test="count(function) = 1"><value-of select="@gml:id | @id"/>: SE_MISSING_ELEMENT function</assert> - </rule> - <rule context="//BuildingPart | //bldg:BuildingPart"> - <assert test="@gml:id | @id"><value-of select="@gml:id | @id"/>: Attribute gml:id is missing in one building part.</assert> - <assert test="count(lod1Solid) = 1"><value-of select="@gml:id | @id"/>: SE_MISSING_ELEMENT lod1Solid</assert> + <rule context="//*:Building"> + <assert test="count(*:lod2Solid) = 1"><value-of select="@gml:id | @id"/>||||SEM_ATTRIBUTE_MISSING||lod1Solid||false</assert> + <assert test="count(*:yearOfConstruction) >= 1"><value-of select="@gml:id | @id"/>||||SEM_ATTRIBUTE_MISSING||yearOfConstruction||false</assert> + <assert test="count(*:function) = 1"><value-of select="@gml:id | @id"/>||||SEM_ATTRIBUTE_MISSING||function||false</assert> + <assert test="*:doubleAttribute[@name = 'Volume'] > 0 and *:doubleAttribute[@name = 'Volume'] < 5000"><value-of select="@gml:id | @id"/>||||SEM_ATTRIBUTE_WRONG_VALUE||volume||true</assert> </rule> + <rule context="//*:Building//*:RoofSurface"> + <assert test="count(function) = 1"><value-of select="ancestor::*:Building/@*:id"/>||<value-of select="@gml:id | @id"/>||SEM_ATTRIBUTE_MISSING||function||false</assert> + </rule> </pattern> </schema>