Skip to content

BorhanHamedani/Import_CityGML

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 

Repository files navigation

Import CityGML

This is a Blender addon 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 addon for Blender 2.7, in 2020 was updated for 2.8 and 2.9.

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 (buiilding, road, tunel) 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.

Basic Functionality

Addon imports geometry from CityGML file (or files) as one mesh/object (per file).

basic means basic :)

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 plugin 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 again the plugin to reload it!)

Features:

Menu

import menu item (import cityGML .xml)

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 Clips

When we work on big objects we need to change view clips. Than options can recalulate that clips based on objects size.

Other

other features:

  • imports into current collection
  • imports <gml:posList> and lists of <gml:pos> tags
  • imports ground triangles (if any)
  • exeption handling if xml file has no geometry & console progress info

Testing Datasets

Addon 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

Addon 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%