| ... | ... | @@ -24,7 +24,7 @@ The output CityGML file will contain the schematic attribute for year of constru |
|
|
|
|
|
|
|
**Method 2: Using database joiner and attribute manager**
|
|
|
|
|
|
|
|
In this method, instead of adding another reader database joiner, transformer is used to connect datasets based on gml_id or any primary key. Here you connect the port from "CityGML Building" to the input port of database joiner transformer. Inside the transformer you select your database (here: CSV), select the CSV table and then map your gml_id from the CityGML file to gml_id from the CSV file. Under "Fields to Add", the field containing year of construction values is selected (here: construction ). Also make sure to set cardinality to either 1:1 or 1:0..1. This will prevent unmatched gml_id from giving you an error and terminating the workbench. Next connect the joined port of database joiner to attribute manager input port. Inside attribute manager, in front of the "citygml_year_of_construction" assign value "construction ". Join the output port to the writer port of "CityGML Building" and run the workbench.
|
|
|
|
In this method, instead of adding another reader database joiner, transformer is used to connect datasets based on gml_id or any primary key. Here you connect the port from "CityGML Building" to the input port of database joiner transformer. Inside the transformer you select your database (here: CSV), select the CSV table and then map your gml_id from the CityGML file to gml_id from the CSV file. Under "Fields to Add", the field containing year of construction values is selected (here: construction ). Also, make sure to set cardinality to 1:0..1. This will prevent unmatched gml_id from giving you an error and terminating the workbench. Next connect the joined port of database joiner to attribute manager input port. Inside attribute manager, in front of the "citygml_year_of_construction" assign value "construction ". Join the output port to the writer port of "CityGML Building" and run the workbench.
|
|
|
|
|
|
|
|
An example workbench is available [here](https://transfer.hft-stuttgart.de/gitlab/coors/3d-stadtmodelle/-/blob/master/FME_Workbenches/citygml_yoc_method2.zip).
|
|
|
|
|
| ... | ... | @@ -48,7 +48,7 @@ The output CityGML file will contain the schematic attribute for year of constru |
|
|
|
|
|
|
|
In this example, we will add a generic attribute (here: specific space heating demand) to an existing CityGML document using FME. The same method can be used for adding any generic attribute(s) by attribute join to any CityGML CityObjects irrespective of its Level Of Detail. For example purpose here, CityGML 2.0 building dataset for HFT campus in LOD2 is used. For adding generic attribute of Specific space heating demand to HFT CityGML file, SimStadt simulated heating energy demand result is used. Database joiner method is used in this example as explained above.
|
|
|
|
|
|
|
|
First, we connect the port from "CityGML Building" to the input port of database joiner transformer. Inside the transformer you select your database (here: CSV), select the CSV table and then map your gml_id from the CityGML file to GMLId from the CSV file. Under "Fields to Add", the field containing specific space heating demand values is selected (here: Specific space heating demand ). Also make sure to set cardinality to either 1:1 or 1:0..1. This will prevent unmatched gml_id from giving you an error and terminating the workbench. Next we will join the output port to the writer port of "CityGML Building". At this point, the new attribute of Specific space heating demand must be added to the attribute list of CityGML building. To access the existing attribute list of CityGML building, click on wheel icon . Next, select the User Attributes tab and manually add the new attribute Specific space heating demand with xml_real64 type. Now save and run the workbench.
|
|
|
|
First, we connect the port from "CityGML Building" to the input port of database joiner transformer. Inside the transformer you select your database (here: CSV), select the CSV table and then map your gml_id from the CityGML file to GMLId from the CSV file. Under "Fields to Add", the field containing specific space heating demand values is selected (here: Specific space heating demand ). Also make sure to set cardinality to 1:0..1. This will prevent unmatched gml_id from giving you an error and terminating the workbench. Next we will join the output port to the writer port of "CityGML Building". At this point, the new attribute of Specific space heating demand must be added to the attribute list of CityGML building. To access the existing attribute list of CityGML building, click on wheel icon . Next, select the User Attributes tab and manually add the new attribute Specific space heating demand with xml_real64 type. Now save and run the workbench.
|
|
|
|
|
|
|
|
>An easier way to define new generic attributes would be to switch "Attribute Definition" from Manual to Automatic. This will reduce time to manually add all the new generic attributes to the CityGML attribute list but for all the newly added generic attributes FME will define their type based on their data type defined in the input database (e.g. excel, CSV, Postgres etc.). To manually change a data type, switch back to Manuall attribute definition.
|
|
|
|
|
| ... | ... | |