I have been trying to generate a building model based on citygml4j at different levels of details. I could generate simple models up to LoD2. I want to add some more details like doors and windows and interior geometries to the models. Are there any sample java codes for creating a building at higher LODs?
Thanks a lot for your help in advance!
The citygml4j object model closely follows the XML encoding of CityGML. So the CityGML XML schemas and the CityGML specification document are of help.
Check out the following CityGML snippet of a building having a wall surface and a door. To keep it simple, I have omitted any spatial or thematic properties.
Note that the
Door
feature is connected to theWallSurface
through theopening
feature property. Likewise, theBuilding
feature has aboundedBy
feature property that contains theWallSurface
.Now, simply build the same hierarchy with citygml4j objects.
Finally, add some geometry and attributes. For instance, add a
gml:MultiSurface
as LoD 3 representation of theWallSurface
.Again, how to construct the GML geometry objects closely follows the XML schema. citygml4j is shipped with a lot of sample code. Check out the
BuildingCreator.java
sample that illustrates how geometries can be created. But you can also populate the geometry objects in different ways.Hope this helps.