This is a Blender add-on to import geometry (only geometry) from 3D city models encoded in CityGML files. It was started by Dealga McArdle (zeffii) in 2015 as io_cityGML_basic add-on for Blender 2.7. In 2020, the add-on was updated for Blender 2.8 and 2.9 by ppaawweeuu. In 2023, the add-on was updated again by Simon Nieswand (nieswand).
This add-on imports geometry from CityGML file (or files) as one mesh/object (per file).
basic means basic :)
There can be much non-geometrical information in CityGML files, for example materials, textures, building part classifications (wall, roof, floor, furniture), number of floors, roof type, adresses, ocupancy and much more. Properties can be assigned to objects (building, road, tunnel) or parts (wall, roof), or geometry (solids, polygons, triangles). There is no limitation in amount of information stored in CityGML file and there was no intention to import more than geometry.
-
Download repository as zip (through GitHub this can be done through the
Clone or download
>Download ZIP
green button). -
Run
Blender
and go toEdit > Preferences > Add-ons
and press theInstall...
button. -
Select the downloaded ZIP and press
Install Add-on from File...
. -
Enable the add-on from the list, by ticking the empty box next to the add-on's name. (Optional: If this is an update, un-tick and tick the add-on to reload it!)
Import menu item (import CityGML .gml)
Imports all geometry as one object
Single or multiply file import (multiple files = multiple objecs)
Imported file name = object & mesh name
Imported object are located in (0, 0, 0) (their origin) but mesh points can be for example x=12342222, y=23343322, z=23. City models can be huge. That is the reason why there are some problems in Blender with displaying geometry. It means problems with zooming, rotating, shadows, view clipping etc.
There are 3 workarounds:
- Origin Point
We can overwrite imported geometry origin point to be closer to Blender world origin (0, 0, 0).
CityGML files are readable in Notepad (Notepad++ is much better, especially for very big text files). We can find series of coordinates between <gml:posList>
or <gml:pos>
tags.
Below example when we could set import Origin Point x=750000, y=380000, z=0
- Import Scale
We can scale all imported geometry to be closer to World Origin.
- Recalculate View Clip End
When we work on big objects we need to change the view clipping range. This option can recalulate the view clip end based on the size of the imported geometry.
Other features:
- Imports into current collection
- Imports
<gml:posList>
and lists of<gml:pos>
tags - Imports ground triangles (if any)
- Exception handling if GML file has no geometry & console progress info
Add-on was tested on files from polish geoportal.gov.pl
Here are some direct links to CityGML files for 3 cities:
Warszawa - map link / Warszawa CityGML LoD1 / Warszawa CityGML LoD2
Lublin - map link / Lublin CityGML LoD1 / Lublin CityGML LoD2
Krakrów - map link / Kraków CityGML LoD1 / Kraków CityGML LoD2
Add-on was also tested on other CityGML datasets from CityJSON.org site (for example New York).
There is general issue with polygons with holes. Polygons in CityGML can be created by two (or more) rings. In that case inner ring is interpreted as void and is substracted from outer ring. Rules_for_Validating_GML_Geometries_in_CityGML.
Blender sees two coplanar faces with connected vericles.