Converting 3DWarehouse models into CityGML

I figured out two different approaches, to get 3DWarehouse SKP/KML/COLLADA models into CityGML, which I want to share with you (this is all very trivial, but If you don't know it, it can cost quiet some time to find the right tools for doing this).

The first way is to use the CityGML PlugIn for Sketchup from www.citygml.de.
(See this previous Blog for installing Sketchup on Ubuntu.)
With this Sketchup PlugIn you can export CityGML directly from the 3DWarehouse SKP models (for the second method we will need the Collada model).

Just download the PlugIn form here, and unzip it. Copy the unzipped files and folder into your sketchup installation directory. Restart Sketchup. The Plug-In is now installed. For more detailed instructions on installing the Plug-In refere to the user manual (for now in german only).

CityGML Export PlugIn for Sketchup

This was very easy! The downside of this approach is, that the CityGML model you get seems not to be 100% valid. For example one can't import it into LandXplorer or the deegree view3DFile tool. LandXplorer don't gives an error message at all. deegree states, that some XML-Nodes are not closed properly... even If you close them manually, deegree will complain about some elements which are not known by the XML-schema deegree uses for validating the CityGML.

The second approach is a bit more complicated, but you will get a valid CityGML document for using with deegree.

For this approach, we download the COLLADA model from 3DWarehouse.
Open the file with Blender.

Collada Model import into Blender

And export the model directly into the VRML97 format.

Export the model into VRML97 format
 

The VRML97 File can be imported into the deegree view3DFile Tool.

Open the VRML file and click on "Export File". You will get a Dialog, where you have to provide some paramaters you have to know:
1. Origin of the model in a globaly referenced coordinate system.
2. the EPSG code of the coordiante system.

For example you can get the coordinates from Google Earth, by identifying the object (In this case youor EPSG code would be 4326 for WGS84 gegraphic coordiantes from Google Earth).

See the following screenshot for an example paramter set for the dialog.

deegree View3DFile tool

Because the 3DWarehouse models are in metric units, you better use a metric coordinate system, e.g. UTM or as I did the german Gauss-Krüger system.

Thats it!

Happy CityGML'ing! :-)

Christian