Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
CityDoctor
QualityADE
Commits
98b386d2
Commit
98b386d2
authored
Nov 21, 2021
by
Claus Nagel
Browse files
updated citygml4j module to support QualityADE version 0.1.4
parent
6cf1abce
Changes
209
Hide whitespace changes
Inline
Side-by-side
citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/model/jaxb/package-info.java
deleted
100644 → 0
View file @
6cf1abce
/*-
* Copyright 2020 Hochschule für Technik Stuttgart
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
@javax
.
xml
.
bind
.
annotation
.
XmlSchema
(
namespace
=
"https://transfer.hft-stuttgart.de/pages/citydoctor/qualityade/0.1.3"
,
elementFormDefault
=
javax
.
xml
.
bind
.
annotation
.
XmlNsForm
.
QUALIFIED
,
xmlns
=
{
@javax
.
xml
.
bind
.
annotation
.
XmlNs
(
namespaceURI
=
"https://transfer.hft-stuttgart.de/pages/citydoctor/qualityade/0.1.3"
,
prefix
=
"qual"
)
})
package
de.hft.stuttgart.quality.model.jaxb
;
citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/util/UncheckedMissingADESchemaException.java
deleted
100644 → 0
View file @
6cf1abce
/*-
* Copyright 2020 Hochschule für Technik Stuttgart
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
de.hft.stuttgart.quality.util
;
import
org.citygml4j.xml.io.reader.MissingADESchemaException
;
public
class
UncheckedMissingADESchemaException
extends
RuntimeException
{
private
static
final
long
serialVersionUID
=
-
5684499826072882203L
;
private
MissingADESchemaException
cause
;
public
UncheckedMissingADESchemaException
(
MissingADESchemaException
e
)
{
super
(
e
);
this
.
cause
=
e
;
}
@Override
public
synchronized
MissingADESchemaException
getCause
()
{
return
cause
;
}
}
citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/walker/FeatureFunctionWalker.java
0 → 100644
View file @
98b386d2
/*
* Copyright 2021 Hochschule für Technik Stuttgart
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
de.hft.stuttgart.quality.walker
;
import
de.hft.stuttgart.quality.model.Validation
;
import
org.citygml4j.model.citygml.ade.binding.ADEWalker
;
import
org.citygml4j.model.gml.feature.AbstractFeature
;
public
class
FeatureFunctionWalker
<
T
>
implements
ADEWalker
<
org
.
citygml4j
.
util
.
walker
.
FeatureFunctionWalker
<
T
>>
{
private
org
.
citygml4j
.
util
.
walker
.
FeatureFunctionWalker
<
T
>
walker
;
@Override
public
void
setParentWalker
(
org
.
citygml4j
.
util
.
walker
.
FeatureFunctionWalker
<
T
>
walker
)
{
this
.
walker
=
walker
;
}
public
T
apply
(
Validation
validation
)
{
return
walker
.
apply
((
AbstractFeature
)
validation
);
}
}
citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/
model/jaxb/Component
.java
→
citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/
walker/FeatureWalker
.java
View file @
98b386d2
/*
-
/*
* Copyright 202
0
Hochschule für Technik Stuttgart
* Copyright 202
1
Hochschule für Technik Stuttgart
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -13,25 +13,22 @@
...
@@ -13,25 +13,22 @@
* See the License for the specific language governing permissions and
* See the License for the specific language governing permissions and
* limitations under the License.
* limitations under the License.
*/
*/
package
de.hft.stuttgart.quality.model.jaxb
;
import
java.io.Serializable
;
package
de.hft.stuttgart.quality.walker
;
import
java.util.ArrayList
;
import
java.util.List
;
import
javax.xml.bind.annotation.XmlElement
;
import
de.hft.stuttgart.quality.model.Validation
;
import
org.citygml4j.model.citygml.ade.binding.ADEWalker
;
import
org.citygml4j.model.gml.feature.AbstractFeature
;
public
class
Component
implements
Serializable
{
public
class
FeatureWalker
implements
ADEWalker
<
org
.
citygml4j
.
util
.
walker
.
FeatureWalker
>
{
private
org
.
citygml4j
.
util
.
walker
.
FeatureWalker
walker
;
private
static
final
long
serialVersionUID
=
75005650370135888L
;
@Override
public
void
setParentWalker
(
org
.
citygml4j
.
util
.
walker
.
FeatureWalker
walker
)
{
this
.
walker
=
walker
;
}
@XmlElement
(
name
=
"polygonId"
)
public
void
visit
(
Validation
validation
)
{
private
List
<
String
>
polygonIds
;
walker
.
visit
((
AbstractFeature
)
validation
);
}
public
List
<
String
>
getPolygonIds
()
{
if
(
polygonIds
==
null
)
{
polygonIds
=
new
ArrayList
<>();
}
return
polygonIds
;
}
}
}
citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/walker/GMLFunctionWalker.java
0 → 100644
View file @
98b386d2
/*
* Copyright 2021 Hochschule für Technik Stuttgart
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
de.hft.stuttgart.quality.walker
;
import
de.hft.stuttgart.quality.model.Validation
;
import
org.citygml4j.model.citygml.ade.binding.ADEWalker
;
import
org.citygml4j.model.gml.feature.AbstractFeature
;
public
class
GMLFunctionWalker
<
T
>
implements
ADEWalker
<
org
.
citygml4j
.
util
.
walker
.
GMLFunctionWalker
<
T
>>
{
private
org
.
citygml4j
.
util
.
walker
.
GMLFunctionWalker
<
T
>
walker
;
@Override
public
void
setParentWalker
(
org
.
citygml4j
.
util
.
walker
.
GMLFunctionWalker
<
T
>
walker
)
{
this
.
walker
=
walker
;
}
public
T
apply
(
Validation
validation
)
{
return
walker
.
apply
((
AbstractFeature
)
validation
);
}
}
citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/
model/TooFewPolygons
.java
→
citygml4j-quality-ade/src/main/java/de/hft/stuttgart/quality/
walker/GMLWalker
.java
View file @
98b386d2
/*
-
/*
* Copyright 202
0
Hochschule für Technik Stuttgart
* Copyright 202
1
Hochschule für Technik Stuttgart
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -13,21 +13,22 @@
...
@@ -13,21 +13,22 @@
* See the License for the specific language governing permissions and
* See the License for the specific language governing permissions and
* limitations under the License.
* limitations under the License.
*/
*/
package
de.hft.stuttgart.quality.model
;
import
org.citygml4j.builder.copy.CopyBuild
er
;
package
de.hft.stuttgart.quality.walk
er
;
public
class
TooFewPolygons
extends
SolidError
{
import
de.hft.stuttgart.quality.model.Validation
;
import
org.citygml4j.model.citygml.ade.binding.ADEWalker
;
import
org.citygml4j.model.gml.feature.AbstractFeature
;
private
static
final
long
serialVersionUID
=
-
51591095439740599L
;
public
class
GMLWalker
implements
ADEWalker
<
org
.
citygml4j
.
util
.
walker
.
GMLWalker
>
{
private
org
.
citygml4j
.
util
.
walker
.
GMLWalker
walker
;
@Override
@Override
public
String
toString
(
)
{
public
void
setParentWalker
(
org
.
citygml4j
.
util
.
walker
.
GMLWalker
walker
)
{
return
"TooFewPolygons [geometryId="
+
getGeometryId
()
+
"]"
;
this
.
walker
=
walker
;
}
}
@Override
public
void
visit
(
Validation
validation
)
{
public
Object
copy
(
CopyBuilder
copyBuilder
)
{
walker
.
visit
((
AbstractFeature
)
validation
);
return
copyTo
(
new
TooFewPolygons
(),
copyBuilder
);
}
}
}
}
citygml4j-quality-ade/src/main/resources/de/hft/stuttgart/quality/schema/qualityAde.xsd
0 → 100644
View file @
98b386d2
<?xml version="1.0" encoding="UTF-8"?>
<schema
xmlns=
"http://www.w3.org/2001/XMLSchema"
xmlns:bldg=
"http://www.opengis.net/citygml/building/2.0"
xmlns:core=
"http://www.opengis.net/citygml/2.0"
xmlns:gml=
"http://www.opengis.net/gml"
xmlns:qual=
"https://transfer.hft-stuttgart.de/pages/citydoctor/qualityade/0.1.4"
elementFormDefault=
"qualified"
targetNamespace=
"https://transfer.hft-stuttgart.de/pages/citydoctor/qualityade/0.1.4"
version=
"0.1.4"
>
<import
namespace=
"http://www.opengis.net/citygml/2.0"
schemaLocation=
"http://schemas.opengis.net/citygml/2.0/cityGMLBase.xsd"
/>
<import
namespace=
"http://www.opengis.net/citygml/building/2.0"
schemaLocation=
"http://schemas.opengis.net/citygml/building/2.0/building.xsd"
/>
<import
namespace=
"http://www.opengis.net/gml"
schemaLocation=
"http://schemas.opengis.net/gml/3.1.1/base/gml.xsd"
/>
<!--XML Schema document created by ShapeChange - http://shapechange.net/-->
<element
abstract=
"true"
name=
"AbstractError"
substitutionGroup=
"gml:_Object"
type=
"qual:AbstractErrorType"
/>
<complexType
abstract=
"true"
name=
"AbstractErrorType"
>
<sequence/>
</complexType>
<complexType
name=
"AbstractErrorPropertyType"
>
<sequence>
<element
ref=
"qual:AbstractError"
/>
</sequence>
</complexType>
<element
abstract=
"true"
name=
"AbstractGeometryError"
substitutionGroup=
"qual:AbstractError"
type=
"qual:AbstractGeometryErrorType"
/>
<complexType
abstract=
"true"
name=
"AbstractGeometryErrorType"
>
<complexContent>
<extension
base=
"qual:AbstractErrorType"
>
<sequence/>
</extension>
</complexContent>
</complexType>
<complexType
name=
"AbstractGeometryErrorPropertyType"
>
<sequence>
<element
ref=
"qual:AbstractGeometryError"
/>
</sequence>
</complexType>
<element
abstract=
"true"
name=
"AbstractPolygonError"
substitutionGroup=
"qual:AbstractGeometryError"
type=
"qual:AbstractPolygonErrorType"
/>
<complexType
abstract=
"true"
name=
"AbstractPolygonErrorType"
>
<complexContent>
<extension
base=
"qual:AbstractGeometryErrorType"
>
<sequence>
<element
name=
"polygonId"
type=
"string"
/>
</sequence>
</extension>
</complexContent>
</complexType>
<complexType
name=
"AbstractPolygonErrorPropertyType"
>
<sequence>
<element
ref=
"qual:AbstractPolygonError"
/>
</sequence>
</complexType>
<element
abstract=
"true"
name=
"AbstractRingError"
substitutionGroup=
"qual:AbstractGeometryError"
type=
"qual:AbstractRingErrorType"
/>
<complexType
abstract=
"true"
name=
"AbstractRingErrorType"
>
<complexContent>
<extension
base=
"qual:AbstractGeometryErrorType"
>
<sequence>
<element
name=
"linearRingId"
type=
"string"
/>
</sequence>
</extension>
</complexContent>
</complexType>
<complexType
name=
"AbstractRingErrorPropertyType"
>
<sequence>
<element
ref=
"qual:AbstractRingError"
/>
</sequence>
</complexType>
<element
abstract=
"true"
name=
"AbstractSemanticError"
substitutionGroup=
"qual:AbstractError"
type=
"qual:AbstractSemanticErrorType"
/>
<complexType
abstract=
"true"
name=
"AbstractSemanticErrorType"
>
<complexContent>
<extension
base=
"qual:AbstractErrorType"
>
<sequence/>
</extension>
</complexContent>
</complexType>
<complexType
name=
"AbstractSemanticErrorPropertyType"
>
<sequence>
<element
ref=
"qual:AbstractSemanticError"
/>
</sequence>
</complexType>
<element
abstract=
"true"
name=
"AbstractSolidError"
substitutionGroup=
"qual:AbstractGeometryError"
type=
"qual:AbstractSolidErrorType"
/>
<complexType
abstract=
"true"
name=
"AbstractSolidErrorType"
>
<complexContent>
<extension
base=
"qual:AbstractGeometryErrorType"
>
<sequence>
<element
name=
"geometryId"
type=
"string"
/>
</sequence>
</extension>
</complexContent>
</complexType>
<complexType
name=
"AbstractSolidErrorPropertyType"
>
<sequence>
<element
ref=
"qual:AbstractSolidError"
/>
</sequence>
</complexType>
<element
name=
"Checking"
substitutionGroup=
"gml:_Object"
type=
"qual:CheckingType"
/>
<complexType
name=
"CheckingType"
>
<sequence>
<element
name=
"featureType"
type=
"qual:FeatureTypeType"
/>
</sequence>
</complexType>
<complexType
name=
"CheckingPropertyType"
>
<sequence>
<element
ref=
"qual:Checking"
/>
</sequence>
</complexType>
<element
name=
"ComponentList"
substitutionGroup=
"gml:_Object"
type=
"qual:ComponentListType"
/>
<complexType
name=
"ComponentListType"
>
<sequence>
<element
maxOccurs=
"unbounded"
name=
"component"
type=
"qual:PolygonIdListPropertyType"
/>
</sequence>
</complexType>
<complexType
name=
"ComponentListPropertyType"
>
<sequence>
<element
ref=
"qual:ComponentList"
/>
</sequence>
</complexType>
<element
name=
"Edge"
substitutionGroup=
"gml:_Object"
type=
"qual:EdgeType"
/>
<complexType
name=
"EdgeType"
>
<sequence>
<element
name=
"from"
type=
"gml:DirectPositionType"
/>
<element
name=
"to"
type=
"gml:DirectPositionType"
/>
</sequence>
</complexType>
<complexType
name=
"EdgePropertyType"
>
<sequence>
<element
ref=
"qual:Edge"
/>
</sequence>
</complexType>
<element
name=
"EdgeList"
substitutionGroup=
"gml:_Object"
type=
"qual:EdgeListType"
/>
<complexType
name=
"EdgeListType"
>
<sequence>
<element
maxOccurs=
"unbounded"
name=
"edge"
type=
"qual:EdgePropertyType"
/>
</sequence>
</complexType>
<complexType
name=
"EdgeListPropertyType"
>
<sequence>
<element
ref=
"qual:EdgeList"
/>
</sequence>
</complexType>
<element
name=
"Error"
substitutionGroup=
"gml:_Object"
type=
"qual:ErrorType"
/>
<complexType
name=
"ErrorType"
>
<sequence>
<element
name=
"name"
type=
"qual:ErrorTypeType"
/>
</sequence>
</complexType>
<complexType
name=
"ErrorPropertyType"
>
<sequence>
<element
ref=
"qual:Error"
/>
</sequence>
</complexType>
<element
name=
"ErrorStatistics"
substitutionGroup=
"gml:_Object"
type=
"qual:ErrorStatisticsType"
/>
<complexType
name=
"ErrorStatisticsType"
>
<sequence>
<element
name=
"occurrences"
type=
"integer"
/>
<element
maxOccurs=
"unbounded"
minOccurs=
"0"
name=
"error"
type=
"qual:ErrorPropertyType"
/>
</sequence>
</complexType>
<complexType
name=
"ErrorStatisticsPropertyType"
>
<sequence>
<element
ref=
"qual:ErrorStatistics"
/>
</sequence>
</complexType>
<simpleType
name=
"ErrorTypeType"
>
<restriction
base=
"string"
>
<enumeration
value=
"GE_R_TOO_FEW_POINTS"
/>
<enumeration
value=
"GE_R_NOT_CLOSED"
/>
<enumeration
value=
"GE_R_CONSECUTIVE_POINTS_SAME"
/>
<enumeration
value=
"GE_R_SELF_INTERSECTION"
/>
<enumeration
value=
"GE_P_NON_PLANAR_POLYGON_DISTANCE_PLANE"
/>
<enumeration
value=
"GE_P_NON_PLANAR_POLYGON_NORMALS_DEVIATION"
/>
<enumeration
value=
"GE_P_INTERIOR_DISCONNECTED"
/>
<enumeration
value=
"GE_P_INTERSECTING_RINGS"
/>
<enumeration
value=
"GE_P_HOLE_OUTSIDE"
/>
<enumeration
value=
"GE_P_ORIENTATION_RINGS_SAME"
/>
<enumeration
value=
"GE_P_INNER_RINGS_NESTED"
/>
<enumeration
value=
"GE_S_TOO_FEW_POLYGONS"
/>
<enumeration
value=
"GE_S_NOT_CLOSED"
/>
<enumeration
value=
"GE_S_NON_MANIFOLD_EDGE"
/>
<enumeration
value=
"GE_S_POLYGON_WRONG_ORIENTATION"
/>
<enumeration
value=
"GE_S_ALL_POLYGONS_WRONG_ORIENTATION"
/>
<enumeration
value=
"GE_S_NON_MANIFOLD_VERTEX"
/>
<enumeration
value=
"GE_S_SELF_INTERSECTION"
/>
<enumeration
value=
"GE_S_MULTIPLE_CONNECTED_COMPONENTS"
/>
<enumeration
value=
"SE_ATTRIBUTE_WRONG_VALUE"
/>
<enumeration
value=
"SE_ATTRIBUTE_MISSING"
/>
</restriction>
</simpleType>
<element
name=
"FeatureStatistics"
substitutionGroup=
"gml:_Object"
type=
"qual:FeatureStatisticsType"
/>
<complexType
name=
"FeatureStatisticsType"
>
<sequence>
<element
name=
"numChecked"
type=
"integer"
/>
<element
name=
"numErrors"
type=
"integer"
/>
</sequence>
</complexType>
<complexType
name=
"FeatureStatisticsPropertyType"
>
<sequence>
<element
ref=
"qual:FeatureStatistics"
/>
</sequence>
</complexType>
<simpleType
name=
"FeatureTypeType"
>
<restriction
base=
"string"
>
<enumeration
value=
"BUILDING"
/>
<enumeration
value=
"TRANSPORTATION"
/>
<enumeration
value=
"VEGETATION"
/>
<enumeration
value=
"BRIDGE"
/>
<enumeration
value=
"WATER"
/>
<enumeration
value=
"LAND"
/>
</restriction>
</simpleType>
<element
name=
"Filter"
substitutionGroup=
"gml:_Object"
type=
"qual:FilterType"
/>
<complexType
name=
"FilterType"
>
<sequence>
<element
maxOccurs=
"unbounded"
minOccurs=
"0"
name=
"checking"
type=
"qual:CheckingPropertyType"
/>
</sequence>
</complexType>
<complexType
name=
"FilterPropertyType"
>
<sequence>
<element
ref=
"qual:Filter"
/>
</sequence>
</complexType>
<element
name=
"GE_P_HOLE_OUTSIDE"
substitutionGroup=
"qual:AbstractPolygonError"
type=
"qual:GE_P_HOLE_OUTSIDEType"
/>
<complexType
name=
"GE_P_HOLE_OUTSIDEType"
>
<complexContent>
<extension
base=
"qual:AbstractPolygonErrorType"
>
<sequence>
<element
name=
"linearRingId"
type=
"string"
/>
</sequence>
</extension>
</complexContent>
</complexType>
<complexType
name=
"GE_P_HOLE_OUTSIDEPropertyType"
>
<sequence>
<element
ref=
"qual:GE_P_HOLE_OUTSIDE"
/>
</sequence>
</complexType>
<element
name=
"GE_P_INNER_RINGS_NESTED"
substitutionGroup=
"qual:AbstractPolygonError"
type=
"qual:GE_P_INNER_RINGS_NESTEDType"
/>
<complexType
name=
"GE_P_INNER_RINGS_NESTEDType"
>
<complexContent>
<extension
base=
"qual:AbstractPolygonErrorType"
>
<sequence>
<element
name=
"linearRingId1"
type=
"string"
/>
<element
name=
"linearRingId2"
type=
"string"
/>
</sequence>
</extension>
</complexContent>
</complexType>
<complexType
name=
"GE_P_INNER_RINGS_NESTEDPropertyType"
>
<sequence>
<element
ref=
"qual:GE_P_INNER_RINGS_NESTED"
/>
</sequence>
</complexType>
<element
name=
"GE_P_INTERIOR_DISCONNECTED"
substitutionGroup=
"qual:AbstractPolygonError"
type=
"qual:GE_P_INTERIOR_DISCONNECTEDType"
/>
<complexType
name=
"GE_P_INTERIOR_DISCONNECTEDType"
>
<complexContent>
<extension
base=
"qual:AbstractPolygonErrorType"
>
<sequence/>
</extension>
</complexContent>
</complexType>
<complexType
name=
"GE_P_INTERIOR_DISCONNECTEDPropertyType"
>
<sequence>
<element
ref=
"qual:GE_P_INTERIOR_DISCONNECTED"
/>
</sequence>
</complexType>
<element
name=
"GE_P_INTERSECTING_RINGS"
substitutionGroup=
"qual:AbstractPolygonError"
type=
"qual:GE_P_INTERSECTING_RINGSType"
/>
<complexType
name=
"GE_P_INTERSECTING_RINGSType"
>
<complexContent>
<extension
base=
"qual:AbstractPolygonErrorType"
>
<sequence>
<element
name=
"linearRingId1"
type=
"string"
/>
<element
name=
"linearRingId2"
type=
"string"
/>
</sequence>
</extension>
</complexContent>
</complexType>
<complexType
name=
"GE_P_INTERSECTING_RINGSPropertyType"
>
<sequence>
<element
ref=
"qual:GE_P_INTERSECTING_RINGS"
/>
</sequence>
</complexType>
<element
name=
"GE_P_NON_PLANAR_POLYGON_DISTANCE_PLANE"
substitutionGroup=
"qual:AbstractPolygonError"
type=
"qual:GE_P_NON_PLANAR_POLYGON_DISTANCE_PLANEType"
/>
<complexType
name=
"GE_P_NON_PLANAR_POLYGON_DISTANCE_PLANEType"
>
<complexContent>
<extension
base=
"qual:AbstractPolygonErrorType"
>
<sequence>
<element
name=
"distance"
type=
"gml:LengthType"
/>
<element
name=
"vertex"
type=
"gml:DirectPositionType"
/>
</sequence>
</extension>
</complexContent>
</complexType>
<complexType
name=
"GE_P_NON_PLANAR_POLYGON_DISTANCE_PLANEPropertyType"
>
<sequence>
<element
ref=
"qual:GE_P_NON_PLANAR_POLYGON_DISTANCE_PLANE"
/>
</sequence>
</complexType>
<element
name=
"GE_P_NON_PLANAR_POLYGON_NORMALS_DEVIATION"
substitutionGroup=
"qual:AbstractPolygonError"
type=
"qual:GE_P_NON_PLANAR_POLYGON_NORMALS_DEVIATIONType"
/>
<complexType
name=
"GE_P_NON_PLANAR_POLYGON_NORMALS_DEVIATIONType"
>
<complexContent>
<extension
base=
"qual:AbstractPolygonErrorType"
>
<sequence>
<element
name=
"deviation"
type=
"gml:AngleType"
/>
</sequence>
</extension>
</complexContent>
</complexType>
<complexType
name=
"GE_P_NON_PLANAR_POLYGON_NORMALS_DEVIATIONPropertyType"
>
<sequence>
<element
ref=
"qual:GE_P_NON_PLANAR_POLYGON_NORMALS_DEVIATION"
/>
</sequence>
</complexType>
<element
name=
"GE_P_ORIENTATION_RINGS_SAME"
substitutionGroup=
"qual:AbstractPolygonError"
type=
"qual:GE_P_ORIENTATION_RINGS_SAMEType"
/>
<complexType
name=
"GE_P_ORIENTATION_RINGS_SAMEType"
>
<complexContent>
<extension
base=
"qual:AbstractPolygonErrorType"
>
<sequence>
<element
name=
"linearRingId"
type=
"string"
/>
</sequence>
</extension>
</complexContent>
</complexType>
<complexType
name=
"GE_P_ORIENTATION_RINGS_SAMEPropertyType"
>
<sequence>
<element
ref=
"qual:GE_P_ORIENTATION_RINGS_SAME"
/>
</sequence>
</complexType>
<element
name=
"GE_R_CONSECUTIVE_POINTS_SAME"
substitutionGroup=
"qual:AbstractRingError"
type=
"qual:GE_R_CONSECUTIVE_POINTS_SAMEType"
/>
<complexType
name=
"GE_R_CONSECUTIVE_POINTS_SAMEType"
>
<complexContent>
<extension
base=
"qual:AbstractRingErrorType"
>
<sequence>
<element
name=
"vertex1"
type=
"gml:DirectPositionType"
/>
<element
name=
"vertex2"
type=
"gml:DirectPositionType"
/>
</sequence>
</extension>
</complexContent>
</complexType>
<complexType
name=
"GE_R_CONSECUTIVE_POINTS_SAMEPropertyType"
>
<sequence>
<element
ref=
"qual:GE_R_CONSECUTIVE_POINTS_SAME"
/>
</sequence>
</complexType>
<element
name=
"GE_R_NOT_CLOSED"
substitutionGroup=
"qual:AbstractRingError"
type=
"qual:GE_R_NOT_CLOSEDType"
/>
<complexType
name=
"GE_R_NOT_CLOSEDType"
>
<complexContent>
<extension
base=
"qual:AbstractRingErrorType"
>
<sequence/>
</extension>
</complexContent>
</complexType>
<complexType
name=
"GE_R_NOT_CLOSEDPropertyType"
>
<sequence>
<element
ref=
"qual:GE_R_NOT_CLOSED"
/>
</sequence>
</complexType>
<element
name=
"GE_R_SELF_INTERSECTION"
substitutionGroup=
"qual:AbstractRingError"
type=
"qual:GE_R_SELF_INTERSECTIONType"
/>
<complexType
name=
"GE_R_SELF_INTERSECTIONType"
>
<complexContent>
<extension
base=
"qual:AbstractRingErrorType"
>
<sequence>
<element
name=
"type"
type=
"string"
/>
<element
name=
"edge1"
type=
"qual:EdgePropertyType"
/>
<element
name=
"edge2"
type=
"qual:EdgePropertyType"
/>
<element
name=
"vertex"
type=
"gml:DirectPositionType"
/>
</sequence>
</extension>
</complexContent>
</complexType>
<complexType
name=
"GE_R_SELF_INTERSECTIONPropertyType"
>
<sequence>
<element
ref=
"qual:GE_R_SELF_INTERSECTION"
/>
</sequence>
</complexType>
<element
name=
"GE_R_TOO_FEW_POINTS"
substitutionGroup=
"qual:AbstractRingError"
type=
"qual:GE_R_TOO_FEW_POINTSType"
/>
<complexType
name=
"GE_R_TOO_FEW_POINTSType"
>
<complexContent>
<extension
base=
"qual:AbstractRingErrorType"
>
<sequence/>
</extension>
</complexContent>
</complexType>
<complexType
name=
"GE_R_TOO_FEW_POINTSPropertyType"
>
<sequence>
<element
ref=
"qual:GE_R_TOO_FEW_POINTS"
/>
</sequence>
</complexType>
<element
name=
"GE_S_ALL_POLYGONS_WRONG_ORIENTATION"
substitutionGroup=
"qual:AbstractSolidError"
type=
"qual:GE_S_ALL_POLYGONS_WRONG_ORIENTATIONType"
/>
<complexType
name=
"GE_S_ALL_POLYGONS_WRONG_ORIENTATIONType"
>
<complexContent>
<extension
base=
"qual:AbstractSolidErrorType"
>
<sequence/>
</extension>
</complexContent>
</complexType>
<complexType
name=
"GE_S_ALL_POLYGONS_WRONG_ORIENTATIONPropertyType"
>
<sequence>
<element
ref=
"qual:GE_S_ALL_POLYGONS_WRONG_ORIENTATION"
/>
</sequence>
</complexType>
<element
name=
"GE_S_MULTIPLE_CONNECTED_COMPONENTS"
substitutionGroup=
"qual:AbstractSolidError"
type=
"qual:GE_S_MULTIPLE_CONNECTED_COMPONENTSType"
/>
<complexType
name=
"GE_S_MULTIPLE_CONNECTED_COMPONENTSType"
>
<complexContent>
<extension
base=
"qual:AbstractSolidErrorType"
>
<sequence>
<element
maxOccurs=
"unbounded"
name=
"components"
type=
"qual:ComponentListPropertyType"
/>
</sequence>
</extension>
</complexContent>
</complexType>
<complexType
name=
"GE_S_MULTIPLE_CONNECTED_COMPONENTSPropertyType"
>
<sequence>
<element
ref=
"qual:GE_S_MULTIPLE_CONNECTED_COMPONENTS"
/>
</sequence>
</complexType>
<element
name=
"GE_S_NON_MANIFOLD_EDGE"
substitutionGroup=
"qual:AbstractSolidError"
type=
"qual:GE_S_NON_MANIFOLD_EDGEType"
/>
<complexType
name=
"GE_S_NON_MANIFOLD_EDGEType"
>
<complexContent>
<extension
base=
"qual:AbstractSolidErrorType"
>
<sequence>
<element
name=
"edges"
type=
"qual:EdgeListPropertyType"
/>
</sequence>
</extension>
</complexContent>
</complexType>
<complexType
name=
"GE_S_NON_MANIFOLD_EDGEPropertyType"
>
<sequence>
<element
ref=
"qual:GE_S_NON_MANIFOLD_EDGE"
/>
</sequence>
</complexType>
<element
name=
"GE_S_NON_MANIFOLD_VERTEX"
substitutionGroup=
"qual:AbstractSolidError"
type=
"qual:GE_S_NON_MANIFOLD_VERTEXType"
/>
<complexType
name=
"GE_S_NON_MANIFOLD_VERTEXType"
>
<complexContent>
<extension
base=
"qual:AbstractSolidErrorType"
>
<sequence>
<element
name=
"vertex"
type=
"gml:DirectPositionType"
/>
</sequence>
</extension>
</complexContent>
</complexType>
<complexType
name=
"GE_S_NON_MANIFOLD_VERTEXPropertyType"
>
<sequence>
<element
ref=
"qual:GE_S_NON_MANIFOLD_VERTEX"
/>
</sequence>
</complexType>
<element
name=
"GE_S_NOT_CLOSED"
substitutionGroup=
"qual:AbstractSolidError"
type=
"qual:GE_S_NOT_CLOSEDType"
/>
<complexType
name=
"GE_S_NOT_CLOSEDType"
>
<complexContent>
<extension
base=
"qual:AbstractSolidErrorType"
>
<sequence>
<element
name=
"edges"
type=
"qual:EdgeListPropertyType"
/>
</sequence>
</extension>
</complexContent>
</complexType>
<complexType
name=
"GE_S_NOT_CLOSEDPropertyType"
>
<sequence>
<element
ref=
"qual:GE_S_NOT_CLOSED"
/>
</sequence>
</complexType>
<element
name=
"GE_S_POLYGON_WRONG_ORIENTATION"
substitutionGroup=
"qual:AbstractSolidError"
type=
"qual:GE_S_POLYGON_WRONG_ORIENTATIONType"
/>
<complexType
name=
"GE_S_POLYGON_WRONG_ORIENTATIONType"
>
<complexContent>
<extension
base=
"qual:AbstractSolidErrorType"
>
<sequence>
<element
name=
"edges"
type=
"qual:EdgeListPropertyType"
/>
</sequence>
</extension>
</complexContent>
</complexType>
<complexType
name=
"GE_S_POLYGON_WRONG_ORIENTATIONPropertyType"
>
<sequence>
<element
ref=
"qual:GE_S_POLYGON_WRONG_ORIENTATION"
/>
</sequence>
</complexType>
<element
name=
"GE_S_SELF_INTERSECTION"
substitutionGroup=
"qual:AbstractSolidError"
type=
"qual:GE_S_SELF_INTERSECTIONType"
/>
<complexType
name=
"GE_S_SELF_INTERSECTIONType"
>
<complexContent>
<extension
base=
"qual:AbstractSolidErrorType"
>
<sequence>
<element
name=
"polygonId1"
type=
"string"
/>
<element
name=
"polygonId2"
type=
"string"
/>
</sequence>
</extension>
</complexContent>
</complexType>
<complexType
name=
"GE_S_SELF_INTERSECTIONPropertyType"
>
<sequence>
<element
ref=
"qual:GE_S_SELF_INTERSECTION"
/>
</sequence>
</complexType>
<element
name=
"GE_S_TOO_FEW_POLYGONS"
substitutionGroup=
"qual:AbstractSolidError"
type=
"qual:GE_S_TOO_FEW_POLYGONSType"
/>
<complexType
name=
"GE_S_TOO_FEW_POLYGONSType"
>
<complexContent>
<extension
base=
"qual:AbstractSolidErrorType"
>
<sequence/>
</extension>
</complexContent>
</complexType>
<complexType
name=
"GE_S_TOO_FEW_POLYGONSPropertyType"
>
<sequence>
<element
ref=
"qual:GE_S_TOO_FEW_POLYGONS"
/>
</sequence>
</complexType>
<element
name=
"GlobalParameters"
substitutionGroup=
"gml:_Object"
type=
"qual:GlobalParametersType"
/>
<complexType
name=
"GlobalParametersType"
>
<sequence>
<element
maxOccurs=
"unbounded"
minOccurs=
"0"
name=
"parameter"
type=
"qual:ParameterPropertyType"
/>
</sequence>
</complexType>
<complexType
name=
"GlobalParametersPropertyType"
>
<sequence>
<element
ref=
"qual:GlobalParameters"
/>
</sequence>
</complexType>
<element
name=
"Parameter"
substitutionGroup=
"gml:_Object"
type=
"qual:ParameterType"
/>
<complexType
name=
"ParameterType"
>
<sequence>
<element
name=
"name"
type=
"string"
/>
<element
name=
"uom"
type=
"string"
/>
<element
name=
"value"
type=
"string"
/>
</sequence>
</complexType>
<complexType
name=
"ParameterPropertyType"
>
<sequence>
<element
ref=
"qual:Parameter"
/>
</sequence>
</complexType>
<element
name=
"PolygonIdList"
substitutionGroup=
"gml:_Object"
type=
"qual:PolygonIdListType"
/>
<complexType
name=
"PolygonIdListType"
>
<sequence>
<element
name=
"polygonId"
type=
"string"
/>
</sequence>
</complexType>
<complexType
name=
"PolygonIdListPropertyType"
>
<sequence>
<element
ref=
"qual:PolygonIdList"
/>
</sequence>
</complexType>
<element
name=
"Requirement"
substitutionGroup=
"gml:_Object"
type=
"qual:RequirementType"
/>
<complexType
name=
"RequirementType"
>
<sequence>
<element
name=
"enabled"
type=
"boolean"
/>
<element
name=
"requirementType"
type=
"qual:RequirementTypeType"
/>
<element
maxOccurs=
"unbounded"
minOccurs=
"0"
name=
"parameter"
type=
"qual:ParameterPropertyType"
/>
</sequence>
</complexType>
<complexType
name=
"RequirementPropertyType"
>
<sequence>
<element
ref=
"qual:Requirement"
/>
</sequence>
</complexType>
<simpleType
name=
"RequirementTypeType"
>
<restriction
base=
"string"
>
<enumeration
value=
"R_GE_R_TOO_FEW_POINTS"
/>
<enumeration
value=
"R_GE_R_NOT_CLOSED"
/>
<enumeration
value=
"R_GE_R_CONSECUTIVE_POINTS_SAME"
/>
<enumeration
value=
"R_GE_R_SELF_INTERSECTION"
/>
<enumeration
value=
"R_GE_P_NON_PLANAR"
/>
<enumeration
value=
"R_GE_P_INTERIOR_DISCONNECTED"
/>
<enumeration
value=
"R_GE_P_INTERSECTING_RINGS"
/>
<enumeration
value=
"R_GE_P_HOLE_OUTSIDE"
/>
<enumeration
value=
"R_GE_P_ORIENTATION_RINGS_SAME"
/>
<enumeration
value=
"R_GE_P_INNER_RINGS_NESTED"
/>
<enumeration
value=
"R_GE_S_TOO_FEW_POLYGONS"
/>
<enumeration
value=
"R_GE_S_NOT_CLOSED"
/>
<enumeration
value=
"R_GE_S_NON_MANIFOLD_EDGE"
/>
<enumeration
value=
"R_GE_S_POLYGON_WRONG_ORIENTATION"
/>
<enumeration
value=
"R_GE_S_ALL_POLYGONS_WRONG_ORIENTATION"
/>
<enumeration
value=
"R_GE_S_NON_MANIFOLD_VERTEX"
/>
<enumeration
value=
"R_GE_S_SELF_INTERSECTION"
/>
<enumeration
value=
"R_GE_S_MULTIPLE_CONNECTED_COMPONENTS"
/>
<enumeration
value=
"R_SE_ATTRIBUTES_EXISTING"
/>
<enumeration
value=
"R_SE_ATTRIBUTES_CORRECT"
/>
</restriction>
</simpleType>
<simpleType
name=
"ResultTypeType"
>
<restriction
base=
"string"
>
<enumeration
value=
"OK"
/>
<enumeration
value=
"ERROR"
/>
<enumeration
value=
"NOT_CHECKED"
/>
</restriction>
</simpleType>
<element
name=
"SEM_ATTRIBUTE_MISSING"
substitutionGroup=
"qual:AbstractSemanticError"
type=
"qual:SEM_ATTRIBUTE_MISSINGType"
/>
<complexType
name=
"SEM_ATTRIBUTE_MISSINGType"
>
<complexContent>
<extension
base=
"qual:AbstractSemanticErrorType"
>
<sequence>
<element
name=
"childId"
type=
"string"
/>
<element
name=
"attributeName"
type=
"string"
/>
<element
name=
"generic"
type=
"boolean"
/>
</sequence>
</extension>
</complexContent>
</complexType>
<complexType
name=
"SEM_ATTRIBUTE_MISSINGPropertyType"
>
<sequence>
<element
ref=
"qual:SEM_ATTRIBUTE_MISSING"
/>
</sequence>
</complexType>
<element
name=
"SEM_ATTRIBUTE_WRONG_VALUE"
substitutionGroup=
"qual:AbstractSemanticError"
type=
"qual:SEM_ATTRIBUTE_WRONG_VALUEType"
/>
<complexType
name=
"SEM_ATTRIBUTE_WRONG_VALUEType"
>
<complexContent>
<extension
base=
"qual:AbstractSemanticErrorType"
>
<sequence>
<element
name=
"childId"
type=
"string"
/>
<element
name=
"attributeName"
type=
"string"
/>
<element
name=
"generic"
type=
"boolean"
/>
</sequence>
</extension>
</complexContent>
</complexType>
<complexType
name=
"SEM_ATTRIBUTE_WRONG_VALUEPropertyType"
>
<sequence>
<element
ref=
"qual:SEM_ATTRIBUTE_WRONG_VALUE"
/>
</sequence>
</complexType>
<element
name=
"Statistics"
substitutionGroup=
"gml:_Object"
type=
"qual:StatisticsType"
/>
<complexType
name=
"StatisticsType"
>
<sequence>
<element
name=
"numErrorBuildings"
type=
"qual:FeatureStatisticsPropertyType"
/>
<element
name=
"numErrorVegetation"
type=
"qual:FeatureStatisticsPropertyType"
/>
<element
name=
"numErrorLandObjects"
type=
"qual:FeatureStatisticsPropertyType"
/>
<element
name=
"numErrorBridgeObjects"
type=
"qual:FeatureStatisticsPropertyType"
/>
<element
name=
"numErrorWaterObjects"
type=
"qual:FeatureStatisticsPropertyType"
/>
<element
name=
"numErrorTransportation"
type=
"qual:FeatureStatisticsPropertyType"
/>
<element
name=
"errorStatistics"
type=
"qual:ErrorStatisticsPropertyType"
/>
</sequence>
</complexType>
<complexType
name=
"StatisticsPropertyType"
>
<sequence>
<element
ref=
"qual:Statistics"
/>
</sequence>
</complexType>
<element
name=
"Validation"
substitutionGroup=
"gml:_Feature"
type=
"qual:ValidationType"
/>
<complexType
name=
"ValidationType"
>
<complexContent>
<extension
base=
"gml:AbstractFeatureType"
>
<sequence>
<element
name=
"validationDate"
type=
"dateTime"
/>
<element
name=
"validationSoftware"
type=
"string"
/>
<element
minOccurs=
"0"
name=
"statistics"
type=
"qual:StatisticsPropertyType"
/>
<element
name=
"validationPlan"
type=
"qual:ValidationPlanPropertyType"
/>
</sequence>
</extension>
</complexContent>
</complexType>
<complexType
name=
"ValidationPropertyType"
>
<sequence
minOccurs=
"0"
>
<element
ref=
"qual:Validation"
/>
</sequence>
<attributeGroup
ref=
"gml:AssociationAttributeGroup"
/>
</complexType>
<element
name=
"ValidationPlan"
substitutionGroup=
"gml:_Object"
type=
"qual:ValidationPlanType"
/>
<complexType
name=
"ValidationPlanType"
>
<sequence>
<element
name=
"globalParameters"
type=
"qual:GlobalParametersPropertyType"
/>
<element
name=
"filter"
type=
"qual:FilterPropertyType"
/>
<element
name=
"requirement"
type=
"qual:RequirementPropertyType"
/>
</sequence>
</complexType>
<complexType
name=
"ValidationPlanPropertyType"
>
<sequence>
<element
ref=
"qual:ValidationPlan"
/>
</sequence>
</complexType>
<element
name=
"ValidationResult"
substitutionGroup=
"gml:_Object"
type=
"qual:ValidationResultType"
/>
<complexType
name=
"ValidationResultType"
>
<sequence>
<element
name=
"validationPlanID"
type=
"qual:ValidationPropertyType"
/>
<element
maxOccurs=
"unbounded"
minOccurs=
"0"
name=
"error"
type=
"qual:AbstractErrorPropertyType"
/>
<element
name=
"resultType"
type=
"qual:ResultTypeType"
/>
</sequence>
</complexType>
<complexType
name=
"ValidationResultPropertyType"
>
<sequence>
<element
ref=
"qual:ValidationResult"
/>
</sequence>
</complexType>
<element
name=
"validationResult"
substitutionGroup=
"core:_GenericApplicationPropertyOfCityObject"
type=
"qual:ValidationResultPropertyType"
/>
</schema>
citygml4j-quality-ade/src/main/resources/qualityAde.xsd
deleted
100644 → 0
View file @
6cf1abce
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<schema
xmlns=
"http://www.w3.org/2001/XMLSchema"
xmlns:qual=
"https://transfer.hft-stuttgart.de/pages/citydoctor/qualityade/0.1.3"
targetNamespace=
"https://transfer.hft-stuttgart.de/pages/citydoctor/qualityade/0.1.3"
xmlns:core=
"http://www.opengis.net/citygml/2.0"
xmlns:bldg=
"http://www.opengis.net/citygml/building/2.0"
xmlns:gml=
"http://www.opengis.net/gml"
elementFormDefault=
"qualified"
version=
"1.0"
>
<import
namespace=
"http://www.opengis.net/citygml/2.0"
schemaLocation=
"http://schemas.opengis.net/citygml/2.0/cityGMLBase.xsd"
/>
<import
namespace=
"http://www.opengis.net/citygml/building/2.0"
schemaLocation=
"http://schemas.opengis.net/citygml/building/2.0/building.xsd"
/>
<import
namespace=
"http://www.opengis.net/citygml/appearance/2.0"
schemaLocation=
"http://schemas.opengis.net/citygml/appearance/2.0/appearance.xsd"
/>
<import
namespace=
"http://www.opengis.net/citygml/generics/2.0"
schemaLocation=
"http://schemas.opengis.net/citygml/generics/2.0/generics.xsd"
/>
<import
namespace=
"http://www.opengis.net/gml"
schemaLocation=
"http://schemas.opengis.net/gml/2.1.2/gml.xsd"
/>
<element
name=
"validationResult"
type=
"qual:validationResultType"
substitutionGroup=
"core:_GenericApplicationPropertyOfCityObject"
/>
<simpleType
name=
"result"
final=
"restriction"
>
<annotation>
<documentation>
Enumeration for status of check result
</documentation>
</annotation>
<restriction
base=
"string"
>
<enumeration
value=
"ERROR"
>
<annotation>
<documentation>
One or more errors were found
</documentation>
</annotation>
</enumeration>
<enumeration
value=
"NOT_CHECKED"
>
<annotation>
<documentation>
Feature was not checked
</documentation>
</annotation>
</enumeration>
<enumeration
value=
"OK"
>
<annotation>
<documentation>
No errors were found
</documentation>
</annotation>
</enumeration>
</restriction>
</simpleType>
<complexType
name=
"ValidationError"
>
</complexType>
<complexType
name=
"RingError"
>
<complexContent>
<extension
base=
"qual:ValidationError"
>
<sequence>
<element
name=
"linearRingId"
type=
"string"
/>
</sequence>
</extension>
</complexContent>
</complexType>
<complexType
name=
"GE_R_CONSECUTIVE_POINTS_SAME"
>
<annotation>
<documentation>
Consecutive point are the same
</documentation>
</annotation>
<complexContent>
<extension
base=
"qual:RingError"
>
<sequence>
<element
name=
"vertex1"
type=
"gml:DirectPositionType"
/>
<element
name=
"vertex2"
type=
"gml:DirectPositionType"
/>
</sequence>
</extension>
</complexContent>
</complexType>
<complexType
name=
"GE_R_TOO_FEW_POINTS"
>
<complexContent>
<extension
base=
"qual:RingError"
/>
</complexContent>
</complexType>
<complexType
name=
"GE_R_SELF_INTERSECTION"
>
<complexContent>
<extension
base=
"qual:RingError"
>
<sequence>
<element
name=
"type"
type=
"qual:ringSelfIntType"
/>
<element
name=
"edge1"
type=
"qual:edgeType"
minOccurs=
"0"
/>
<element
name=
"edge2"
type=
"qual:edgeType"
minOccurs=
"0"
/>
<element
name=
"vertex1"
type=
"gml:DirectPositionType"
minOccurs=
"0"
/>
<element
name=
"vertex2"
type=
"gml:DirectPositionType"
minOccurs=
"0"
/>
</sequence>
</extension>
</complexContent>
</complexType>
<simpleType
name=
"ringSelfIntType"
>
<restriction
base=
"string"
>
<enumeration
value=
"DUPLICATE_POINT"
/>
<enumeration
value=
"POINT_TOUCHES_EDGE"
/>
<enumeration
value=
"EDGE_INTERSECTS_EDGE"
/>
</restriction>
</simpleType>
<complexType
name=
"edgeType"
>
<sequence>
<element
name=
"from"
type=
"gml:DirectPositionType"
/>
<element
name=
"to"
type=
"gml:DirectPositionType"
/>
</sequence>
</complexType>
<complexType
name=
"GE_R_NOT_CLOSED"
>
<complexContent>
<extension
base=
"qual:RingError"
/>
</complexContent>
</complexType>
<complexType
name=
"PolygonError"
>
<sequence>
<element
name=
"polygonId"
type=
"string"
/>
</sequence>
</complexType>
<complexType
name=
"GE_P_INTERIOR_DISCONNECTED"
>
<complexContent>
<extension
base=
"qual:PolygonError"
/>
</complexContent>
</complexType>
<complexType
name=
"GE_P_INTERSECTING_RINGS"
>
<complexContent>
<extension
base=
"qual:PolygonError"
>
<sequence>
<element
name=
"linearRingId1"
type=
"string"
/>
<element
name=
"linearRingId2"
type=
"string"
/>
</sequence>
</extension>
</complexContent>
</complexType>
<complexType
name=
"GE_P_INNER_RINGS_NESTED"
>
<complexContent>
<extension
base=
"qual:PolygonError"
>
<sequence>
<element
name=
"linearRingId1"
type=
"string"
/>
<element
name=
"linearRingId2"
type=
"string"
/>
</sequence>
</extension>
</complexContent>
</complexType>
<complexType
name=
"GE_P_HOLE_OUTSIDE"
>
<complexContent>
<extension
base=
"qual:PolygonError"
>
<sequence>
<element
name=
"linearRingId"
type=
"string"
/>
</sequence>
</extension>
</complexContent>
</complexType>
<complexType
name=
"GE_P_NON_PLANAR_POLYGON_NORMALS_DEVIATION"
>
<complexContent>
<extension
base=
"qual:PolygonError"
>
<sequence>
<element
name=
"deviation"
type=
"gml:AngleType"
></element>
</sequence>
</extension>
</complexContent>
</complexType>
<complexType
name=
"GE_P_ORIENTATION_RINGS_SAME"
>
<complexContent>
<extension
base=
"qual:PolygonError"
>
<sequence>
<element
name=
"linearRingId"
type=
"string"
/>
</sequence>
</extension>
</complexContent>
</complexType>
<complexType
name=
"SolidError"
>
<sequence>
<element
name=
"geometryId"
type=
"string"
/>
</sequence>
</complexType>
<complexType
name=
"GE_S_ALL_POLYGONS_WRONG_ORIENTATION"
>
<complexContent>
<extension
base=
"qual:SolidError"
/>
</complexContent>
</complexType>
<complexType
name=
"GE_S_POLYGON_WRONG_ORIENTATION"
>
<complexContent>
<extension
base=
"qual:SolidError"
>
<sequence>
<element
name=
"edges"
type=
"qual:EdgeList"
/>
</sequence>
</extension>
</complexContent>
</complexType>
<complexType
name=
"EdgeList"
>
<sequence>
<element
name=
"edge"
type=
"qual:edgeType"
maxOccurs=
"unbounded"
/>
</sequence>
</complexType>
<complexType
name=
"GE_S_SELF_INTERSECTION"
>
<complexContent>
<extension
base=
"qual:SolidError"
>
<sequence>
<element
name=
"polygonId1"
type=
"string"
/>
<element
name=
"polygonId2"
type=
"string"
/>
</sequence>
</extension>
</complexContent>
</complexType>
<complexType
name=
"GE_S_NON_MANIFOLD_VERTEX"
>
<complexContent>
<extension
base=
"qual:SolidError"
>
<sequence>
<element
name=
"vertex"
type=
"gml:DirectPositionType"
/>
</sequence>
</extension>
</complexContent>
</complexType>
<complexType
name=
"GE_S_NON_MANIFOLD_EDGE"
>
<complexContent>
<extension
base=
"qual:SolidError"
>
<sequence>
<element
name=
"edges"
type=
"qual:EdgeList"
/>
</sequence>
</extension>
</complexContent>
</complexType>
<complexType
name=
"GE_S_NOT_CLOSED"
>
<complexContent>
<extension
base=
"qual:SolidError"
>
<sequence>
<element
name=
"edges"
type=
"qual:EdgeList"
/>
</sequence>
</extension>
</complexContent>
</complexType>
<complexType
name=
"GE_S_TOO_FEW_POLYGONS"
>
<complexContent>
<extension
base=
"qual:SolidError"
/>
</complexContent>
</complexType>
<complexType
name=
"GE_S_MULTIPLE_CONNECTED_COMPONENTS"
>
<complexContent>
<extension
base=
"qual:SolidError"
>
<sequence>
<element
name=
"components"
type=
"qual:ComponentList"
/>
</sequence>
</extension>
</complexContent>
</complexType>
<complexType
name=
"ComponentList"
>
<sequence>
<element
name=
"component"
type=
"qual:componentType"
maxOccurs=
"unbounded"
/>
</sequence>
</complexType>
<complexType
name=
"componentType"
>
<sequence>
<element
name=
"polygonId"
type=
"string"
maxOccurs=
"unbounded"
/>
</sequence>
</complexType>
<complexType
name=
"GE_P_NON_PLANAR_POLYGON_DISTANCE_PLANE"
>
<annotation>
<documentation>
A planarity error with a point too far from the
regression plane
</documentation>
</annotation>
<complexContent>
<extension
base=
"qual:PolygonError"
>
<sequence>
<element
name=
"vertex"
type=
"gml:DirectPositionType"
/>
<element
name=
"distance"
type=
"gml:LengthType"
/>
</sequence>
</extension>
</complexContent>
</complexType>
<complexType
name=
"SemanticError"
>
</complexType>
<complexType
name=
"SE_ATTRIBUTE_WRONG_VALUE"
>
<complexContent>
<extension
base=
"qual:SemanticError"
>
<sequence>
<element
name=
"childId"
type=
"string"
minOccurs=
"0"
/>
<element
name=
"attributeName"
type=
"string"
/>
<element
name=
"generic"
type=
"boolean"
/>
</sequence>
</extension>
</complexContent>
</complexType>
<complexType
name=
"SE_ATTRIBUTE_MISSING"
>
<complexContent>
<extension
base=
"qual:SemanticError"
>
<sequence>
<element
name=
"childId"
type=
"string"
minOccurs=
"0"
/>
<element
name=
"attributeName"
type=
"string"
/>
<element
name=
"generic"
type=
"boolean"
/>
</sequence>
</extension>
</complexContent>
</complexType>
<complexType
name=
"validationResultType"
>
<annotation>
<documentation>
Data structure containing validation results for
features
</documentation>
</annotation>
<sequence>
<element
name=
"GE_P_HOLE_OUTSIDE"
type=
"qual:GE_P_HOLE_OUTSIDE"
minOccurs=
"0"
maxOccurs=
"unbounded"
/>
<element
name=
"GE_P_INNER_RINGS_NESTED"
type=
"qual:GE_P_INNER_RINGS_NESTED"
minOccurs=
"0"
maxOccurs=
"unbounded"
/>
<element
name=
"GE_P_INTERIOR_DISCONNECTED"
type=
"qual:GE_P_INTERIOR_DISCONNECTED"
minOccurs=
"0"
maxOccurs=
"unbounded"
/>
<element
name=
"GE_P_INTERSECTING_RINGS"
type=
"qual:GE_P_INTERSECTING_RINGS"
minOccurs=
"0"
maxOccurs=
"unbounded"
/>
<element
name=
"GE_P_NON_PLANAR_POLYGON_DISTANCE_PLANE"
type=
"qual:GE_P_NON_PLANAR_POLYGON_DISTANCE_PLANE"
minOccurs=
"0"
maxOccurs=
"unbounded"
/>
<element
name=
"GE_P_NON_PLANAR_POLYGON_NORMALS_DEVIATION"
type=
"qual:GE_P_NON_PLANAR_POLYGON_NORMALS_DEVIATION"
minOccurs=
"0"
maxOccurs=
"unbounded"
/>
<element
name=
"GE_P_ORIENTATION_RINGS_SAME"
type=
"qual:GE_P_ORIENTATION_RINGS_SAME"
minOccurs=
"0"
maxOccurs=
"unbounded"
/>
<element
name=
"GE_R_CONSECUTIVE_POINTS_SAME"
type=
"qual:GE_R_CONSECUTIVE_POINTS_SAME"
minOccurs=
"0"
maxOccurs=
"unbounded"
/>
<element
name=
"GE_R_NOT_CLOSED"
type=
"qual:GE_R_NOT_CLOSED"
minOccurs=
"0"
maxOccurs=
"unbounded"
/>
<element
name=
"GE_R_SELF_INTERSECTION"
type=
"qual:GE_R_SELF_INTERSECTION"
minOccurs=
"0"
maxOccurs=
"unbounded"
/>
<element
name=
"GE_R_TOO_FEW_POINTS"
type=
"qual:GE_R_TOO_FEW_POINTS"
minOccurs=
"0"
maxOccurs=
"unbounded"
/>
<element
name=
"GE_S_ALL_POLYGONS_WRONG_ORIENTATION"
type=
"qual:GE_S_ALL_POLYGONS_WRONG_ORIENTATION"
minOccurs=
"0"
maxOccurs=
"unbounded"
/>
<element
name=
"GE_S_MULTIPLE_CONNECTED_COMPONENTS"
type=
"qual:GE_S_MULTIPLE_CONNECTED_COMPONENTS"
minOccurs=
"0"
maxOccurs=
"unbounded"
/>
<element
name=
"GE_S_NON_MANIFOLD_EDGE"
type=
"qual:GE_S_NON_MANIFOLD_EDGE"
minOccurs=
"0"
maxOccurs=
"unbounded"
/>
<element
name=
"GE_S_NON_MANIFOLD_VERTEX"
type=
"qual:GE_S_NON_MANIFOLD_VERTEX"
minOccurs=
"0"
maxOccurs=
"unbounded"
/>
<element
name=
"GE_S_NOT_CLOSED"
type=
"qual:GE_S_NOT_CLOSED"
minOccurs=
"0"
maxOccurs=
"unbounded"
/>
<element
name=
"GE_S_POLYGON_WRONG_ORIENTATION"
type=
"qual:GE_S_POLYGON_WRONG_ORIENTATION"
minOccurs=
"0"
maxOccurs=
"unbounded"
/>
<element
name=
"GE_S_SELF_INTERSECTION"
type=
"qual:GE_S_SELF_INTERSECTION"
minOccurs=
"0"
maxOccurs=
"unbounded"
/>
<element
name=
"GE_S_TOO_FEW_POLYGONS"
type=
"qual:GE_S_TOO_FEW_POLYGONS"
minOccurs=
"0"
maxOccurs=
"unbounded"
/>
<element
name=
"SE_ATTRIBUTE_MISSING"
type=
"qual:SE_ATTRIBUTE_MISSING"
minOccurs=
"0"
maxOccurs=
"unbounded"
/>
<element
name=
"SE_ATTRIBUTE_WRONG_VALUE"
type=
"qual:SE_ATTRIBUTE_WRONG_VALUE"
minOccurs=
"0"
maxOccurs=
"unbounded"
/>
</sequence>
<attribute
name=
"result"
type=
"qual:result"
/>
</complexType>
<simpleType
name=
"requirementID"
final=
"restriction"
>
<annotation>
<documentation>
Enumeration for available requirements
</documentation>
</annotation>
<restriction
base=
"string"
>
<enumeration
value=
"R_GE_R_TOO_FEW_POINTS"
/>
<enumeration
value=
"R_GE_R_NOT_CLOSED"
/>
<enumeration
value=
"R_GE_R_CONSECUTIVE_POINTS_SAME"
/>
<enumeration
value=
"R_GE_R_SELF_INTERSECTION"
/>
<enumeration
value=
"R_GE_P_NON_PLANAR"
/>
<enumeration
value=
"R_GE_P_INTERIOR_DISCONNECTED"
/>
<enumeration
value=
"R_GE_P_INTERSECTING_RINGS"
/>
<enumeration
value=
"R_GE_P_HOLE_OUTSIDE"
/>
<enumeration
value=
"R_GE_P_ORIENTATION_RINGS_SAME"
/>
<enumeration
value=
"R_GE_P_INNER_RINGS_NESTED"
/>
<enumeration
value=
"R_GE_S_TOO_FEW_POLYGONS"
/>
<enumeration
value=
"R_GE_S_NOT_CLOSED"
/>
<enumeration
value=
"R_GE_S_NON_MANIFOLD_EDGE"
/>
<enumeration
value=
"R_GE_S_POLYGON_WRONG_ORIENTATION"
/>
<enumeration
value=
"R_GE_S_ALL_POLYGONS_WRONG_ORIENTATION"
/>
<enumeration
value=
"R_GE_S_NON_MANIFOLD_VERTEX"
/>
<enumeration
value=
"R_GE_S_SELF_INTERSECTION"
/>
<enumeration
value=
"R_GE_S_MULTIPLE_CONNECTED_COMPONENTS"
/>
<enumeration
value=
"R_SE_ATTRIBUTES_EXISTING"
/>
<enumeration
value=
"R_SE_ATTRIBUTES_CORRECT"
/>
</restriction>
</simpleType>
<complexType
name=
"parameter"
>
<simpleContent>
<extension
base=
"string"
>
<attribute
name=
"name"
type=
"string"
use=
"required"
/>
<attribute
name=
"uom"
type=
"string"
use=
"optional"
/>
</extension>
</simpleContent>
</complexType>
<complexType
name=
"requirementType"
>
<annotation>
<documentation>
Requirement structure for configuration purposes
</documentation>
</annotation>
<sequence>
<element
name=
"parameter"
type=
"qual:parameter"
minOccurs=
"0"
maxOccurs=
"unbounded"
/>
</sequence>
<attribute
name=
"name"
type=
"qual:requirementID"
/>
<attribute
name=
"enabled"
type=
"boolean"
/>
</complexType>
<complexType
name=
"validationPlanType"
>
<annotation>
<documentation>
Validation plan structure containing information about
the parameters used to perform the checks
</documentation>
</annotation>
<sequence>
<element
name=
"globalParameters"
type=
"qual:globalParameterType"
/>
<element
name=
"requirement"
type=
"qual:requirementType"
maxOccurs=
"unbounded"
/>
<element
name=
"filter"
type=
"qual:filterType"
minOccurs=
"1"
maxOccurs=
"1"
/>
</sequence>
</complexType>
<complexType
name=
"filterType"
>
<sequence>
<element
name=
"checking"
type=
"qual:featureType"
minOccurs=
"0"
maxOccurs=
"unbounded"
/>
</sequence>
</complexType>
<simpleType
name=
"featureType"
>
<restriction
base=
"string"
>
<enumeration
value=
"BUILDING"
></enumeration>
<enumeration
value=
"TRANSPORTATION"
></enumeration>
<enumeration
value=
"VEGETATION"
></enumeration>
<enumeration
value=
"BRIDGE"
></enumeration>
<enumeration
value=
"WATER"
></enumeration>
<enumeration
value=
"LAND"
></enumeration>
</restriction>
</simpleType>
<complexType
name=
"globalParameterType"
>
<sequence>
<element
name=
"parameter"
type=
"qual:parameter"
maxOccurs=
"unbounded"
/>
</sequence>
</complexType>
<complexType
name=
"statisticsType"
>
<annotation>
<documentation>
Statistics structure containing information about end
result of checking process
</documentation>
</annotation>
<sequence>
<element
name=
"numErrorBuildings"
type=
"qual:featureStatistics"
/>
<element
name=
"numErrorVegetation"
type=
"qual:featureStatistics"
/>
<element
name=
"numErrorLandObjects"
type=
"qual:featureStatistics"
/>
<element
name=
"numErrorBridgeObjects"
type=
"qual:featureStatistics"
/>
<element
name=
"numErrorWaterObjects"
type=
"qual:featureStatistics"
/>
<element
name=
"numErrorTransportation"
type=
"qual:featureStatistics"
/>
<element
name=
"errorStatistics"
type=
"qual:errorStatisticsType"
/>
</sequence>
</complexType>
<complexType
name=
"errorStatisticsType"
>
<sequence>
<element
name=
"error"
type=
"qual:errorType"
minOccurs=
"0"
maxOccurs=
"unbounded"
/>
</sequence>
</complexType>
<complexType
name=
"errorType"
>
<simpleContent>
<extension
base=
"int"
>
<attribute
name=
"name"
type=
"qual:errorId"
></attribute>
</extension>
</simpleContent>
</complexType>
<simpleType
name=
"errorId"
>
<restriction
base=
"string"
>
<enumeration
value=
"GE_R_TOO_FEW_POINTS"
/>
<enumeration
value=
"GE_R_NOT_CLOSED"
/>
<enumeration
value=
"GE_R_CONSECUTIVE_POINTS_SAME"
/>
<enumeration
value=
"GE_R_SELF_INTERSECTION"
/>
<enumeration
value=
"GE_P_NON_PLANAR_POLYGON_NORMALS_DEVIATION"
/>
<enumeration
value=
"GE_P_NON_PLANAR_POLYGON_DISTANCE_PLANE"
/>
<enumeration
value=
"GE_P_INTERIOR_DISCONNECTED"
/>
<enumeration
value=
"GE_P_INTERSECTING_RINGS"
/>
<enumeration
value=
"GE_P_HOLE_OUTSIDE"
/>
<enumeration
value=
"GE_P_ORIENTATION_RINGS_SAME"
/>
<enumeration
value=
"GE_P_INNER_RINGS_NESTED"
/>
<enumeration
value=
"GE_S_TOO_FEW_POLYGONS"
/>
<enumeration
value=
"GE_S_NOT_CLOSED"
/>
<enumeration
value=
"GE_S_NON_MANIFOLD_EDGE"
/>
<enumeration
value=
"GE_S_POLYGON_WRONG_ORIENTATION"
/>
<enumeration
value=
"GE_S_ALL_POLYGONS_WRONG_ORIENTATION"
/>
<enumeration
value=
"GE_S_NON_MANIFOLD_VERTEX"
/>
<enumeration
value=
"GE_S_SELF_INTERSECTION"
/>
<enumeration
value=
"GE_S_MULTIPLE_CONNECTED_COMPONENTS"
/>
<enumeration
value=
"SE_ATTRIBUTE_WRONG_VALUE"
/>
<enumeration
value=
"SE_ATTRIBUTE_MISSING"
/>
</restriction>
</simpleType>
<complexType
name=
"featureStatistics"
>
<simpleContent>
<extension
base=
"int"
>
<attribute
name=
"numChecked"
type=
"int"
/>
</extension>
</simpleContent>
</complexType>
<element
name=
"validation"
type=
"qual:validationType"
substitutionGroup=
"core:_GenericApplicationPropertyOfCityModel"
/>
<complexType
name=
"validationType"
>
<annotation>
<documentation>
Data structure containing the validation plan and
statistics of a validation process
</documentation>
</annotation>
<sequence>
<element
name=
"validationDate"
type=
"dateTime"
/>
<element
name=
"validationSoftware"
type=
"string"
/>
<element
name=
"validationPlan"
type=
"qual:validationPlanType"
maxOccurs=
"1"
/>
<element
name=
"statistics"
type=
"qual:statisticsType"
maxOccurs=
"1"
/>
</sequence>
</complexType>
</schema>
\ No newline at end of file
citygml4j-quality-ade/src/test/java/de/hft/stuttgart/quality/QualityAdeTests.java
deleted
100644 → 0
View file @
6cf1abce
/*-
* Copyright 2020 Hochschule für Technik Stuttgart
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
de.hft.stuttgart.quality
;
import
static
org
.
junit
.
jupiter
.
api
.
Assertions
.
assertEquals
;
import
static
org
.
junit
.
jupiter
.
api
.
Assertions
.
assertFalse
;
import
static
org
.
junit
.
jupiter
.
api
.
Assertions
.
assertNotNull
;
import
static
org
.
junit
.
jupiter
.
api
.
Assertions
.
assertNull
;
import
static
org
.
junit
.
jupiter
.
api
.
Assertions
.
assertTrue
;
import
java.io.ByteArrayInputStream
;
import
java.io.ByteArrayOutputStream
;
import
java.io.File
;
import
java.io.FileInputStream
;
import
java.io.FileNotFoundException
;
import
java.io.InputStream
;
import
java.time.LocalDateTime
;
import
java.time.ZoneId
;
import
java.time.ZonedDateTime
;
import
java.util.List
;
import
java.util.ServiceLoader
;
import
org.citygml4j.CityGMLContext
;
import
org.citygml4j.builder.jaxb.CityGMLBuilder
;
import
org.citygml4j.builder.jaxb.CityGMLBuilderException
;
import
org.citygml4j.model.citygml.ade.ADEComponent
;
import
org.citygml4j.model.citygml.ade.ADEException
;
import
org.citygml4j.model.citygml.ade.binding.ADEContext
;
import
org.citygml4j.model.citygml.building.Building
;
import
org.citygml4j.model.citygml.core.AbstractCityObject
;
import
org.citygml4j.model.citygml.core.CityModel
;
import
org.citygml4j.model.citygml.core.CityObjectMember
;
import
org.citygml4j.model.gml.geometry.primitives.DirectPosition
;
import
org.citygml4j.model.gml.measures.Angle
;
import
org.citygml4j.model.gml.measures.Length
;
import
org.citygml4j.model.module.citygml.CityGMLVersion
;
import
org.citygml4j.xml.io.CityGMLInputFactory
;
import
org.citygml4j.xml.io.CityGMLOutputFactory
;
import
org.citygml4j.xml.io.reader.CityGMLReadException
;
import
org.citygml4j.xml.io.reader.CityGMLReader
;
import
org.citygml4j.xml.io.reader.FeatureReadMode
;
import
org.citygml4j.xml.io.writer.CityGMLWriteException
;
import
org.citygml4j.xml.io.writer.CityGMLWriter
;
import
org.junit.jupiter.api.Test
;
import
de.hft.stuttgart.quality.model.AllPolygonsWrongOrientation
;
import
de.hft.stuttgart.quality.model.AttributeMissing
;
import
de.hft.stuttgart.quality.model.AttributeWrongValue
;
import
de.hft.stuttgart.quality.model.ConsecutivePointsSame
;
import
de.hft.stuttgart.quality.model.Edge
;
import
de.hft.stuttgart.quality.model.HoleOutside
;
import
de.hft.stuttgart.quality.model.InnerRingsNested
;
import
de.hft.stuttgart.quality.model.InteriorDisconnected
;
import
de.hft.stuttgart.quality.model.IntersectingRings
;
import
de.hft.stuttgart.quality.model.MultipleConnectedComponents
;
import
de.hft.stuttgart.quality.model.NonManifoldEdge
;
import
de.hft.stuttgart.quality.model.NonManifoldVertex
;
import
de.hft.stuttgart.quality.model.NonPlanarDistancePlane
;
import
de.hft.stuttgart.quality.model.NonPlanarNormalsDeviation
;
import
de.hft.stuttgart.quality.model.OrientationRingsSame
;
import
de.hft.stuttgart.quality.model.PolygonWrongOrientation
;
import
de.hft.stuttgart.quality.model.RingNotClosed
;
import
de.hft.stuttgart.quality.model.RingSelfIntersection
;
import
de.hft.stuttgart.quality.model.SolidNotClosed
;
import
de.hft.stuttgart.quality.model.TooFewPoints
;
import
de.hft.stuttgart.quality.model.TooFewPolygons
;
import
de.hft.stuttgart.quality.model.Validation
;
import
de.hft.stuttgart.quality.model.ValidationError
;
import
de.hft.stuttgart.quality.model.ValidationResult
;
import
de.hft.stuttgart.quality.model.jaxb.Checking
;
import
de.hft.stuttgart.quality.model.jaxb.Component
;
import
de.hft.stuttgart.quality.model.jaxb.ErrorId
;
import
de.hft.stuttgart.quality.model.jaxb.ErrorStatistics
;
import
de.hft.stuttgart.quality.model.jaxb.FeatureStatistics
;
import
de.hft.stuttgart.quality.model.jaxb.Parameter
;
import
de.hft.stuttgart.quality.model.jaxb.Requirement
;
import
de.hft.stuttgart.quality.model.jaxb.RequirementId
;
import
de.hft.stuttgart.quality.model.jaxb.ResultType
;
import
de.hft.stuttgart.quality.model.jaxb.RingSelfIntType
;
import
de.hft.stuttgart.quality.model.jaxb.Statistics
;
import
de.hft.stuttgart.quality.model.jaxb.TopLevelFeatureType
;
import
de.hft.stuttgart.quality.model.jaxb.ValidationPlan
;
class
QualityAdeTests
{
@Test
void
testReadingConsecutiveSameError
()
throws
ADEException
,
CityGMLBuilderException
,
CityGMLReadException
,
FileNotFoundException
{
CityModel
cityModel
=
readCityGml
(
"src/test/resources/SimpleSolid_Error_QualityADE.gml"
);
testValidationPlan
(
cityModel
);
List
<
CityObjectMember
>
cityObjectMember
=
cityModel
.
getCityObjectMember
();
assertEquals
(
1
,
cityObjectMember
.
size
());
CityObjectMember
com
=
cityObjectMember
.
get
(
0
);
AbstractCityObject
aco
=
com
.
getCityObject
();
assertNotNull
(
aco
);
assertTrue
(
aco
instanceof
Building
);
Building
b
=
(
Building
)
aco
;
List
<
ADEComponent
>
gen
=
b
.
getGenericApplicationPropertyOfCityObject
();
ADEComponent
resultComp
=
gen
.
get
(
0
);
assertTrue
(
resultComp
instanceof
ValidationResult
);
ValidationResult
result
=
(
ValidationResult
)
resultComp
;
assertEquals
(
ResultType
.
ERROR
,
result
.
getResult
());
assertFalse
(
result
.
getErrors
().
isEmpty
());
List
<
ValidationError
>
errors
=
result
.
getErrors
();
assertEquals
(
1
,
errors
.
size
());
ValidationError
validationError
=
errors
.
get
(
0
);
assertTrue
(
validationError
instanceof
ConsecutivePointsSame
);
ConsecutivePointsSame
err
=
(
ConsecutivePointsSame
)
validationError
;
assertEquals
(
"_Simple_BD.1_PG.6_LR.1"
,
err
.
getLinearRingId
());
Double
x1
=
err
.
getVertex1
().
getValue
().
get
(
0
);
assertEquals
(
11.5
,
x1
,
0.0000001
);
Double
x2
=
err
.
getVertex2
().
getValue
().
get
(
0
);
assertEquals
(
11.5
,
x2
,
0.0000001
);
}
@Test
void
testReadingTooFewPointsError
()
throws
ADEException
,
CityGMLBuilderException
,
CityGMLReadException
,
FileNotFoundException
{
CityModel
cityModel
=
readCityGml
(
"src/test/resources/SimpleSolid_TooFewPoints.gml"
);
List
<
CityObjectMember
>
cityObjectMember
=
cityModel
.
getCityObjectMember
();
CityObjectMember
com
=
cityObjectMember
.
get
(
0
);
AbstractCityObject
aco
=
com
.
getCityObject
();
Building
b
=
(
Building
)
aco
;
List
<
ADEComponent
>
gen
=
b
.
getGenericApplicationPropertyOfCityObject
();
ADEComponent
resultComp
=
gen
.
get
(
0
);
ValidationResult
result
=
(
ValidationResult
)
resultComp
;
assertEquals
(
ResultType
.
ERROR
,
result
.
getResult
());
assertFalse
(
result
.
getErrors
().
isEmpty
());
List
<
ValidationError
>
errors
=
result
.
getErrors
();
ValidationError
validationError
=
errors
.
get
(
0
);
assertTrue
(
validationError
instanceof
TooFewPoints
);
TooFewPoints
err
=
(
TooFewPoints
)
validationError
;
assertEquals
(
"_Simple_BD.1_PG.6_LR.1"
,
err
.
getLinearRingId
());
}
@Test
void
testReadingRingSelfIntersectionError
()
throws
ADEException
,
CityGMLBuilderException
,
CityGMLReadException
,
FileNotFoundException
{
CityModel
cityModel
=
readCityGml
(
"src/test/resources/SimpleSolid_RingSelfIntersection.gml"
);
List
<
CityObjectMember
>
cityObjectMember
=
cityModel
.
getCityObjectMember
();
CityObjectMember
com
=
cityObjectMember
.
get
(
0
);
AbstractCityObject
aco
=
com
.
getCityObject
();
Building
b
=
(
Building
)
aco
;
List
<
ADEComponent
>
gen
=
b
.
getGenericApplicationPropertyOfCityObject
();
ADEComponent
resultComp
=
gen
.
get
(
0
);
ValidationResult
result
=
(
ValidationResult
)
resultComp
;
assertEquals
(
ResultType
.
ERROR
,
result
.
getResult
());
assertFalse
(
result
.
getErrors
().
isEmpty
());
List
<
ValidationError
>
errors
=
result
.
getErrors
();
ValidationError
validationError
=
errors
.
get
(
0
);
assertTrue
(
validationError
instanceof
RingSelfIntersection
);
RingSelfIntersection
err
=
(
RingSelfIntersection
)
validationError
;
assertEquals
(
"_Simple_BD.1_PG.6_LR.1"
,
err
.
getLinearRingId
());
assertEquals
(
RingSelfIntType
.
POINT_TOUCHES_EDGE
,
err
.
getType
());
assertNull
(
err
.
getEdge2
());
Edge
edge1
=
err
.
getEdge1
();
assertEquals
(
10.0
,
edge1
.
getFrom
().
getValue
().
get
(
0
),
0.000001
);
assertEquals
(
11.0
,
edge1
.
getTo
().
getValue
().
get
(
0
),
0.000001
);
assertEquals
(
5.0
,
err
.
getVertex1
().
getValue
().
get
(
0
));
assertNull
(
err
.
getVertex2
());
}
@Test
void
testReadingRingNotClosedError
()
throws
ADEException
,
CityGMLBuilderException
,
CityGMLReadException
,
FileNotFoundException
{
CityModel
cityModel
=
readCityGml
(
"src/test/resources/SimpleSolid_RingNotClosed.gml"
);
List
<
CityObjectMember
>
cityObjectMember
=
cityModel
.
getCityObjectMember
();
CityObjectMember
com
=
cityObjectMember
.
get
(
0
);
AbstractCityObject
aco
=
com
.
getCityObject
();
Building
b
=
(
Building
)
aco
;
List
<
ADEComponent
>
gen
=
b
.
getGenericApplicationPropertyOfCityObject
();
ADEComponent
resultComp
=
gen
.
get
(
0
);
ValidationResult
result
=
(
ValidationResult
)
resultComp
;
assertEquals
(
ResultType
.
ERROR
,
result
.
getResult
());
assertFalse
(
result
.
getErrors
().
isEmpty
());
List
<
ValidationError
>
errors
=
result
.
getErrors
();
ValidationError
validationError
=
errors
.
get
(
0
);
assertTrue
(
validationError
instanceof
RingNotClosed
);
RingNotClosed
err
=
(
RingNotClosed
)
validationError
;
assertEquals
(
"_Simple_BD.1_PG.6_LR.1"
,
err
.
getLinearRingId
());
}
@Test
void
testReadingInteriorDisconnectedError
()
throws
ADEException
,
CityGMLBuilderException
,
CityGMLReadException
,
FileNotFoundException
{
CityModel
cityModel
=
readCityGml
(
"src/test/resources/SimpleSolid_InteriorDisconnected.gml"
);
List
<
CityObjectMember
>
cityObjectMember
=
cityModel
.
getCityObjectMember
();
CityObjectMember
com
=
cityObjectMember
.
get
(
0
);
AbstractCityObject
aco
=
com
.
getCityObject
();
Building
b
=
(
Building
)
aco
;
List
<
ADEComponent
>
gen
=
b
.
getGenericApplicationPropertyOfCityObject
();
ADEComponent
resultComp
=
gen
.
get
(
0
);
ValidationResult
result
=
(
ValidationResult
)
resultComp
;
assertEquals
(
ResultType
.
ERROR
,
result
.
getResult
());
assertFalse
(
result
.
getErrors
().
isEmpty
());
List
<
ValidationError
>
errors
=
result
.
getErrors
();
ValidationError
validationError
=
errors
.
get
(
0
);
assertTrue
(
validationError
instanceof
InteriorDisconnected
);
InteriorDisconnected
err
=
(
InteriorDisconnected
)
validationError
;
assertEquals
(
"_Simple_BD.1_PG.1"
,
err
.
getPolygonId
());
}
@Test
void
testReadingIntersectingRingsError
()
throws
ADEException
,
CityGMLBuilderException
,
CityGMLReadException
,
FileNotFoundException
{
CityModel
cityModel
=
readCityGml
(
"src/test/resources/SimpleSolid_IntersectingRings.gml"
);
List
<
CityObjectMember
>
cityObjectMember
=
cityModel
.
getCityObjectMember
();
CityObjectMember
com
=
cityObjectMember
.
get
(
0
);
AbstractCityObject
aco
=
com
.
getCityObject
();
Building
b
=
(
Building
)
aco
;
List
<
ADEComponent
>
gen
=
b
.
getGenericApplicationPropertyOfCityObject
();
ADEComponent
resultComp
=
gen
.
get
(
0
);
ValidationResult
result
=
(
ValidationResult
)
resultComp
;
assertEquals
(
ResultType
.
ERROR
,
result
.
getResult
());
assertFalse
(
result
.
getErrors
().
isEmpty
());
List
<
ValidationError
>
errors
=
result
.
getErrors
();
ValidationError
validationError
=
errors
.
get
(
0
);
assertTrue
(
validationError
instanceof
IntersectingRings
);
IntersectingRings
err
=
(
IntersectingRings
)
validationError
;
assertEquals
(
"_Simple_BD.1_PG.1"
,
err
.
getPolygonId
());
assertEquals
(
"_Simple_BD.1_PG.1_Ring1"
,
err
.
getLinearRingId1
());
assertEquals
(
"_Simple_BD.1_PG.1_Ring2"
,
err
.
getLinearRingId2
());
}
@Test
void
testReadingNonPlanarPolygonDistancePlaneError
()
throws
ADEException
,
CityGMLBuilderException
,
CityGMLReadException
,
FileNotFoundException
{
CityModel
cityModel
=
readCityGml
(
"src/test/resources/SimpleSolid_NonPlanarPolygonDistancePlane.gml"
);
List
<
CityObjectMember
>
cityObjectMember
=
cityModel
.
getCityObjectMember
();
CityObjectMember
com
=
cityObjectMember
.
get
(
0
);
AbstractCityObject
aco
=
com
.
getCityObject
();
Building
b
=
(
Building
)
aco
;
List
<
ADEComponent
>
gen
=
b
.
getGenericApplicationPropertyOfCityObject
();
ADEComponent
resultComp
=
gen
.
get
(
0
);
ValidationResult
result
=
(
ValidationResult
)
resultComp
;
assertEquals
(
ResultType
.
ERROR
,
result
.
getResult
());
assertFalse
(
result
.
getErrors
().
isEmpty
());
List
<
ValidationError
>
errors
=
result
.
getErrors
();
ValidationError
validationError
=
errors
.
get
(
0
);
assertTrue
(
validationError
instanceof
NonPlanarDistancePlane
);
NonPlanarDistancePlane
err
=
(
NonPlanarDistancePlane
)
validationError
;
assertEquals
(
"_Simple_BD.1_PG.1"
,
err
.
getPolygonId
());
assertEquals
(
1.0
,
err
.
getVertex
().
getValue
().
get
(
0
),
0.000001
);
assertEquals
(
0.001
,
err
.
getDistance
().
getValue
(),
0.000001
);
assertEquals
(
"m"
,
err
.
getDistance
().
getUom
());
}
@Test
void
testReadingInnerRingsNestedError
()
throws
ADEException
,
CityGMLBuilderException
,
CityGMLReadException
,
FileNotFoundException
{
CityModel
cityModel
=
readCityGml
(
"src/test/resources/SimpleSolid_InnerRingNested.gml"
);
List
<
CityObjectMember
>
cityObjectMember
=
cityModel
.
getCityObjectMember
();
CityObjectMember
com
=
cityObjectMember
.
get
(
0
);
AbstractCityObject
aco
=
com
.
getCityObject
();
Building
b
=
(
Building
)
aco
;
List
<
ADEComponent
>
gen
=
b
.
getGenericApplicationPropertyOfCityObject
();
ADEComponent
resultComp
=
gen
.
get
(
0
);
ValidationResult
result
=
(
ValidationResult
)
resultComp
;
assertEquals
(
ResultType
.
ERROR
,
result
.
getResult
());
assertFalse
(
result
.
getErrors
().
isEmpty
());
List
<
ValidationError
>
errors
=
result
.
getErrors
();
ValidationError
validationError
=
errors
.
get
(
0
);
assertTrue
(
validationError
instanceof
InnerRingsNested
);
InnerRingsNested
err
=
(
InnerRingsNested
)
validationError
;
assertEquals
(
"_Simple_BD.1_PG.1"
,
err
.
getPolygonId
());
assertEquals
(
"_Simple_BD.1_PG.1_Ring1"
,
err
.
getLinearRingId1
());
assertEquals
(
"_Simple_BD.1_PG.1_Ring2"
,
err
.
getLinearRingId2
());
}
@Test
void
testReadingHoleOutsideError
()
throws
ADEException
,
CityGMLBuilderException
,
CityGMLReadException
,
FileNotFoundException
{
CityModel
cityModel
=
readCityGml
(
"src/test/resources/SimpleSolid_HoleOutside.gml"
);
List
<
CityObjectMember
>
cityObjectMember
=
cityModel
.
getCityObjectMember
();
CityObjectMember
com
=
cityObjectMember
.
get
(
0
);
AbstractCityObject
aco
=
com
.
getCityObject
();
Building
b
=
(
Building
)
aco
;
List
<
ADEComponent
>
gen
=
b
.
getGenericApplicationPropertyOfCityObject
();
ADEComponent
resultComp
=
gen
.
get
(
0
);
ValidationResult
result
=
(
ValidationResult
)
resultComp
;
assertEquals
(
ResultType
.
ERROR
,
result
.
getResult
());
assertFalse
(
result
.
getErrors
().
isEmpty
());
List
<
ValidationError
>
errors
=
result
.
getErrors
();
ValidationError
validationError
=
errors
.
get
(
0
);
assertTrue
(
validationError
instanceof
HoleOutside
);
HoleOutside
err
=
(
HoleOutside
)
validationError
;
assertEquals
(
"_Simple_BD.1_PG.1"
,
err
.
getPolygonId
());
assertEquals
(
"_Simple_BD.1_PG.1_Ring1"
,
err
.
getLinearRingId
());
}
@Test
void
testReadingNonPlanarNormalsDeviationError
()
throws
ADEException
,
CityGMLBuilderException
,
CityGMLReadException
,
FileNotFoundException
{
CityModel
cityModel
=
readCityGml
(
"src/test/resources/SimpleSolid_NonPlanarPolygonNormalsDeviation.gml"
);
List
<
CityObjectMember
>
cityObjectMember
=
cityModel
.
getCityObjectMember
();
CityObjectMember
com
=
cityObjectMember
.
get
(
0
);
AbstractCityObject
aco
=
com
.
getCityObject
();
Building
b
=
(
Building
)
aco
;
List
<
ADEComponent
>
gen
=
b
.
getGenericApplicationPropertyOfCityObject
();
ADEComponent
resultComp
=
gen
.
get
(
0
);
ValidationResult
result
=
(
ValidationResult
)
resultComp
;
assertEquals
(
ResultType
.
ERROR
,
result
.
getResult
());
assertFalse
(
result
.
getErrors
().
isEmpty
());
List
<
ValidationError
>
errors
=
result
.
getErrors
();
ValidationError
validationError
=
errors
.
get
(
0
);
assertTrue
(
validationError
instanceof
NonPlanarNormalsDeviation
);
NonPlanarNormalsDeviation
err
=
(
NonPlanarNormalsDeviation
)
validationError
;
assertEquals
(
"_Simple_BD.1_PG.1"
,
err
.
getPolygonId
());
assertEquals
(
1.0
,
err
.
getDeviation
().
getValue
());
assertEquals
(
"deg"
,
err
.
getDeviation
().
getUom
());
}
@Test
void
testReadingOrientationRingsSameError
()
throws
ADEException
,
CityGMLBuilderException
,
CityGMLReadException
,
FileNotFoundException
{
CityModel
cityModel
=
readCityGml
(
"src/test/resources/SimpleSolid_OrientationRingsSame.gml"
);
List
<
CityObjectMember
>
cityObjectMember
=
cityModel
.
getCityObjectMember
();
CityObjectMember
com
=
cityObjectMember
.
get
(
0
);
AbstractCityObject
aco
=
com
.
getCityObject
();
Building
b
=
(
Building
)
aco
;
List
<
ADEComponent
>
gen
=
b
.
getGenericApplicationPropertyOfCityObject
();
ADEComponent
resultComp
=
gen
.
get
(
0
);
ValidationResult
result
=
(
ValidationResult
)
resultComp
;
assertEquals
(
ResultType
.
ERROR
,
result
.
getResult
());
assertFalse
(
result
.
getErrors
().
isEmpty
());
List
<
ValidationError
>
errors
=
result
.
getErrors
();
ValidationError
validationError
=
errors
.
get
(
0
);
assertTrue
(
validationError
instanceof
OrientationRingsSame
);
OrientationRingsSame
err
=
(
OrientationRingsSame
)
validationError
;
assertEquals
(
"_Simple_BD.1_PG.1"
,
err
.
getPolygonId
());
assertEquals
(
"_Simple_BD.1_PG.1_Ring1"
,
err
.
getLinearRingId
());
}
@Test
void
testReadingAllPolygonsWrongOrientationError
()
throws
ADEException
,
CityGMLBuilderException
,
CityGMLReadException
,
FileNotFoundException
{
CityModel
cityModel
=
readCityGml
(
"src/test/resources/SimpleSolid_AllPolygonsWrongOrientation.gml"
);
List
<
CityObjectMember
>
cityObjectMember
=
cityModel
.
getCityObjectMember
();
CityObjectMember
com
=
cityObjectMember
.
get
(
0
);
AbstractCityObject
aco
=
com
.
getCityObject
();
Building
b
=
(
Building
)
aco
;
List
<
ADEComponent
>
gen
=
b
.
getGenericApplicationPropertyOfCityObject
();
ADEComponent
resultComp
=
gen
.
get
(
0
);
ValidationResult
result
=
(
ValidationResult
)
resultComp
;
assertEquals
(
ResultType
.
ERROR
,
result
.
getResult
());
assertFalse
(
result
.
getErrors
().
isEmpty
());
List
<
ValidationError
>
errors
=
result
.
getErrors
();
ValidationError
validationError
=
errors
.
get
(
0
);
assertTrue
(
validationError
instanceof
AllPolygonsWrongOrientation
);
AllPolygonsWrongOrientation
err
=
(
AllPolygonsWrongOrientation
)
validationError
;
assertEquals
(
"_Simple_BD.1_Geom1"
,
err
.
getGeometryId
());
}
@Test
void
testReadingPolygonWrongOrientationError
()
throws
ADEException
,
CityGMLBuilderException
,
CityGMLReadException
,
FileNotFoundException
{
CityModel
cityModel
=
readCityGml
(
"src/test/resources/SimpleSolid_PolygonWrongOrientation.gml"
);
List
<
CityObjectMember
>
cityObjectMember
=
cityModel
.
getCityObjectMember
();
CityObjectMember
com
=
cityObjectMember
.
get
(
0
);
AbstractCityObject
aco
=
com
.
getCityObject
();
Building
b
=
(
Building
)
aco
;
List
<
ADEComponent
>
gen
=
b
.
getGenericApplicationPropertyOfCityObject
();
ADEComponent
resultComp
=
gen
.
get
(
0
);
ValidationResult
result
=
(
ValidationResult
)
resultComp
;
assertEquals
(
ResultType
.
ERROR
,
result
.
getResult
());
assertFalse
(
result
.
getErrors
().
isEmpty
());
List
<
ValidationError
>
errors
=
result
.
getErrors
();
ValidationError
validationError
=
errors
.
get
(
0
);
assertTrue
(
validationError
instanceof
PolygonWrongOrientation
);
PolygonWrongOrientation
err
=
(
PolygonWrongOrientation
)
validationError
;
assertEquals
(
"_Simple_BD.1_Geom1"
,
err
.
getGeometryId
());
assertFalse
(
err
.
getEdges
().
isEmpty
());
List
<
Edge
>
edges
=
err
.
getEdges
();
Edge
edge
=
edges
.
get
(
0
);
DirectPosition
from
=
edge
.
getFrom
();
assertEquals
(
10.0
,
from
.
getValue
().
get
(
0
),
0.000001
);
assertEquals
(
11.0
,
edge
.
getTo
().
getValue
().
get
(
0
),
0.000001
);
}
@Test
void
testReadingNonManifoldVertexError
()
throws
ADEException
,
CityGMLBuilderException
,
CityGMLReadException
,
FileNotFoundException
{
CityModel
cityModel
=
readCityGml
(
"src/test/resources/SimpleSolid_NonManifoldVertex.gml"
);
List
<
CityObjectMember
>
cityObjectMember
=
cityModel
.
getCityObjectMember
();
CityObjectMember
com
=
cityObjectMember
.
get
(
0
);
AbstractCityObject
aco
=
com
.
getCityObject
();
Building
b
=
(
Building
)
aco
;
List
<
ADEComponent
>
gen
=
b
.
getGenericApplicationPropertyOfCityObject
();
ADEComponent
resultComp
=
gen
.
get
(
0
);
ValidationResult
result
=
(
ValidationResult
)
resultComp
;
assertEquals
(
ResultType
.
ERROR
,
result
.
getResult
());
assertFalse
(
result
.
getErrors
().
isEmpty
());
List
<
ValidationError
>
errors
=
result
.
getErrors
();
ValidationError
validationError
=
errors
.
get
(
0
);
assertTrue
(
validationError
instanceof
NonManifoldVertex
);
NonManifoldVertex
err
=
(
NonManifoldVertex
)
validationError
;
assertEquals
(
"_Simple_BD.1_Geom1"
,
err
.
getGeometryId
());
DirectPosition
vertex
=
err
.
getVertex
();
assertEquals
(
1.0
,
vertex
.
getValue
().
get
(
0
),
0.000001
);
}
@Test
void
testReadingNonManifoldEdgeError
()
throws
ADEException
,
CityGMLBuilderException
,
CityGMLReadException
,
FileNotFoundException
{
CityModel
cityModel
=
readCityGml
(
"src/test/resources/SimpleSolid_NonManifoldEdge.gml"
);
List
<
CityObjectMember
>
cityObjectMember
=
cityModel
.
getCityObjectMember
();
CityObjectMember
com
=
cityObjectMember
.
get
(
0
);
AbstractCityObject
aco
=
com
.
getCityObject
();
Building
b
=
(
Building
)
aco
;
List
<
ADEComponent
>
gen
=
b
.
getGenericApplicationPropertyOfCityObject
();
ADEComponent
resultComp
=
gen
.
get
(
0
);
ValidationResult
result
=
(
ValidationResult
)
resultComp
;
assertEquals
(
ResultType
.
ERROR
,
result
.
getResult
());
assertFalse
(
result
.
getErrors
().
isEmpty
());
List
<
ValidationError
>
errors
=
result
.
getErrors
();
ValidationError
validationError
=
errors
.
get
(
0
);
assertTrue
(
validationError
instanceof
NonManifoldEdge
);
NonManifoldEdge
err
=
(
NonManifoldEdge
)
validationError
;
assertEquals
(
"_Simple_BD.1_Geom1"
,
err
.
getGeometryId
());
assertFalse
(
err
.
getEdges
().
isEmpty
());
List
<
Edge
>
edges
=
err
.
getEdges
();
Edge
edge
=
edges
.
get
(
0
);
DirectPosition
from
=
edge
.
getFrom
();
assertEquals
(
10.0
,
from
.
getValue
().
get
(
0
),
0.000001
);
assertEquals
(
11.0
,
edge
.
getTo
().
getValue
().
get
(
0
),
0.000001
);
}
@Test
void
testReadingSolidNotClosedError
()
throws
ADEException
,
CityGMLBuilderException
,
CityGMLReadException
,
FileNotFoundException
{
CityModel
cityModel
=
readCityGml
(
"src/test/resources/SimpleSolid_SolidNotClosed.gml"
);
List
<
CityObjectMember
>
cityObjectMember
=
cityModel
.
getCityObjectMember
();
CityObjectMember
com
=
cityObjectMember
.
get
(
0
);
AbstractCityObject
aco
=
com
.
getCityObject
();
Building
b
=
(
Building
)
aco
;
List
<
ADEComponent
>
gen
=
b
.
getGenericApplicationPropertyOfCityObject
();
ADEComponent
resultComp
=
gen
.
get
(
0
);
ValidationResult
result
=
(
ValidationResult
)
resultComp
;
assertEquals
(
ResultType
.
ERROR
,
result
.
getResult
());
assertFalse
(
result
.
getErrors
().
isEmpty
());
List
<
ValidationError
>
errors
=
result
.
getErrors
();
ValidationError
validationError
=
errors
.
get
(
0
);
assertTrue
(
validationError
instanceof
SolidNotClosed
);
SolidNotClosed
err
=
(
SolidNotClosed
)
validationError
;
assertEquals
(
"_Simple_BD.1_Geom1"
,
err
.
getGeometryId
());
assertFalse
(
err
.
getEdges
().
isEmpty
());
List
<
Edge
>
edges
=
err
.
getEdges
();
Edge
edge
=
edges
.
get
(
0
);
DirectPosition
from
=
edge
.
getFrom
();
assertEquals
(
10.0
,
from
.
getValue
().
get
(
0
),
0.000001
);
assertEquals
(
11.0
,
edge
.
getTo
().
getValue
().
get
(
0
),
0.000001
);
}
@Test
void
testReadingTooFewPolygonsError
()
throws
ADEException
,
CityGMLBuilderException
,
CityGMLReadException
,
FileNotFoundException
{
CityModel
cityModel
=
readCityGml
(
"src/test/resources/SimpleSolid_TooFewPolygons.gml"
);
List
<
CityObjectMember
>
cityObjectMember
=
cityModel
.
getCityObjectMember
();
CityObjectMember
com
=
cityObjectMember
.
get
(
0
);
AbstractCityObject
aco
=
com
.
getCityObject
();
Building
b
=
(
Building
)
aco
;
List
<
ADEComponent
>
gen
=
b
.
getGenericApplicationPropertyOfCityObject
();
ADEComponent
resultComp
=
gen
.
get
(
0
);
ValidationResult
result
=
(
ValidationResult
)
resultComp
;
assertEquals
(
ResultType
.
ERROR
,
result
.
getResult
());
assertFalse
(
result
.
getErrors
().
isEmpty
());
List
<
ValidationError
>
errors
=
result
.
getErrors
();
ValidationError
validationError
=
errors
.
get
(
0
);
assertTrue
(
validationError
instanceof
TooFewPolygons
);
TooFewPolygons
err
=
(
TooFewPolygons
)
validationError
;
assertEquals
(
"_Simple_BD.1_Geom1"
,
err
.
getGeometryId
());
}
@Test
void
testReadingMultipleConnectedComponentsError
()
throws
ADEException
,
CityGMLBuilderException
,
CityGMLReadException
,
FileNotFoundException
{
CityModel
cityModel
=
readCityGml
(
"src/test/resources/SimpleSolid_MultipleConnectedComponents.gml"
);
List
<
CityObjectMember
>
cityObjectMember
=
cityModel
.
getCityObjectMember
();
CityObjectMember
com
=
cityObjectMember
.
get
(
0
);
AbstractCityObject
aco
=
com
.
getCityObject
();
Building
b
=
(
Building
)
aco
;
List
<
ADEComponent
>
gen
=
b
.
getGenericApplicationPropertyOfCityObject
();
ADEComponent
resultComp
=
gen
.
get
(
0
);
ValidationResult
result
=
(
ValidationResult
)
resultComp
;
assertEquals
(
ResultType
.
ERROR
,
result
.
getResult
());
assertFalse
(
result
.
getErrors
().
isEmpty
());
List
<
ValidationError
>
errors
=
result
.
getErrors
();
ValidationError
validationError
=
errors
.
get
(
0
);
assertTrue
(
validationError
instanceof
MultipleConnectedComponents
);
MultipleConnectedComponents
err
=
(
MultipleConnectedComponents
)
validationError
;
assertEquals
(
"_Simple_BD.1_Geom1"
,
err
.
getGeometryId
());
assertEquals
(
"_Simple_BD.1_PG.1"
,
err
.
getComponents
().
get
(
0
).
getPolygonIds
().
get
(
0
));
assertEquals
(
"_Simple_BD.1_PG.2"
,
err
.
getComponents
().
get
(
0
).
getPolygonIds
().
get
(
1
));
assertEquals
(
"_Simple_BD.1_PG.3"
,
err
.
getComponents
().
get
(
1
).
getPolygonIds
().
get
(
0
));
assertEquals
(
"_Simple_BD.1_PG.4"
,
err
.
getComponents
().
get
(
1
).
getPolygonIds
().
get
(
1
));
}
@Test
void
testWritingAttributeMissingError
()
throws
ADEException
,
CityGMLBuilderException
,
CityGMLWriteException
,
CityGMLReadException
{
CityModel
model
=
new
CityModel
();
Building
b
=
new
Building
();
model
.
getCityObjectMember
().
add
(
new
CityObjectMember
(
b
));
ValidationResult
result
=
new
ValidationResult
();
result
.
setResult
(
ResultType
.
ERROR
);
b
.
addGenericApplicationPropertyOfCityObject
(
result
);
AttributeMissing
error
=
new
AttributeMissing
();
error
.
setAttributeName
(
"TestName"
);
error
.
setChildId
(
"TestId"
);
error
.
setGeneric
(
true
);
result
.
getErrors
().
add
(
error
);
byte
[]
gml
=
writeCityGml
(
model
);
model
=
readCityGml
(
gml
);
AbstractCityObject
co
=
model
.
getCityObjectMember
().
get
(
0
).
getCityObject
();
List
<
ADEComponent
>
ades
=
co
.
getGenericApplicationPropertyOfCityObject
();
ADEComponent
adeComponent
=
ades
.
get
(
0
);
ValidationResult
valRes
=
(
ValidationResult
)
adeComponent
;
assertEquals
(
ResultType
.
ERROR
,
valRes
.
getResult
());
ValidationError
valError
=
valRes
.
getErrors
().
get
(
0
);
AttributeMissing
error2
=
(
AttributeMissing
)
valError
;
assertEquals
(
error
.
getAttributeName
(),
error2
.
getAttributeName
());
assertEquals
(
error
.
getChildId
(),
error2
.
getChildId
());
assertEquals
(
error
.
isGeneric
(),
error2
.
isGeneric
());
}
@Test
void
testWritingAttributeWrongValueError
()
throws
ADEException
,
CityGMLBuilderException
,
CityGMLWriteException
,
CityGMLReadException
{
CityModel
model
=
new
CityModel
();
Building
b
=
new
Building
();
model
.
getCityObjectMember
().
add
(
new
CityObjectMember
(
b
));
ValidationResult
result
=
new
ValidationResult
();
result
.
setResult
(
ResultType
.
ERROR
);
b
.
addGenericApplicationPropertyOfCityObject
(
result
);
AttributeWrongValue
error
=
new
AttributeWrongValue
();
error
.
setAttributeName
(
"TestName"
);
error
.
setChildId
(
"TestId"
);
error
.
setGeneric
(
true
);
result
.
getErrors
().
add
(
error
);
byte
[]
gml
=
writeCityGml
(
model
);
model
=
readCityGml
(
gml
);
AbstractCityObject
co
=
model
.
getCityObjectMember
().
get
(
0
).
getCityObject
();
List
<
ADEComponent
>
ades
=
co
.
getGenericApplicationPropertyOfCityObject
();
ADEComponent
adeComponent
=
ades
.
get
(
0
);
ValidationResult
valRes
=
(
ValidationResult
)
adeComponent
;
assertEquals
(
ResultType
.
ERROR
,
valRes
.
getResult
());
ValidationError
valError
=
valRes
.
getErrors
().
get
(
0
);
AttributeWrongValue
error2
=
(
AttributeWrongValue
)
valError
;
assertEquals
(
error
.
getAttributeName
(),
error2
.
getAttributeName
());
assertEquals
(
error
.
getChildId
(),
error2
.
getChildId
());
assertEquals
(
error
.
isGeneric
(),
error2
.
isGeneric
());
}
@Test
void
testWritingMultipleConnectedComponentsError
()
throws
ADEException
,
CityGMLBuilderException
,
CityGMLWriteException
,
CityGMLReadException
{
CityModel
model
=
new
CityModel
();
Building
b
=
new
Building
();
model
.
getCityObjectMember
().
add
(
new
CityObjectMember
(
b
));
ValidationResult
result
=
new
ValidationResult
();
result
.
setResult
(
ResultType
.
ERROR
);
b
.
addGenericApplicationPropertyOfCityObject
(
result
);
MultipleConnectedComponents
error
=
new
MultipleConnectedComponents
();
error
.
setGeometryId
(
"TestGeometry"
);
Component
c1
=
new
Component
();
c1
.
getPolygonIds
().
add
(
"TestPoly"
);
error
.
getComponents
().
add
(
c1
);
result
.
getErrors
().
add
(
error
);
byte
[]
gml
=
writeCityGml
(
model
);
model
=
readCityGml
(
gml
);
AbstractCityObject
co
=
model
.
getCityObjectMember
().
get
(
0
).
getCityObject
();
List
<
ADEComponent
>
ades
=
co
.
getGenericApplicationPropertyOfCityObject
();
ADEComponent
adeComponent
=
ades
.
get
(
0
);
ValidationResult
valRes
=
(
ValidationResult
)
adeComponent
;
assertEquals
(
ResultType
.
ERROR
,
valRes
.
getResult
());
ValidationError
valError
=
valRes
.
getErrors
().
get
(
0
);
MultipleConnectedComponents
error2
=
(
MultipleConnectedComponents
)
valError
;
assertEquals
(
error
.
getGeometryId
(),
error2
.
getGeometryId
());
assertEquals
(
error
.
getComponents
().
get
(
0
).
getPolygonIds
().
get
(
0
),
error2
.
getComponents
().
get
(
0
).
getPolygonIds
().
get
(
0
));
}
@Test
void
testWritingTooFewPolygonsError
()
throws
ADEException
,
CityGMLBuilderException
,
CityGMLWriteException
,
CityGMLReadException
{
CityModel
model
=
new
CityModel
();
Building
b
=
new
Building
();
model
.
getCityObjectMember
().
add
(
new
CityObjectMember
(
b
));
ValidationResult
result
=
new
ValidationResult
();
result
.
setResult
(
ResultType
.
ERROR
);
b
.
addGenericApplicationPropertyOfCityObject
(
result
);
TooFewPolygons
error
=
new
TooFewPolygons
();
error
.
setGeometryId
(
"TestGeometry"
);
result
.
getErrors
().
add
(
error
);
byte
[]
gml
=
writeCityGml
(
model
);
model
=
readCityGml
(
gml
);
AbstractCityObject
co
=
model
.
getCityObjectMember
().
get
(
0
).
getCityObject
();
List
<
ADEComponent
>
ades
=
co
.
getGenericApplicationPropertyOfCityObject
();
ADEComponent
adeComponent
=
ades
.
get
(
0
);
ValidationResult
valRes
=
(
ValidationResult
)
adeComponent
;
assertEquals
(
ResultType
.
ERROR
,
valRes
.
getResult
());
ValidationError
valError
=
valRes
.
getErrors
().
get
(
0
);
TooFewPolygons
error2
=
(
TooFewPolygons
)
valError
;
assertEquals
(
error
.
getGeometryId
(),
error2
.
getGeometryId
());
}
@Test
void
testWritingSolidNotClosedError
()
throws
ADEException
,
CityGMLBuilderException
,
CityGMLWriteException
,
CityGMLReadException
{
CityModel
model
=
new
CityModel
();
Building
b
=
new
Building
();
model
.
getCityObjectMember
().
add
(
new
CityObjectMember
(
b
));
ValidationResult
result
=
new
ValidationResult
();
result
.
setResult
(
ResultType
.
ERROR
);
b
.
addGenericApplicationPropertyOfCityObject
(
result
);
SolidNotClosed
error
=
new
SolidNotClosed
();
error
.
setGeometryId
(
"TestGeometry"
);
DirectPosition
from
=
new
DirectPosition
();
from
.
getValue
().
add
(
10.0
);
DirectPosition
to
=
new
DirectPosition
();
to
.
getValue
().
add
(
11.0
);
Edge
e
=
new
Edge
();
e
.
setFrom
(
from
);
e
.
setTo
(
to
);
error
.
getEdges
().
add
(
e
);
result
.
getErrors
().
add
(
error
);
byte
[]
gml
=
writeCityGml
(
model
);
model
=
readCityGml
(
gml
);
AbstractCityObject
co
=
model
.
getCityObjectMember
().
get
(
0
).
getCityObject
();
List
<
ADEComponent
>
ades
=
co
.
getGenericApplicationPropertyOfCityObject
();
ADEComponent
adeComponent
=
ades
.
get
(
0
);
ValidationResult
valRes
=
(
ValidationResult
)
adeComponent
;
assertEquals
(
ResultType
.
ERROR
,
valRes
.
getResult
());
ValidationError
valError
=
valRes
.
getErrors
().
get
(
0
);
SolidNotClosed
error2
=
(
SolidNotClosed
)
valError
;
assertEquals
(
error
.
getGeometryId
(),
error2
.
getGeometryId
());
Edge
edge
=
error
.
getEdges
().
get
(
0
);
assertEquals
(
edge
.
getFrom
().
getValue
().
get
(
0
),
e
.
getFrom
().
getValue
().
get
(
0
),
0.00001
);
assertEquals
(
edge
.
getTo
().
getValue
().
get
(
0
),
e
.
getTo
().
getValue
().
get
(
0
),
0.00001
);
}
@Test
void
testWritingNonManifoldEdgeError
()
throws
ADEException
,
CityGMLBuilderException
,
CityGMLWriteException
,
CityGMLReadException
{
CityModel
model
=
new
CityModel
();
Building
b
=
new
Building
();
model
.
getCityObjectMember
().
add
(
new
CityObjectMember
(
b
));
ValidationResult
result
=
new
ValidationResult
();
result
.
setResult
(
ResultType
.
ERROR
);
b
.
addGenericApplicationPropertyOfCityObject
(
result
);
NonManifoldEdge
error
=
new
NonManifoldEdge
();
error
.
setGeometryId
(
"TestGeometry"
);
DirectPosition
from
=
new
DirectPosition
();
from
.
getValue
().
add
(
10.0
);
DirectPosition
to
=
new
DirectPosition
();
to
.
getValue
().
add
(
11.0
);
Edge
e
=
new
Edge
();
e
.
setFrom
(
from
);
e
.
setTo
(
to
);
error
.
getEdges
().
add
(
e
);
result
.
getErrors
().
add
(
error
);
byte
[]
gml
=
writeCityGml
(
model
);
model
=
readCityGml
(
gml
);
AbstractCityObject
co
=
model
.
getCityObjectMember
().
get
(
0
).
getCityObject
();
List
<
ADEComponent
>
ades
=
co
.
getGenericApplicationPropertyOfCityObject
();
ADEComponent
adeComponent
=
ades
.
get
(
0
);
ValidationResult
valRes
=
(
ValidationResult
)
adeComponent
;
assertEquals
(
ResultType
.
ERROR
,
valRes
.
getResult
());
ValidationError
valError
=
valRes
.
getErrors
().
get
(
0
);
NonManifoldEdge
error2
=
(
NonManifoldEdge
)
valError
;
assertEquals
(
error
.
getGeometryId
(),
error2
.
getGeometryId
());
Edge
edge
=
error
.
getEdges
().
get
(
0
);
assertEquals
(
edge
.
getFrom
().
getValue
().
get
(
0
),
e
.
getFrom
().
getValue
().
get
(
0
),
0.00001
);
assertEquals
(
edge
.
getTo
().
getValue
().
get
(
0
),
e
.
getTo
().
getValue
().
get
(
0
),
0.00001
);
}
@Test
void
testWritingNonManifoldVertexError
()
throws
ADEException
,
CityGMLBuilderException
,
CityGMLWriteException
,
CityGMLReadException
{
CityModel
model
=
new
CityModel
();
Building
b
=
new
Building
();
model
.
getCityObjectMember
().
add
(
new
CityObjectMember
(
b
));
ValidationResult
result
=
new
ValidationResult
();
result
.
setResult
(
ResultType
.
ERROR
);
b
.
addGenericApplicationPropertyOfCityObject
(
result
);
NonManifoldVertex
error
=
new
NonManifoldVertex
();
error
.
setGeometryId
(
"TestGeometry"
);
DirectPosition
vertex
=
new
DirectPosition
();
vertex
.
getValue
().
add
(
10.0
);
error
.
setVertex
(
vertex
);
result
.
getErrors
().
add
(
error
);
byte
[]
gml
=
writeCityGml
(
model
);
model
=
readCityGml
(
gml
);
AbstractCityObject
co
=
model
.
getCityObjectMember
().
get
(
0
).
getCityObject
();
List
<
ADEComponent
>
ades
=
co
.
getGenericApplicationPropertyOfCityObject
();
ADEComponent
adeComponent
=
ades
.
get
(
0
);
ValidationResult
valRes
=
(
ValidationResult
)
adeComponent
;
assertEquals
(
ResultType
.
ERROR
,
valRes
.
getResult
());
ValidationError
valError
=
valRes
.
getErrors
().
get
(
0
);
NonManifoldVertex
error2
=
(
NonManifoldVertex
)
valError
;
assertEquals
(
error
.
getGeometryId
(),
error2
.
getGeometryId
());
assertEquals
(
error
.
getVertex
().
getValue
().
get
(
0
),
error2
.
getVertex
().
getValue
().
get
(
0
));
}
@Test
void
testWritingPolygonWrongOrientationError
()
throws
ADEException
,
CityGMLBuilderException
,
CityGMLWriteException
,
CityGMLReadException
{
CityModel
model
=
new
CityModel
();
Building
b
=
new
Building
();
model
.
getCityObjectMember
().
add
(
new
CityObjectMember
(
b
));
ValidationResult
result
=
new
ValidationResult
();
result
.
setResult
(
ResultType
.
ERROR
);
b
.
addGenericApplicationPropertyOfCityObject
(
result
);
PolygonWrongOrientation
error
=
new
PolygonWrongOrientation
();
error
.
setGeometryId
(
"TestGeometry"
);
DirectPosition
from
=
new
DirectPosition
();
from
.
getValue
().
add
(
10.0
);
DirectPosition
to
=
new
DirectPosition
();
to
.
getValue
().
add
(
11.0
);
Edge
e
=
new
Edge
();
e
.
setFrom
(
from
);
e
.
setTo
(
to
);
error
.
getEdges
().
add
(
e
);
result
.
getErrors
().
add
(
error
);
byte
[]
gml
=
writeCityGml
(
model
);
model
=
readCityGml
(
gml
);
AbstractCityObject
co
=
model
.
getCityObjectMember
().
get
(
0
).
getCityObject
();
List
<
ADEComponent
>
ades
=
co
.
getGenericApplicationPropertyOfCityObject
();
ADEComponent
adeComponent
=
ades
.
get
(
0
);
ValidationResult
valRes
=
(
ValidationResult
)
adeComponent
;
assertEquals
(
ResultType
.
ERROR
,
valRes
.
getResult
());
ValidationError
valError
=
valRes
.
getErrors
().
get
(
0
);
PolygonWrongOrientation
error2
=
(
PolygonWrongOrientation
)
valError
;
assertEquals
(
error
.
getGeometryId
(),
error2
.
getGeometryId
());
Edge
edge
=
error
.
getEdges
().
get
(
0
);
assertEquals
(
edge
.
getFrom
().
getValue
().
get
(
0
),
e
.
getFrom
().
getValue
().
get
(
0
),
0.00001
);
assertEquals
(
edge
.
getTo
().
getValue
().
get
(
0
),
e
.
getTo
().
getValue
().
get
(
0
),
0.00001
);
}
@Test
void
testWritingAllPolygonsWrongOrientationError
()
throws
ADEException
,
CityGMLBuilderException
,
CityGMLWriteException
,
CityGMLReadException
{
CityModel
model
=
new
CityModel
();
Building
b
=
new
Building
();
model
.
getCityObjectMember
().
add
(
new
CityObjectMember
(
b
));
ValidationResult
result
=
new
ValidationResult
();
result
.
setResult
(
ResultType
.
ERROR
);
b
.
addGenericApplicationPropertyOfCityObject
(
result
);
AllPolygonsWrongOrientation
error
=
new
AllPolygonsWrongOrientation
();
error
.
setGeometryId
(
"TestGeometry"
);
result
.
getErrors
().
add
(
error
);
byte
[]
gml
=
writeCityGml
(
model
);
model
=
readCityGml
(
gml
);
AbstractCityObject
co
=
model
.
getCityObjectMember
().
get
(
0
).
getCityObject
();
List
<
ADEComponent
>
ades
=
co
.
getGenericApplicationPropertyOfCityObject
();
ADEComponent
adeComponent
=
ades
.
get
(
0
);
ValidationResult
valRes
=
(
ValidationResult
)
adeComponent
;
assertEquals
(
ResultType
.
ERROR
,
valRes
.
getResult
());
ValidationError
valError
=
valRes
.
getErrors
().
get
(
0
);
AllPolygonsWrongOrientation
error2
=
(
AllPolygonsWrongOrientation
)
valError
;
assertEquals
(
error
.
getGeometryId
(),
error2
.
getGeometryId
());
}
@Test
void
testWritingOrientationRingsSameError
()
throws
ADEException
,
CityGMLBuilderException
,
CityGMLWriteException
,
CityGMLReadException
{
CityModel
model
=
new
CityModel
();
Building
b
=
new
Building
();
model
.
getCityObjectMember
().
add
(
new
CityObjectMember
(
b
));
ValidationResult
result
=
new
ValidationResult
();
result
.
setResult
(
ResultType
.
ERROR
);
b
.
addGenericApplicationPropertyOfCityObject
(
result
);
OrientationRingsSame
error
=
new
OrientationRingsSame
();
error
.
setPolygonId
(
"TestPolygon"
);
error
.
setLinearRingId
(
"TestRing"
);
result
.
getErrors
().
add
(
error
);
byte
[]
gml
=
writeCityGml
(
model
);
model
=
readCityGml
(
gml
);
AbstractCityObject
co
=
model
.
getCityObjectMember
().
get
(
0
).
getCityObject
();
List
<
ADEComponent
>
ades
=
co
.
getGenericApplicationPropertyOfCityObject
();
ADEComponent
adeComponent
=
ades
.
get
(
0
);
ValidationResult
valRes
=
(
ValidationResult
)
adeComponent
;
assertEquals
(
ResultType
.
ERROR
,
valRes
.
getResult
());
ValidationError
valError
=
valRes
.
getErrors
().
get
(
0
);
OrientationRingsSame
error2
=
(
OrientationRingsSame
)
valError
;
assertEquals
(
error
.
getPolygonId
(),
error2
.
getPolygonId
());
assertEquals
(
error
.
getLinearRingId
(),
error2
.
getLinearRingId
());
}
@Test
void
testWritingNonPlanarNormalsDeviationError
()
throws
ADEException
,
CityGMLBuilderException
,
CityGMLWriteException
,
CityGMLReadException
{
CityModel
model
=
new
CityModel
();
Building
b
=
new
Building
();
model
.
getCityObjectMember
().
add
(
new
CityObjectMember
(
b
));
ValidationResult
result
=
new
ValidationResult
();
result
.
setResult
(
ResultType
.
ERROR
);
b
.
addGenericApplicationPropertyOfCityObject
(
result
);
NonPlanarNormalsDeviation
error
=
new
NonPlanarNormalsDeviation
();
error
.
setPolygonId
(
"TestPolygon"
);
Angle
deviation
=
new
Angle
();
deviation
.
setValue
(
1.0
);
deviation
.
setUom
(
"deg"
);
error
.
setDeviation
(
deviation
);
result
.
getErrors
().
add
(
error
);
byte
[]
gml
=
writeCityGml
(
model
);
model
=
readCityGml
(
gml
);
AbstractCityObject
co
=
model
.
getCityObjectMember
().
get
(
0
).
getCityObject
();
List
<
ADEComponent
>
ades
=
co
.
getGenericApplicationPropertyOfCityObject
();
ADEComponent
adeComponent
=
ades
.
get
(
0
);
ValidationResult
valRes
=
(
ValidationResult
)
adeComponent
;
assertEquals
(
ResultType
.
ERROR
,
valRes
.
getResult
());
ValidationError
valError
=
valRes
.
getErrors
().
get
(
0
);
NonPlanarNormalsDeviation
error2
=
(
NonPlanarNormalsDeviation
)
valError
;
assertEquals
(
error
.
getPolygonId
(),
error2
.
getPolygonId
());
assertEquals
(
error
.
getDeviation
().
getValue
(),
error2
.
getDeviation
().
getValue
());
assertEquals
(
error
.
getDeviation
().
getUom
(),
error2
.
getDeviation
().
getUom
());
}
@Test
void
testWritingHoleOutsideError
()
throws
ADEException
,
CityGMLBuilderException
,
CityGMLWriteException
,
CityGMLReadException
{
CityModel
model
=
new
CityModel
();
Building
b
=
new
Building
();
model
.
getCityObjectMember
().
add
(
new
CityObjectMember
(
b
));
ValidationResult
result
=
new
ValidationResult
();
result
.
setResult
(
ResultType
.
ERROR
);
b
.
addGenericApplicationPropertyOfCityObject
(
result
);
HoleOutside
error
=
new
HoleOutside
();
error
.
setPolygonId
(
"TestPolygon"
);
error
.
setLinearRingId
(
"TestRing1"
);
result
.
getErrors
().
add
(
error
);
byte
[]
gml
=
writeCityGml
(
model
);
model
=
readCityGml
(
gml
);
AbstractCityObject
co
=
model
.
getCityObjectMember
().
get
(
0
).
getCityObject
();
List
<
ADEComponent
>
ades
=
co
.
getGenericApplicationPropertyOfCityObject
();
ADEComponent
adeComponent
=
ades
.
get
(
0
);
ValidationResult
valRes
=
(
ValidationResult
)
adeComponent
;
assertEquals
(
ResultType
.
ERROR
,
valRes
.
getResult
());
ValidationError
valError
=
valRes
.
getErrors
().
get
(
0
);
HoleOutside
error2
=
(
HoleOutside
)
valError
;
assertEquals
(
error
.
getPolygonId
(),
error2
.
getPolygonId
());
assertEquals
(
error
.
getLinearRingId
(),
error2
.
getLinearRingId
());
}
@Test
void
testWritingInnerRingsNestedError
()
throws
ADEException
,
CityGMLBuilderException
,
CityGMLWriteException
,
CityGMLReadException
{
CityModel
model
=
new
CityModel
();
Building
b
=
new
Building
();
model
.
getCityObjectMember
().
add
(
new
CityObjectMember
(
b
));
ValidationResult
result
=
new
ValidationResult
();
result
.
setResult
(
ResultType
.
ERROR
);
b
.
addGenericApplicationPropertyOfCityObject
(
result
);
InnerRingsNested
error
=
new
InnerRingsNested
();
error
.
setPolygonId
(
"TestPolygon"
);
error
.
setLinearRingId1
(
"TestRing1"
);
error
.
setLinearRingId2
(
"TestRing2"
);
result
.
getErrors
().
add
(
error
);
byte
[]
gml
=
writeCityGml
(
model
);
model
=
readCityGml
(
gml
);
AbstractCityObject
co
=
model
.
getCityObjectMember
().
get
(
0
).
getCityObject
();
List
<
ADEComponent
>
ades
=
co
.
getGenericApplicationPropertyOfCityObject
();
ADEComponent
adeComponent
=
ades
.
get
(
0
);
ValidationResult
valRes
=
(
ValidationResult
)
adeComponent
;
assertEquals
(
ResultType
.
ERROR
,
valRes
.
getResult
());
ValidationError
valError
=
valRes
.
getErrors
().
get
(
0
);
InnerRingsNested
error2
=
(
InnerRingsNested
)
valError
;
assertEquals
(
error
.
getPolygonId
(),
error2
.
getPolygonId
());
assertEquals
(
error
.
getLinearRingId1
(),
error2
.
getLinearRingId1
());
assertEquals
(
error
.
getLinearRingId2
(),
error2
.
getLinearRingId2
());
}
@Test
void
testWritingNonPlanarDistancePlaneError
()
throws
ADEException
,
CityGMLBuilderException
,
CityGMLWriteException
,
CityGMLReadException
{
CityModel
model
=
new
CityModel
();
Building
b
=
new
Building
();
model
.
getCityObjectMember
().
add
(
new
CityObjectMember
(
b
));
ValidationResult
result
=
new
ValidationResult
();
result
.
setResult
(
ResultType
.
ERROR
);
b
.
addGenericApplicationPropertyOfCityObject
(
result
);
NonPlanarDistancePlane
error
=
new
NonPlanarDistancePlane
();
error
.
setPolygonId
(
"TestPolygon"
);
DirectPosition
vertex
=
new
DirectPosition
();
vertex
.
getValue
().
add
(
1.0
);
error
.
setVertex
(
vertex
);
Length
distance
=
new
Length
(
0.1
);
distance
.
setUom
(
"m"
);
error
.
setDistance
(
distance
);
result
.
getErrors
().
add
(
error
);
byte
[]
gml
=
writeCityGml
(
model
);
model
=
readCityGml
(
gml
);
AbstractCityObject
co
=
model
.
getCityObjectMember
().
get
(
0
).
getCityObject
();
List
<
ADEComponent
>
ades
=
co
.
getGenericApplicationPropertyOfCityObject
();
ADEComponent
adeComponent
=
ades
.
get
(
0
);
ValidationResult
valRes
=
(
ValidationResult
)
adeComponent
;
assertEquals
(
ResultType
.
ERROR
,
valRes
.
getResult
());
ValidationError
valError
=
valRes
.
getErrors
().
get
(
0
);
NonPlanarDistancePlane
error2
=
(
NonPlanarDistancePlane
)
valError
;
assertEquals
(
error
.
getPolygonId
(),
error2
.
getPolygonId
());
assertEquals
(
error
.
getVertex
().
getValue
().
get
(
0
),
error2
.
getVertex
().
getValue
().
get
(
0
),
0.00001
);
assertEquals
(
error
.
getDistance
().
getValue
(),
error2
.
getDistance
().
getValue
(),
0.00001
);
}
@Test
void
testWritingIntersectingRingsError
()
throws
ADEException
,
CityGMLBuilderException
,
CityGMLWriteException
,
CityGMLReadException
{
CityModel
model
=
new
CityModel
();
Building
b
=
new
Building
();
model
.
getCityObjectMember
().
add
(
new
CityObjectMember
(
b
));
ValidationResult
result
=
new
ValidationResult
();
result
.
setResult
(
ResultType
.
ERROR
);
b
.
addGenericApplicationPropertyOfCityObject
(
result
);
IntersectingRings
error
=
new
IntersectingRings
();
error
.
setPolygonId
(
"TestPolygon"
);
error
.
setLinearRingId1
(
"TestRing1"
);
error
.
setLinearRingId2
(
"TestRing2"
);
result
.
getErrors
().
add
(
error
);
byte
[]
gml
=
writeCityGml
(
model
);
model
=
readCityGml
(
gml
);
AbstractCityObject
co
=
model
.
getCityObjectMember
().
get
(
0
).
getCityObject
();
List
<
ADEComponent
>
ades
=
co
.
getGenericApplicationPropertyOfCityObject
();
ADEComponent
adeComponent
=
ades
.
get
(
0
);
ValidationResult
valRes
=
(
ValidationResult
)
adeComponent
;
assertEquals
(
ResultType
.
ERROR
,
valRes
.
getResult
());
ValidationError
valError
=
valRes
.
getErrors
().
get
(
0
);
IntersectingRings
error2
=
(
IntersectingRings
)
valError
;
assertEquals
(
error
.
getPolygonId
(),
error2
.
getPolygonId
());
assertEquals
(
error
.
getLinearRingId1
(),
error2
.
getLinearRingId1
());
assertEquals
(
error
.
getLinearRingId2
(),
error2
.
getLinearRingId2
());
}
@Test
void
testWritingInteriorDisconnectedError
()
throws
ADEException
,
CityGMLBuilderException
,
CityGMLWriteException
,
CityGMLReadException
{
CityModel
model
=
new
CityModel
();
Building
b
=
new
Building
();
model
.
getCityObjectMember
().
add
(
new
CityObjectMember
(
b
));
ValidationResult
result
=
new
ValidationResult
();
result
.
setResult
(
ResultType
.
ERROR
);
b
.
addGenericApplicationPropertyOfCityObject
(
result
);
InteriorDisconnected
error
=
new
InteriorDisconnected
();
error
.
setPolygonId
(
"TestPolygon"
);
result
.
getErrors
().
add
(
error
);
byte
[]
gml
=
writeCityGml
(
model
);
model
=
readCityGml
(
gml
);
AbstractCityObject
co
=
model
.
getCityObjectMember
().
get
(
0
).
getCityObject
();
List
<
ADEComponent
>
ades
=
co
.
getGenericApplicationPropertyOfCityObject
();
ADEComponent
adeComponent
=
ades
.
get
(
0
);
ValidationResult
valRes
=
(
ValidationResult
)
adeComponent
;
assertEquals
(
ResultType
.
ERROR
,
valRes
.
getResult
());
ValidationError
valError
=
valRes
.
getErrors
().
get
(
0
);
InteriorDisconnected
error2
=
(
InteriorDisconnected
)
valError
;
assertEquals
(
error
.
getPolygonId
(),
error2
.
getPolygonId
());
}
@Test
void
testWritingRingNotClosedError
()
throws
ADEException
,
CityGMLBuilderException
,
CityGMLWriteException
,
CityGMLReadException
{
CityModel
model
=
new
CityModel
();
Building
b
=
new
Building
();
model
.
getCityObjectMember
().
add
(
new
CityObjectMember
(
b
));
ValidationResult
result
=
new
ValidationResult
();
result
.
setResult
(
ResultType
.
ERROR
);
b
.
addGenericApplicationPropertyOfCityObject
(
result
);
RingNotClosed
error
=
new
RingNotClosed
();
error
.
setLinearRingId
(
"TestRing"
);
result
.
getErrors
().
add
(
error
);
byte
[]
gml
=
writeCityGml
(
model
);
model
=
readCityGml
(
gml
);
AbstractCityObject
co
=
model
.
getCityObjectMember
().
get
(
0
).
getCityObject
();
List
<
ADEComponent
>
ades
=
co
.
getGenericApplicationPropertyOfCityObject
();
ADEComponent
adeComponent
=
ades
.
get
(
0
);
ValidationResult
valRes
=
(
ValidationResult
)
adeComponent
;
assertEquals
(
ResultType
.
ERROR
,
valRes
.
getResult
());
ValidationError
valError
=
valRes
.
getErrors
().
get
(
0
);
RingNotClosed
error2
=
(
RingNotClosed
)
valError
;
assertEquals
(
error
.
getLinearRingId
(),
error2
.
getLinearRingId
());
}
@Test
void
testWritingTooFewPointsError
()
throws
ADEException
,
CityGMLBuilderException
,
CityGMLWriteException
,
CityGMLReadException
{
CityModel
model
=
new
CityModel
();
Building
b
=
new
Building
();
model
.
getCityObjectMember
().
add
(
new
CityObjectMember
(
b
));
ValidationResult
result
=
new
ValidationResult
();
result
.
setResult
(
ResultType
.
ERROR
);
b
.
addGenericApplicationPropertyOfCityObject
(
result
);
TooFewPoints
error
=
new
TooFewPoints
();
error
.
setLinearRingId
(
"TestRing"
);
result
.
getErrors
().
add
(
error
);
byte
[]
gml
=
writeCityGml
(
model
);
model
=
readCityGml
(
gml
);
AbstractCityObject
co
=
model
.
getCityObjectMember
().
get
(
0
).
getCityObject
();
List
<
ADEComponent
>
ades
=
co
.
getGenericApplicationPropertyOfCityObject
();
ADEComponent
adeComponent
=
ades
.
get
(
0
);
ValidationResult
valRes
=
(
ValidationResult
)
adeComponent
;
assertEquals
(
ResultType
.
ERROR
,
valRes
.
getResult
());
ValidationError
valError
=
valRes
.
getErrors
().
get
(
0
);
TooFewPoints
error2
=
(
TooFewPoints
)
valError
;
assertEquals
(
error
.
getLinearRingId
(),
error2
.
getLinearRingId
());
}
@Test
void
testWritingConsecutiveSameError
()
throws
ADEException
,
CityGMLBuilderException
,
CityGMLWriteException
,
CityGMLReadException
{
CityModel
model
=
new
CityModel
();
Building
b
=
new
Building
();
model
.
getCityObjectMember
().
add
(
new
CityObjectMember
(
b
));
ValidationResult
result
=
new
ValidationResult
();
result
.
setResult
(
ResultType
.
ERROR
);
b
.
addGenericApplicationPropertyOfCityObject
(
result
);
ConsecutivePointsSame
error
=
new
ConsecutivePointsSame
();
error
.
setLinearRingId
(
"TestRing"
);
DirectPosition
vertex1
=
new
DirectPosition
();
vertex1
.
getValue
().
add
(
10.0
);
vertex1
.
getValue
().
add
(
5.0
);
vertex1
.
getValue
().
add
(
7.0
);
error
.
setVertex1
(
vertex1
);
DirectPosition
vertex2
=
new
DirectPosition
();
vertex2
.
getValue
().
add
(
15.0
);
vertex2
.
getValue
().
add
(
55.0
);
vertex2
.
getValue
().
add
(
71.0
);
error
.
setVertex2
(
vertex2
);
result
.
getErrors
().
add
(
error
);
byte
[]
gml
=
writeCityGml
(
model
);
model
=
readCityGml
(
gml
);
AbstractCityObject
co
=
model
.
getCityObjectMember
().
get
(
0
).
getCityObject
();
List
<
ADEComponent
>
ades
=
co
.
getGenericApplicationPropertyOfCityObject
();
ADEComponent
adeComponent
=
ades
.
get
(
0
);
ValidationResult
valRes
=
(
ValidationResult
)
adeComponent
;
assertEquals
(
ResultType
.
ERROR
,
valRes
.
getResult
());
ValidationError
valError
=
valRes
.
getErrors
().
get
(
0
);
ConsecutivePointsSame
error2
=
(
ConsecutivePointsSame
)
valError
;
assertEquals
(
error
.
getLinearRingId
(),
error2
.
getLinearRingId
());
assertEquals
(
error
.
getVertex1
().
getValue
().
get
(
0
),
error2
.
getVertex1
().
getValue
().
get
(
0
));
assertEquals
(
error
.
getVertex2
().
getValue
().
get
(
0
),
error2
.
getVertex2
().
getValue
().
get
(
0
));
}
@Test
void
testWritingRingSelfIntersection
()
throws
ADEException
,
CityGMLBuilderException
,
CityGMLWriteException
,
CityGMLReadException
{
CityModel
model
=
new
CityModel
();
Building
b
=
new
Building
();
model
.
getCityObjectMember
().
add
(
new
CityObjectMember
(
b
));
ValidationResult
result
=
new
ValidationResult
();
result
.
setResult
(
ResultType
.
ERROR
);
b
.
addGenericApplicationPropertyOfCityObject
(
result
);
RingSelfIntersection
error
=
new
RingSelfIntersection
();
error
.
setType
(
RingSelfIntType
.
DUPLICATE_POINT
);
error
.
setLinearRingId
(
"TestRing"
);
DirectPosition
vertex1
=
new
DirectPosition
();
vertex1
.
getValue
().
add
(
10.0
);
vertex1
.
getValue
().
add
(
5.0
);
vertex1
.
getValue
().
add
(
7.0
);
error
.
setVertex1
(
vertex1
);
DirectPosition
vertex2
=
new
DirectPosition
();
vertex2
.
getValue
().
add
(
15.0
);
vertex2
.
getValue
().
add
(
55.0
);
vertex2
.
getValue
().
add
(
71.0
);
error
.
setVertex2
(
vertex2
);
result
.
getErrors
().
add
(
error
);
byte
[]
gml
=
writeCityGml
(
model
);
model
=
readCityGml
(
gml
);
AbstractCityObject
co
=
model
.
getCityObjectMember
().
get
(
0
).
getCityObject
();
List
<
ADEComponent
>
ades
=
co
.
getGenericApplicationPropertyOfCityObject
();
ADEComponent
adeComponent
=
ades
.
get
(
0
);
ValidationResult
valRes
=
(
ValidationResult
)
adeComponent
;
assertEquals
(
ResultType
.
ERROR
,
valRes
.
getResult
());
ValidationError
valError
=
valRes
.
getErrors
().
get
(
0
);
RingSelfIntersection
error2
=
(
RingSelfIntersection
)
valError
;
assertEquals
(
error
.
getLinearRingId
(),
error2
.
getLinearRingId
());
assertEquals
(
error
.
getVertex1
().
getValue
().
get
(
0
),
error2
.
getVertex1
().
getValue
().
get
(
0
));
assertEquals
(
error
.
getVertex2
().
getValue
().
get
(
0
),
error2
.
getVertex2
().
getValue
().
get
(
0
));
}
@Test
void
testWritingValidationPlan
()
throws
ADEException
,
CityGMLBuilderException
,
CityGMLWriteException
,
CityGMLReadException
{
CityModel
model
=
new
CityModel
();
Validation
val
=
new
Validation
();
model
.
addGenericApplicationPropertyOfCityModel
(
val
);
ZonedDateTime
expectedDate
=
LocalDateTime
.
of
(
2002
,
5
,
30
,
9
,
0
).
atZone
(
ZoneId
.
systemDefault
());
val
.
setValidationDate
(
expectedDate
);
val
.
setValidationSoftware
(
"CityDoctor2"
);
ValidationPlan
plan
=
new
ValidationPlan
();
val
.
setValidationPlan
(
plan
);
Parameter
roundingParameter
=
new
Parameter
();
roundingParameter
.
setName
(
"numberOfRoundingPlaces"
);
roundingParameter
.
setValue
(
"8"
);
plan
.
getGlobalParameters
().
add
(
roundingParameter
);
Parameter
minVertexDistance
=
new
Parameter
();
minVertexDistance
.
setName
(
"minVertexDistance"
);
minVertexDistance
.
setValue
(
"0.0001"
);
minVertexDistance
.
setUom
(
"m"
);
plan
.
getGlobalParameters
().
add
(
minVertexDistance
);
Requirement
rTooFewPoints
=
new
Requirement
();
rTooFewPoints
.
setEnabled
(
true
);
rTooFewPoints
.
setName
(
RequirementId
.
R_GE_R_TOO_FEW_POINTS
);
plan
.
getRequirements
().
add
(
rTooFewPoints
);
Checking
buildingChecking
=
new
Checking
();
buildingChecking
.
setValue
(
TopLevelFeatureType
.
BUILDING
);
plan
.
getFilter
().
add
(
buildingChecking
);
Statistics
statistics
=
new
Statistics
();
val
.
setStatistics
(
statistics
);
FeatureStatistics
numErrorBridgeObjects
=
new
FeatureStatistics
();
numErrorBridgeObjects
.
setNumChecked
(
0
);
numErrorBridgeObjects
.
setNumErrors
(
0
);
statistics
.
setNumErrorBridgeObjects
(
numErrorBridgeObjects
);
FeatureStatistics
numErrorBuildings
=
new
FeatureStatistics
();
numErrorBuildings
.
setNumChecked
(
1
);
numErrorBuildings
.
setNumErrors
(
1
);
statistics
.
setNumErrorBuildings
(
numErrorBuildings
);
FeatureStatistics
numErrors
=
new
FeatureStatistics
();
statistics
.
setNumErrorLandObjects
(
numErrors
);
statistics
.
setNumErrorTransportation
(
numErrors
);
statistics
.
setNumErrorVegetation
(
numErrors
);
statistics
.
setNumErrorWaterObjects
(
numErrors
);
ErrorStatistics
stats1
=
new
ErrorStatistics
();
stats1
.
setAmount
(
1
);
stats1
.
setName
(
ErrorId
.
GE_R_CONSECUTIVE_POINTS_SAME
);
statistics
.
getErrorStatistics
().
add
(
stats1
);
byte
[]
gml
=
writeCityGml
(
model
);
model
=
readCityGml
(
gml
);
testValidationPlan
(
model
);
}
private
CityModel
readCityGml
(
InputStream
input
)
throws
ADEException
,
CityGMLBuilderException
,
CityGMLReadException
{
CityGMLContext
context
=
CityGMLContext
.
getInstance
();
List
<
ADEContext
>
adeContexts
=
context
.
getADEContexts
();
if
(
adeContexts
.
isEmpty
())
{
for
(
ADEContext
adeContext
:
ServiceLoader
.
load
(
ADEContext
.
class
))
{
context
.
registerADEContext
(
adeContext
);
}
}
CityGMLBuilder
builder
=
context
.
createCityGMLBuilder
();
CityGMLInputFactory
in
=
builder
.
createCityGMLInputFactory
();
in
.
setProperty
(
CityGMLInputFactory
.
USE_VALIDATION
,
true
);
in
.
setProperty
(
CityGMLInputFactory
.
FEATURE_READ_MODE
,
FeatureReadMode
.
NO_SPLIT
);
in
.
setValidationEventHandler
(
event
->
{
System
.
out
.
print
(
"["
+
event
.
getLocator
().
getLineNumber
()
+
","
+
event
.
getLocator
().
getColumnNumber
()
+
"] "
);
System
.
out
.
println
(
event
.
getMessage
());
throw
new
IllegalStateException
(
event
.
getLinkedException
());
});
CityModel
cityModel
;
try
(
CityGMLReader
reader
=
in
.
createCityGMLReader
(
"?"
,
input
))
{
cityModel
=
(
CityModel
)
reader
.
nextFeature
();
}
return
cityModel
;
}
private
CityModel
readCityGml
(
File
f
)
throws
FileNotFoundException
,
ADEException
,
CityGMLBuilderException
,
CityGMLReadException
{
return
readCityGml
(
new
FileInputStream
(
f
));
}
private
CityModel
readCityGml
(
String
fileName
)
throws
FileNotFoundException
,
ADEException
,
CityGMLBuilderException
,
CityGMLReadException
{
return
readCityGml
(
new
File
(
fileName
));
}
private
CityModel
readCityGml
(
byte
[]
bytes
)
throws
ADEException
,
CityGMLBuilderException
,
CityGMLReadException
{
return
readCityGml
(
new
ByteArrayInputStream
(
bytes
));
}
private
void
testValidationPlan
(
CityModel
cityModel
)
{
assertFalse
(
cityModel
.
getGenericApplicationPropertyOfCityModel
().
isEmpty
());
List
<
ADEComponent
>
ades
=
cityModel
.
getGenericApplicationPropertyOfCityModel
();
ADEComponent
adeComponent
=
ades
.
get
(
0
);
assertTrue
(
adeComponent
instanceof
Validation
);
Validation
val
=
(
Validation
)
adeComponent
;
ZonedDateTime
expectedDate
=
LocalDateTime
.
of
(
2002
,
5
,
30
,
9
,
0
).
atZone
(
ZoneId
.
systemDefault
());
assertTrue
(
expectedDate
.
isEqual
(
val
.
getValidationDate
()));
assertEquals
(
"CityDoctor2"
,
val
.
getValidationSoftware
());
assertNotNull
(
val
.
getValidationPlan
());
ValidationPlan
plan
=
val
.
getValidationPlan
();
assertNotNull
(
plan
.
getGlobalParameters
());
assertFalse
(
plan
.
getGlobalParameters
().
isEmpty
());
List
<
Parameter
>
globalParameters
=
plan
.
getGlobalParameters
();
Parameter
roundingParameter
=
globalParameters
.
get
(
0
);
assertEquals
(
"numberOfRoundingPlaces"
,
roundingParameter
.
getName
());
assertEquals
(
"8"
,
roundingParameter
.
getValue
());
assertNull
(
roundingParameter
.
getUom
());
Parameter
minVertexDistance
=
globalParameters
.
get
(
1
);
assertEquals
(
"minVertexDistance"
,
minVertexDistance
.
getName
());
assertEquals
(
"0.0001"
,
minVertexDistance
.
getValue
());
assertEquals
(
"m"
,
minVertexDistance
.
getUom
());
assertNotNull
(
plan
.
getRequirements
());
assertFalse
(
plan
.
getRequirements
().
isEmpty
());
List
<
Requirement
>
requirements
=
plan
.
getRequirements
();
Requirement
rTooFewPoints
=
requirements
.
get
(
0
);
assertEquals
(
RequirementId
.
R_GE_R_TOO_FEW_POINTS
,
rTooFewPoints
.
getName
());
assertTrue
(
rTooFewPoints
.
isEnabled
());
assertNotNull
(
plan
.
getFilter
());
assertFalse
(
plan
.
getFilter
().
isEmpty
());
List
<
Checking
>
filter
=
plan
.
getFilter
();
Checking
buildingChecking
=
filter
.
get
(
0
);
assertEquals
(
TopLevelFeatureType
.
BUILDING
,
buildingChecking
.
getValue
());
Statistics
statistics
=
val
.
getStatistics
();
assertNotNull
(
statistics
);
FeatureStatistics
numErrorBridgeObjects
=
statistics
.
getNumErrorBridgeObjects
();
assertNotNull
(
numErrorBridgeObjects
);
assertEquals
(
0
,
numErrorBridgeObjects
.
getNumChecked
());
assertEquals
(
0
,
numErrorBridgeObjects
.
getNumErrors
());
FeatureStatistics
numErrorBuildings
=
statistics
.
getNumErrorBuildings
();
assertEquals
(
1
,
numErrorBuildings
.
getNumChecked
());
assertEquals
(
1
,
numErrorBuildings
.
getNumErrors
());
List
<
ErrorStatistics
>
errorStatistics
=
statistics
.
getErrorStatistics
();
assertNotNull
(
errorStatistics
);
assertFalse
(
errorStatistics
.
isEmpty
());
ErrorStatistics
stats1
=
errorStatistics
.
get
(
0
);
assertEquals
(
ErrorId
.
GE_R_CONSECUTIVE_POINTS_SAME
,
stats1
.
getName
());
assertEquals
(
1
,
stats1
.
getAmount
());
}
private
byte
[]
writeCityGml
(
CityModel
model
)
throws
ADEException
,
CityGMLBuilderException
,
CityGMLWriteException
{
CityGMLContext
context
=
CityGMLContext
.
getInstance
();
List
<
ADEContext
>
adeContexts
=
context
.
getADEContexts
();
if
(
adeContexts
==
null
||
adeContexts
.
isEmpty
())
{
for
(
ADEContext
adeContext
:
ServiceLoader
.
load
(
ADEContext
.
class
))
{
context
.
registerADEContext
(
adeContext
);
}
}
CityGMLBuilder
builder
=
context
.
createCityGMLBuilder
();
CityGMLOutputFactory
outputFactory
=
builder
.
createCityGMLOutputFactory
(
CityGMLVersion
.
DEFAULT
);
ByteArrayOutputStream
out
=
new
ByteArrayOutputStream
();
try
(
CityGMLWriter
writer
=
outputFactory
.
createCityGMLWriter
(
out
))
{
writer
.
setIndentString
(
" "
);
writer
.
setPrefixes
(
CityGMLVersion
.
DEFAULT
);
writer
.
setPrefix
(
"qual"
,
QualityADEModule
.
NAMESPACE_URI
);
writer
.
setSchemaLocation
(
QualityADEModule
.
NAMESPACE_URI
,
QualityADEModule
.
NAMESPACE_URI
+
"/qualityAde.xsd"
);
writer
.
setSchemaLocations
(
CityGMLVersion
.
DEFAULT
);
writer
.
write
(
model
);
return
out
.
toByteArray
();
}
}
}
Prev
1
…
7
8
9
10
11
Next
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment