Validation Plan#
The validation plan defines which requirements CityDoctor checks, with which parameters, and which objects are included in the check. It is specified in YAML and passed to CityDoctor with the parameter -config (see Command Line).
In the graphical user interface the same settings are available in the check dialog. A validation plan can be saved from there and loaded again, which is the easiest way to create a valid file.
Example#
For version 3.12.x and later, an example looks like this:
globalParameters:
numberOfRoundingPlaces: 8
# in m
minVertexDistance: 0.0001
schematronPath: 'checkForSolid.xml' # (1)!
useStreaming: true # (2)!
xmlValidation: false # (3)!
filter: # (4)!
exclude:
types:
- VEGETATION
requirements:
R_GE_R_TOO_FEW_POINTS:
enabled: true
R_GE_R_NOT_CLOSED:
enabled: true
R_GE_R_CONSECUTIVE_POINTS_SAME:
enabled: true
R_GE_R_SELF_INTERSECTION:
enabled: true
R_GE_S_MULTIPLE_CONNECTED_COMPONENTS:
enabled: true
R_GE_P_INTERIOR_DISCONNECTED:
enabled: true
R_GE_P_INTERSECTING_RINGS:
enabled: true
R_GE_P_NON_PLANAR:
enabled: true
parameters:
# one of ("distance", "angle", "both")
type: distance
# in m
distanceTolerance: 0.01
# in degree
angleTolerance: 1
R_GE_P_HOLE_OUTSIDE:
enabled: true
R_GE_P_ORIENTATION_RINGS_SAME:
enabled: true
R_GE_P_INNER_RINGS_NESTED:
enabled: true
R_GE_S_TOO_FEW_POLYGONS:
enabled: true
R_GE_S_NOT_CLOSED:
enabled: true
R_GE_S_NON_MANIFOLD_EDGE:
enabled: true
R_GE_S_POLYGON_WRONG_ORIENTATION:
enabled: true
R_GE_S_ALL_POLYGONS_WRONG_ORIENTATION:
enabled: true
R_GE_S_NON_MANIFOLD_VERTEX:
enabled: true
R_GE_S_SELF_INTERSECTION:
enabled: true
R_SE_BS_IS_WALL:
enabled: false
parameters:
lowerAngle: '45'
upperAngle: '135'
R_SE_BS_IS_FLOOR:
enabled: false
R_SE_BS_GROUND_UNFRAGMENTED:
enabled: false
R_SE_BS_IS_GROUND:
enabled: false
R_SE_BS_IS_CEILING:
enabled: false
R_SE_BS_ROOF_UNFRAGMENTED:
enabled: false
R_SE_POLYGON_WITHOUT_SURFACE:
enabled: false
- Schematron file for checking attributes. A relative path is resolved against the working directory of CityDoctor. If the file does not exist, the Schematron check is skipped with a warning.
- The parameter
useStreamingis a switch to read a file piece by piece instead of reading the complete file before the check takes place. With this setting also files > 2GB can be checked without large RAM requirements. - Validates the CityGML file against the XML schema while reading.
- Optional. Restricts the check to certain objects, see Filter.
Structure#
The validation plan consists of the following top-level entries:
| Entry | Type | Default | Description |
|---|---|---|---|
globalParameters |
map | see below | Parameters used by several checks |
useStreaming |
boolean | false |
Reads and checks the file object by object. Only used by the batch version. |
xmlValidation |
boolean | false |
Validates the file against the CityGML XML schema while reading |
filter |
map | no filter | Includes or excludes objects from the check |
requirements |
map | none | Requirements to check and their parameters (see Requirements). |
Other top-level entries are not permitted and cause an error when the file is loaded. Validation plans in the format used before version 3.12 (with the entry checks and check IDs like C_GE_R_TOO_FEW_POINTS) are therefore no longer accepted.
Global parameters#
| Parameter | Default | Unit | Description |
|---|---|---|---|
numberOfRoundingPlaces |
8 |
decimal places | Number of decimal places to which coordinates are rounded when the file is read. |
minVertexDistance |
0.0001 |
m | Minimum distance between two points; points closer than this are considered identical. Used e.g. by R_GE_R_CONSECUTIVE_POINTS_SAME. |
schematronPath |
none | path | Schematron file for the semantic checks of attributes (results are reported as R_SE_ATTRIBUTES_EXISTING and R_SE_ATTRIBUTES_CORRECT). If the entry is missing or empty, no Schematron check is performed. |
Note
Unknown parameter names in globalParameters are ignored without a warning. The key for the Schematron file is schematronPath; a spelling like schematronFilePath has no effect.
Requirements#
Each requirement is listed under requirements with its ID. It has the following entries:
| Entry | Description |
|---|---|
enabled |
true checks the requirement, false skips it. |
parameters |
Optional. Parameters of the requirement. Missing parameters are filled with their default values. |
Requirements that do not appear in the validation plan are not checked. A validation plan therefore keeps its behavior when new requirements are added in later versions of CityDoctor. Unknown requirement IDs are reported with a warning in the log and ignored.
Some checks depend on other checks (e.g. the solid checks require valid polygons). Such checks are executed automatically when an enabled requirement needs them.
Geometric requirements#
The requirements are described in detail under Geometric Requirements.
| ID | Parameters (default) |
|---|---|
| R_GE_R_TOO_FEW_POINTS | — |
| R_GE_R_NOT_CLOSED | — |
| R_GE_R_CONSECUTIVE_POINTS_SAME | — (uses minVertexDistance) |
| R_GE_R_SELF_INTERSECTION | degeneratedRingTolerance (0, m) |
| R_GE_P_NON_PLANAR | type (distance), distanceTolerance (0.01, m), angleTolerance (1, degree) |
| R_GE_P_INTERIOR_DISCONNECTED | — (uses minVertexDistance) |
| R_GE_P_INTERSECTING_RINGS | — |
| R_GE_P_HOLE_OUTSIDE | — |
| R_GE_P_ORIENTATION_RINGS_SAME | — |
| R_GE_P_INNER_RINGS_NESTED | — |
| R_GE_S_TOO_FEW_POLYGONS | — |
| R_GE_S_NOT_CLOSED | — |
| R_GE_S_NON_MANIFOLD_EDGE | — |
| R_GE_S_NON_MANIFOLD_VERTEX | — |
| R_GE_S_POLYGON_WRONG_ORIENTATION | — |
| R_GE_S_ALL_POLYGONS_WRONG_ORIENTATION | — |
| R_GE_S_MULTIPLE_CONNECTED_COMPONENTS | — |
| R_GE_S_SELF_INTERSECTION | — |
For R_GE_P_NON_PLANAR the parameter type selects the test method:
distance: the distance of every point to the regression plane of the polygon must not exceeddistanceTolerance,angle: the polygon is triangulated; the normal of each triangle must not deviate by more thanangleTolerancefrom the average normal,both: both tests are carried out.
Semantic requirements#
The requirements are described under Semantic Requirements. In the graphical user interface they are disabled by default.
| ID | Parameters (default) |
|---|---|
| R_SE_BS_IS_WALL | lowerAngle (45, degree), upperAngle (135, degree) |
| R_SE_BS_IS_FLOOR | — |
| R_SE_BS_IS_CEILING | — |
| R_SE_BS_IS_GROUND | — |
| R_SE_BS_GROUND_UNFRAGMENTED | — |
| R_SE_BS_ROOF_UNFRAGMENTED | maxAngleDeviation (1, degree) |
| R_SE_POLYGON_WITHOUT_SURFACE | — |
Filter#
With the optional entry filter, objects can be included in or excluded from the check. Filters are applied to top-level features (e.g. buildings, bridges); objects that are filtered out are not checked.
filter:
include:
types:
- BUILDING
- BRIDGE
ids:
- DEBW_0010001aBcD
exclude:
ids:
- DEBW_0010001xYz
- 'UUID_.*'
| Entry | Description |
|---|---|
include.types |
Feature types to check |
include.ids |
GML IDs (regular expressions) of objects to check |
exclude.types |
Feature types not to check |
exclude.ids |
GML IDs (regular expressions) of objects not to check |
The filters are evaluated as follows:
- If
includecontains at least one entry, an object is only checked if it matches at least one of the listed types or IDs. Withoutincludeall objects are checked. - An object that matches an entry under
excludeis not checked, even if it is included underinclude.
Available feature types:
| Type | Objects |
|---|---|
BUILDING |
Buildings |
BRIDGE |
Bridges |
TUNNEL |
Tunnels |
TRANSPORTATION |
Transportation objects (roads, tracks, …) |
VEGETATION |
Vegetation objects |
WATER |
Water bodies |
LAND |
Land use and relief objects |
CITY_FURNITURE |
City furniture |
OTHER_CITY_OBJECT |
Generic city objects and other construction objects |
The entries under ids are regular expressions (Java syntax) that must match the complete GML ID of the object; upper and lower case are not distinguished. Examples:
| Pattern | Matches |
|---|---|
DEBW_0010001aBcD |
exactly this ID (also debw_0010001abcd) |
DEBW_.* |
all IDs starting with DEBW_ |
.*_part.* |
all IDs containing _part |
Note
Characters with a special meaning in regular expressions (e.g. ., (, [, +, ?) have to be escaped with \ if they are part of an ID. In YAML, patterns are best written in single quotes, e.g. 'ID\.1'.
Default configuration#
If no validation plan is given on the command line, CityDoctor uses a default configuration in which all requirements are enabled with their default parameters. Details are described under Command Line.