Skip to main content

Dear FME Community,

 

is there a way to extract a center point of a building in CityGML? So far I have only done it with the centerpoints of ground sufaces. But what if a complex building has multiple ground surfaces? Is there a way to treat the geometry of a building as one group? So instead of extracting the center point of one surface, extract it from the whole volume of a building. Do CityGML buildings have an individual id?

 

I have attached a sample CityGML file.

 

Thank you so much for your help!

With kind regards

 

Christian

CityGML has a complex structure for sure and is annoyingly flexible which means a building can have no geometryand still be valid.... And indeed getting the Centerpoint which seems trivial can be quite complex.

The best option I think here is to aggregate the buildings using the hierarchy option. The Aggregator transformer lets you choose ids and parent ids on which to structure a geometry hierarchy. Here you can use gml_id and parent_gml_id.

If you ignore the CityModel feature type and feed in everything to the aggregator you should get out one aggregate for each building.

This method is nice because you don't need to worry about missing or multiple ground surfaces or LOD's etc.​

After this you can pretty easily ​extract the bounds and create a 3D bounding volume or calculate the center point based on bounds.


Reply