Question

Convert CityGML into 3D tiles and then into CAD files

  • 13 July 2021
  • 9 replies
  • 39 views

Dear FME-Community,

 

I have a question concerning FME. I would like to convert a huge CityGML

file into small tiles of e. g. obj-Files. I have seen that cesium is

able to produce 3D tiles. Is this also somehow possible with FME? The

end product should be 3D meshes for CAD software/ or something like

obj-files. Maybe there is a direct way working with FME or maybe there

is a work-around with cesium and FME...

 

 

Thank you so much for your help in advance!

 

with kind regards,

Christian Lendl


9 replies

Userlevel 4
Badge +26

You should take a look at the 3DCityDB (100% free). The tool is a core component to CityGML. You can import your CityGML into the database with the importer-exporter (part of the 3DCityDB package) and then use the export functionality to tile it up into smaller files. Once you have the tiled CityGML you can use FME to do a batch conversion into your preferred format. This will be a lot more manageable than trying to do it with just FME alone.

To use the 3DCityDB you will need postgres and Java. The setup instructions are pretty good.​

Userlevel 4
Badge +26

Also Cesium 3D tiles ​is a specific format for visualizing large datasets. It can not easily be converted into other formats. It's not designed as an interchange format like CityGML or OBJ.

Thank you very much for your help!

I installed 3DCityDB and I got stuck on creating a new DB with the CREATE_DB.bat ShellScript. First it asks me to type in the EPSG code, then there two more steps and after that I have to type in a password for the user of the database. Which password am I supposed to type in? Apparently it is not the password I created when I installed the postgresql... And in the shell my password is not being displayed (also not with dots). Is that normal?

 

I would be very glad, if you could help me here.

 

 

Thank you so much in advance!shot2

Userlevel 4
Badge +26

Thank you very much for your help!

I installed 3DCityDB and I got stuck on creating a new DB with the CREATE_DB.bat ShellScript. First it asks me to type in the EPSG code, then there two more steps and after that I have to type in a password for the user of the database. Which password am I supposed to type in? Apparently it is not the password I created when I installed the postgresql... And in the shell my password is not being displayed (also not with dots). Is that normal?

 

I would be very glad, if you could help me here.

 

 

Thank you so much in advance!shot2

The password should be the one you entered when installing postgres. The same one you used to connect to the server and create the empty database - and yeah it doesn't show up when typing it in.

Thank you very much for your answer! After trying it for several days, I finally got the 3D City db to work and I managed to export tiles from my original CityGML Data. Unfortunately, 3D City db only exports to KML data. At least this is what I saw so far. Are there any add-ons that provide an export to CAD files? Like dwg or obj? Do you happen to know how to properly import the generated KML files (with the subfolders and the json file) into FME? Is there a way in FME to convert KML/KMZ files to CAD files?

 

Thank you again so much for your support.

Userlevel 4
Badge +26

Thank you very much for your answer! After trying it for several days, I finally got the 3D City db to work and I managed to export tiles from my original CityGML Data. Unfortunately, 3D City db only exports to KML data. At least this is what I saw so far. Are there any add-ons that provide an export to CAD files? Like dwg or obj? Do you happen to know how to properly import the generated KML files (with the subfolders and the json file) into FME? Is there a way in FME to convert KML/KMZ files to CAD files?

 

Thank you again so much for your support.

Nice one!

I would export the data as CityGML and then convert that to DWG (or obj). Now that the files are split up the conversion process can be done much easier. One file in, one file out.

Here is a good example of how to process FME in batch using the WorkspaceRunner: https://community.safe.com/s/article/batch-processing-using-the-workspacerunner-1

 

You need to first create a workspace which converts one file into another. You can use this workspace as a template for your own conversion: https://hub.safe.com/publishers/vcs/templates/citygml-to-dwg

 

Once you are happy with your single file conversion you can then try it out in batch mode using the WorkspaceRunner

Thank you so much for your help! I am really thankful that you help me out here!

Now I do have one more question. When working with the 3D City DB in VIS Export mode I have the possibility to enter a specific mumber of meters (how long or wide is my tile) in the normal export mode I suddenly don't. It is really important for me to be able to enter an exact size. Is there any way?

 

Userlevel 4
Badge +26

Thank you so much for your help! I am really thankful that you help me out here!

Now I do have one more question. When working with the 3D City DB in VIS Export mode I have the possibility to enter a specific mumber of meters (how long or wide is my tile) in the normal export mode I suddenly don't. It is really important for me to be able to enter an exact size. Is there any way?

 

Oof, yes this is a short-coming at the moment for the CityGML export. Hopefully it will be included in the next version. (https://github.com/3dcitydb/importer-exporter/issues/178)

For now, what must be done is to calculate the bounding box you want (use this as the filter) and then calculate the number of columns and rows and then use that. It's a bit annoying for sure.

You can use the importer-exporter tool to calculate the bounds of the whole database.

 

Here, I've added a workspace which should do this. Just put in your tilesize, and the bounding box from calculating it in the importer-exporter and is should give you the bounding box settings you need to use for your export.

Wow thank you so much! This sounds amazing! Thank you very much for sending me your file!!! This really helps me. I am going to try it out tomorrow. As an alternative I would have exported the CityGML files as KML files just to see how many tiles there will be. But your solution seems to be much more precise!

Thanks a lot!

Reply