Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in
  • 3 3D-Stadtmodelle
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Jobs
  • Commits
Collapse sidebar
  • Volker Coors
  • 3D-Stadtmodelle
  • Wiki
  • En
  • Citygml tutorial
  • Extras

Extras · Changes

Page history
Update Extras authored Dec 14, 2022 by Rushikesh Padsala's avatar Rushikesh Padsala
Hide whitespace changes
Inline Side-by-side
EN/CityGML-Tutorial/Extras.md
View page @ 494b8d66
# Adding an attribute to the CityGML dataset (with attribute-join)
This example shows how to add an attribute (here: year_of_construction) to an existing CityGML document using FME. The same method can be used for adding attribute(s) by attribute join to any CityGML CityObjects irrespective of its Level of Detail. For example purpose here, CityGML building dataset is used.
This example shows how to add an attribute (here: year_of_construction) to an existing CityGML document using FME. The same method can be used for adding attribute(s) by attribute join to any CityGML CityObjects irrespective of its Level of Detail. For example purpose here, CityGML 2.0 building dataset is used.
Method 1: Using feature merger and attribute creator
......@@ -14,4 +14,48 @@ In this method, instead of adding another reader database joiner, transformer is
An example workbench is available [here](https://transfer.hft-stuttgart.de/gitlab/coors/3d-stadtmodelle/-/blob/master/FME_Workbenches/citygml_yoc_method2.zip).
The difference between using database joiner and CSV as a reader, is that CSV reader with cache all the data from the CSV file on your local machine. This is not good if you are working with a large dataset. With a database joiner, the transformer will read your database on the run and hence will not cache any data on your local machine. This saves time, memory and disk space.
\ No newline at end of file
The difference between using database joiner and CSV as a reader, is that CSV reader with cache all the data from the CSV file on your local machine. This is not good if you are working with a large dataset. With a database joiner, the transformer will read your database on the run and hence will not cache any data on your local machine. This saves time, memory and disk space.
# Adding an address to the CityGML dataset
Addresses are specified in CityGML according to the xAL address standard (OASIS 2003)[^1]. This is a general schema for all types of international addresses. Each building (Building) or building part (BuildingPart) can have one or more addresses.
[^1]: eXtensible Address Language, Namespace – urn:oasis:names:tc:ciq:xsdschema:xAl:2.0
![CityGML_2.0_Address_UML.drawio](uploads/2411bf5abb38e62d0eec5a0d65acae9d/CityGML_2.0_Address_UML.drawio.png)
In the following, the mapping of addresses is integrated into the previous FME process for [generating LoD1 building models from shapefile](https://transfer.hft-stuttgart.de/gitlab/coors/3d-stadtmodelle/-/wikis/EN/CityGML-Tutorial/chapter%202:%20Building/LOD1). Method of "Feature merger and attribute creator" is used to integrate attributes in the CityGML model. An address is given for each building in a spreadsheet. The address is described with the attributes street, house number, postcode and town. Transformer XML templater can be used in FME to map these attributes into the xAL scheme for addresses.
![image](uploads/ffea49d4c9abfae7e56410c7507364dc/image.png)
The template for the addresses looks like this:
```
<core:xalAddress xmlns:core="http://www.opengis.net/citygml/2.0">
<xAL:AddressDetails xmlns:xAL="urn:oasis:names:tc:ciq:xsdschema:xAL:2.0">
<xAL:Locality Type="Town">
<xAL:LocalityName>{fme:get-attribute("Ort")}</xAL:LocalityName>
<xAL:Thoroughfare Type="Street">
<xAL:ThoroughfareNumber>{fme:get-attribute("Hausnummer")}</xAL:ThoroughfareNumber>
<xAL:ThoroughfareName>{fme:get-attribute("Strasse")}</xAL:ThoroughfareName>
</xAL:Thoroughfare>
<xAL:PostalCode>
<xAL:PostalCodeNumber>{fme:get-attribute("PLZ")}</xAL:PostalCodeNumber>
</xAL:PostalCode>
</xAL:Locality>
</xAL:AddressDetails>
</core:xalAddress>
```
In order to connect the address to the CityGML Building , a citygml_feature_role attribute must be created analogous to the citygml_lod_name . An AttributeCreator transformer is used again for this. The attribute citygml_feature_role must be "address".
![Kap-2-1-Workbench_AttributeCreator-2](uploads/b97ccc4dfba2d8ce5d8f20f11b0a3a8d/Kap-2-1-Workbench_AttributeCreator-2.png)
The address must then be assigned to the *building*. To do this, a new **CityGML Writer** must be created. It is best to delete the existing **writer first** [^2]. *Select the Building* and *Address* feature types for the new **writer** . The address is linked to the *citygml_parent_id* in the **writer via the** *ID*.
![image](uploads/a8b231928ac177b6b7501f5d6729fc9f/image.png)
The resulting CityGML document now has the following structure:
![image](uploads/b9262fce359008a85f0ba90b63aa2fe3/image.png)
[^2]: And also the output file if it already exists. Otherwise, the writer only takes feature types that occur in this CityGML document.
Clone repository
  • DE
    • Buch 3D Stadtmodelle
    • Buch 3D Stadtmodelle
      • Kap 4: Objektmodell
      • Kap 5: Digitales Geländemodell
      • Kap 6: Die Bodenbedeckung
      • Kap 7: Gebäudemodell
      • Kap 8: Vegetation
    • Konferenzen
    • Open Data
    • Vorlesung 3D Stadtmodelle
    • Vorlesung 3D Stadtmodelle
      • Kap 2.1 Teil 1 Gebäudemodell Lod 1
      • Kap 2.1 Teil 2 Gebäudemodell Lod 1 mit Attributen
      • Kap 2.2 Gebäudemodell LoD 2
      • Kap 3 ArcGIS CityEngine
      • weiteres
  • EN
    • CityGML Tutorial
View All Pages

Dies ist die Gitlab-Instanz des Transferportals der Hochschule für Technik Stuttgart. Hier geht es zurück zum Portal