Exercise 04: Working with CityGML and XML¶
The goals of this exercise are to deepen your understanding of the CityGML data format and how complex urban information is structured and encoded in XML-documents. You will explore how semantic and geometric data are represented, and how different components—such as buildings, vegetation, and terrain—are organized according to the CityGML standard. In this exercise, you will inspect and interpret a CityGML instance document directly, helping you connect the theoretical UML model to its real-world data representation. To reinforce your understanding, you will also use CityDoctor, a validation tool developed by the HFT Stuttgart, to check the CityGML document for geometric and semantic errors. This step introduces you to the importance of data validation when working with 3D city models, especially for ensuring compatibility with processing tools and simulations.
Once you are done with this exercise, you would have learnt these key points.
Understand XML Structure and Syntax.
Working with CityGML files in a text editor.
Understanding the XML structure of CityGML documents.
Validating CityGML datasets with CityDoctor.
Exercise Tasks¶
Before you start please check the data provided to you and the data you need to find and download by yourself.
An LoD3 CityGML Building model representing the main entrance bUilding of the TUM City Campus : DEBY_LOD3_4959457.gml
A base dataset of the Quadrant in CityGML [adapted from the standardised open data downloaded from LDBV open data portal]: Combined_CityGML_dataset.gml
A compressed file containing the CityDoctor application: CityDoctor.zip
Task A - Validating CityGML Documents
Validation is a crucial step in working with CityGML data, as it ensures that 3D city models are structurally and semantically correct and conform to the CityGML standard. This process helps identify issues such as missing attributes, geometric errors, or other errors in the data, which could otherwise affect its usability in diverse applications. In this part of the exercise, you are going to perform automated checks to verify the integrity and compliance of CityGML documents using the tool CityDoctor, which has been developed by the HFT Stuttgart.
Download and install CityDoctor
First, you need to download and unzip the <XX_TUM-xx_Quadrant.gml> folder. In the unzipped folder, you will find a file called start.bat. You can start the CityDoctor application by double-clicking on this file. After a few seconds, you should see the following graphical user interface:
Load the sample CityGML dataset
Import the DEBY_LOD3_4959457.gml dataset by using the Open File functionality by providing the path to the file.
Info
In case of large files, it is advisable to use the Low Memory Consumption Mode.
You can already validate the files for XML-Validity during the import by using the Use XML Validation funcitonality.
Inspect the dataset
Once the import is completed, you can inspect the data in the CityDoctor GUI. Try inspecting the model from different perspectives in the display window. Additionally try to navigate through the file structure dispayed on the left side of the GUI.
Validate the dataset
Before conducting the validation of your CityGML document with CityDoctor, the validation must be configured. Do do so, click on the icon showing a green file with a white checkmark on it. A dialog window is going to open up. Here you can choose which validations with what parameters you would like to run.
Info
Think about what kind of checks could be useful. You can find detailed documentation concerning the different validations and their pararmeters on the CityDoctor website: https://transfer.hft-stuttgart.de/pages/citydoctor/citydoctorhomepage/de/
Documenting the validation results
Document the results of cour validation in a .pdf or .xml report by using the provided export function next to the validation icon in the CityDoctor GUI. Simply specify the name an place under which you want to store your report.
Questions
Based on the validation report, try to answer the following questions:
Were any errors detected in the first validation? If so, how many instances of what kind of errors were deteced?
Please explain the types of errors identified.
What kind of applications could be affected by the identified errors?
What would you need to do to fix the identified errors?
Task B - Working with CityGML Documents in Text Editors
Use any text editor (e.g., Notepad++) to open and read through CityGML instance documents. Try to answer the following questions:
Which types of elements are located within the root element of the file?
Which namespaces are declared in the file?.
Are there any processing instructions or XML declarations at the beginning of the file?
Which tags are used most frequently in the document?
Are there any XLinks used in the document? If so, what are the used for?
Which CityGML version is used?
What LoD levels do the buildings in the document have?
What coordinate reference system CRS is used? Research this CRS and describe, what type of CRS it is.
Which object types (e.g., Building, Vegetation, TransportationObject) are present?
How many building elements are represented in the document?
Which XML attributes are specified for buildings?
What is the purpose of the <app:X3DMaterial> element? Which attributes or child elements define the visual style?
Is there an envelope in the document? What information does it provide? How is it structured?
How is a building structured in CityGML (from the root element to the geometry)?
What are the advantages of separating geometry and semantics in CityGML?
Submission¶
Please submit your answers to the questions in any kind of written document.