Question

CityGML-file with LOD1 and LOD2

  • 1 November 2017
  • 5 replies
  • 53 views

Badge

I have a buildings model as LOD2 that I have converted in FME from shapefile into CityGML-format.

I also need to add LOD1 budilings to the same CityGML-file. I have created the roofs for the LOD1-buildings and I have the footprints, both files with corresponding height.

Does anyone have any advice on how to do this the easiest way or can point me to a workspace (I have tried finding one without success). Is the easiest to generate a new set of buildings? Or can I in my workspace create the LOD1-buildings based on my LOD2-buildings and export them together? Would it be an idea to generate two differnt CityGML-files and then combine them into one model? All buildings have an unique ID associated with them. Has anyone tried this?

Thank you in advance :)


5 replies

Userlevel 2
Badge +17

Hi @carolineivarsso,

You can combine two separate LOD models into a single geometry using a combination of the Aggregator and the MultipleGeometrySetter transformers. I am attaching a workspace to illustrate the process:

createmultilodcitygml.fmw

 

This is a very simplified example, with just LOD1 and LOD2 geometries. The key is to have a single feature for each LOD per building before the final Aggregator and the MultipleGeometrySetter. If you are writing multiple Buildings, you will also need to set the Group By in the final Aggregator to a unique building ID attribute.

Badge

Dear Dave,

Thank you for your answer! Now I understand how to combine two buildings with differnt geometries in one CityGML-file.

However in my workspace I can't get the writer to write both the LOD1 and LOD2 geometries. I get all instances but it won't write the LOD1-geometries in the output CityGML-files. If I attach an inspector I can also see all geometries but something happens in the writer. Any chance that you can have a look? Thank you!

I have attached workspace and sampledata to this answer.

Userlevel 2
Badge +17

Hi @carolineivarsso,

If you are creating the separate geometry types for LOD2, you don't need to create the multi-geometry. You can just set the gml_parent_id to point to the appropriate parent.

I made a few changes to your workspace to get the CityGML writing out correctly:

  • Roof, Wall, and Ground can only be used for LOD2. For LOD1, you can only have a plain geometry. I restructured the workspace to create a geometry for each building from the LOD1 input. The LOD2 process remains as before, with the gml_parent_id establishing which building the parts belong to.
  • The CityGML geometries must be surfaces, so I added a FaceReplacer / Triangulator combination to convert the source polygons to surfaces.

I am attaching the updated workspace: m-12478-171103-citygml-ci.fmw

Badge

Hi @carolineivarsso,

If you are creating the separate geometry types for LOD2, you don't need to create the multi-geometry. You can just set the gml_parent_id to point to the appropriate parent.

I made a few changes to your workspace to get the CityGML writing out correctly:

  • Roof, Wall, and Ground can only be used for LOD2. For LOD1, you can only have a plain geometry. I restructured the workspace to create a geometry for each building from the LOD1 input. The LOD2 process remains as before, with the gml_parent_id establishing which building the parts belong to.
  • The CityGML geometries must be surfaces, so I added a FaceReplacer / Triangulator combination to convert the source polygons to surfaces.

I am attaching the updated workspace: m-12478-171103-citygml-ci.fmw

Dear Dave,

 

 

Thank you for the explanations! It helped me understand and get FME to write a multi-LOD 3D-model.

 

 

However, it seems like the FaceRepalcer / Triangular you added are mixing with the surface normals of the resulting model. The roofs and ground are ok but the walls have flipped trinagles when running it through CityDoctor Validation tool. Please see attached image.

 

 

I also think this is why I get some error messages when validating my models because the errors occur only in the borderline between roof-wall and wall-ground. The errors I get are 'CS_OUTEREDGE' and 'CS_SELFINTNATIVE'.

 

 

Userlevel 2
Badge +17
Dear Dave,

 

 

Thank you for the explanations! It helped me understand and get FME to write a multi-LOD 3D-model.

 

 

However, it seems like the FaceRepalcer / Triangular you added are mixing with the surface normals of the resulting model. The roofs and ground are ok but the walls have flipped trinagles when running it through CityDoctor Validation tool. Please see attached image.

 

 

I also think this is why I get some error messages when validating my models because the errors occur only in the borderline between roof-wall and wall-ground. The errors I get are 'CS_OUTEREDGE' and 'CS_SELFINTNATIVE'.

 

 

If you have a complete building models (ground, walls, roof), you can use a SolidBuilder transformer to build a Brep solid from the surfaces. As part of a solid, the face's normals will always point out from the building. After building the solid, you can use a GeometryCoercer to convert back to Composite Surface suitable for writing to CityGML. This will not change the face normals set by the SolidBuilder.

 

 

Reply