Skip to content

nieswand/Import_CityGML

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 

Repository files navigation

Import CityGML

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).

Basic Functionality

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.

Installation

  1. Download repository as zip (through GitHub this can be done through the Clone or download > Download ZIP green button).

  2. Run Blender and go to Edit > Preferences > Add-ons and press the Install... button.

  3. Select the downloaded ZIP and press Install Add-on from File....

  4. 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!)

Features:

Menu

Import menu item (import CityGML .gml)

As One

Imports all geometry as one object

Multi-file

Single or multiply file import (multiple files = multiple objecs)

Names

Imported file name = object & mesh name

Options

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:

  1. 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

  1. Import Scale

We can scale all imported geometry to be closer to World Origin.

  1. 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

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

Testing Datasets

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).

Limitations

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.

About

Import cityGML file(s) into Blender

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%