• This repository has been archived on 05/Sep/2022
  • Stars
    star
    204
  • Rank 192,063 (Top 4 %)
  • Language
    Python
  • License
    MIT License
  • Created about 10 years ago
  • Updated almost 6 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A basic procedural modelling engine for generating buildings and other features in CityGML

Random3Dcity

A basic procedural modelling engine for generating random (synthetic) buildings and other features in CityGML in multiple levels of detail (LOD).

Overview

Ready to use datasets

If you are interested only in the datasets, without the need to run the code, please visit my webpage to download a prepared collection of datasets.

Introduction

CityGML data (semantically structured 3D city models) in multiple LODs are not available. This project presents an effort to bridge this gap, by developing a basic procedural modelling engine which generates random CityGML buildings to test software and carry out various experiments. This experimental software prototype was developed as a part of my PhD research.

The engine is composed of two modules. The first one is procedural: it randomly generates buildings and their elements according to a set of rules and constraints. The buildings are realised through parameters which are stored in an XML form. The second part of the engine reads this data and constructs CityGML data in multiple LODs.

What Random3Dcity is not

Random3Dcity is not intended to compete with ESRI's CityEngine and similar tools, which are focused on taking real-world data and augmenting them for various purposes such as urban planning. This tool is far from that: it simply provides synthetic CityGML data in multiple levels of detail.

Please be aware that the tool cannot be used for production purposes, it's merely for research objectives addressing the lack of multi-LOD CityGML data sets.

Potential uses

The data generated by the engine has been used for a variety of applications where real-world data is not of importance:

  • Source of CityGML data not burdened by topological errors.
  • Testing multi-LOD CityGML software implementations, e.g. database solutions to compress data.
  • Multi-LOD experiments, e.g. determining the optimal LOD for a spatial analysis.
  • Developing 3D use cases, and testing the complexity of each LOD.

Conditions for use and citation

This software is free to use. You are kindly requested to credit its use by citing it in a research paper you are writing, reports, and/or other applicable materials. Please cite the following paper (PDF):

Biljecki, F., Ledoux, H., & Stoter, J. (2016). Generation of multi-LOD 3D city models in CityGML with the procedural modelling engine Random3Dcity. ISPRS Ann. Photogramm. Remote Sens. Spatial Inf. Sci., IV-4/W1, 51–59. http://doi.org/10.5194/isprs-annals-IV-4-W1-51-2016

BibTeX entry:

@article{random3dcity,
    Author = {Biljecki, Filip and Ledoux, Hugo and Stoter, Jantien},
    Doi = {10.5194/isprs-annals-IV-4-W1-51-2016},
    Journal = {ISPRS Ann. Photogramm. Remote Sens. Spatial Inf. Sci.},
    Pages = {51--59},
    Pdf = {http://www.isprs-ann-photogramm-remote-sens-spatial-inf-sci.net/IV-4-W1/51/2016/isprs-annals-IV-4-W1-51-2016.pdf},
    Title = {{Generation of multi-LOD 3D city models in CityGML with the procedural modelling engine Random3Dcity}},
    Vol = {IV-4/W1},
    Year = {2016}
}

Furthermore, I will be very happy to hear if you find this tool useful for your workflow. If you find it useful and/or have suggestions for its improvement, please let me know.

System requirements

Python packages:

If not on your system please install them, it's easy with pip.

OS and Python version

Both Python 2 and Python 3 are supported.

The software has been developed and tested on Mac OS X, and has not been tested with other configurations. Hence, it is possible that some of the functions will not work on Windows.

Features and technical details

Roof types and building parts

The engine supports five types of roofs: flat, gabled, hipped, pyramidal, and shed. Further, it supports also building parts such as garages and alcoves.

Roofs

16 Levels of detail

The engine supports generating data in 16 levels of detail. The following composite render shows an example of four LODs:

LOD-composite

The following image shows the specification of our novel LOD specification ("Delft LODs") according to which the models are generated. This specification will be published in details.

LOD-refined-specification

Geometric references

Besides the LODs, the engine generates multiple representations according to geometric references within LODs, e.g. an LOD1 with varying heights of the top surface (height at the eaves, at the half of the roof, etc.)

Geometric references

Solids

Each representation is constructed its corresponding solid.

Solids

Vegetation and streets

An experimental feature is the generation of vegetation and streets.

Other-features

Interior of buildings

A basic interior of buildings in three LODs may be generated: see the header in the attachment. This is based on another paper from my group that deals with the refinement of the level of detail concept for interior features. Besides the solids for each floor, a 2D representation per each storey, and a solid for the whole building (offset from the walls) may be generated.

Documented uses

Besides my PhD in which I did a lot of experiments and benchmarking with CityGML data, the engine has been used for testing validation and repair software, and other purposes such as error propagation. For the full showcase visit the data page.

Usage and options

Randomising the city

To generate buildings run

python randomiseCity.py -o /path/to/the/building/file.xml -n 4000

where n is the number of buildings to be generated. If you don't specify the number of buildings, by default the program will generate 1000 buildings. Please use absolute paths.

To realise these buildings as a 3D city model in CityGML in multiple levels of detail run:

python generateCityGML.py -i /path/to/the/building/file.xml -o /path/to/CityGML/directory/

Don't forget to put the / at the end of the directory. Again, please use absolute paths.

Rotation

If you want to have the buildings rotated randomly, in both commands toggle the flag -r 1.

Building parts

Building parts (garages, warehouses, alcoves) are generated with the flag -p 1.

Vegetation and street network

Vegetation and street network are generated with the flags -v 1 and -s 1, respectively.

Solids and geometric references

generateCityGML.py generates solids with the option -ov 1, and all geometric references with -gr 1.

gml:id according to UUID

It is possible to generate an UUID for each gml:Polygon with the option -id 1.

Coordinate system

By default, buildings are placed in a local coordinate system. If you run the building randomiser with the option -c 1, the buildings will be placed in the Dutch coordinate system (RD new), somewhere in the Nordoostpolder in the Netherlands. You can easily customise this in the code. You don't have to toggle -c 1 in the second script (generateCityGML.py).

Reporting of the progress

When running generateCityGML.py it is possible to get the report of the progress of the script with -rp 1. This option is turned on by default. However, there have been reports of bugs when using Python3, so the option disables itself automatically if the underlying dependency cannot be loaded. Should you run into problems, disable it with -rp 0.

Performance

The speed mainly depends on the invoked options. With all the options the engine generates around 100 buildings per minute. The computational complexity is not strictly linear, and a high number of buildings (>20000) will likely eat all of your RAM making the process slower. If you need to generate more than tens of thousands of buildings, consider not generating all LODs and representations (e.g. solids).

Known issues and limitations

CityGML issues

  • The output files are stored in CityGML 2.0. Output in the legacy versions 0.4 and 1.0 is not available.

Running issues

The generateCityGML.py program has been known to crash in two cases:

  • It runs out of memory if too many buildings are attempted to be generated in CityGML. Reduce the number of buildings and/or their variants (e.g. disable the generation of solids).
  • Rarely it crashes when it encounters a very peculiar building to be generated (despite the established rules and constraints), some weird-looking buildings can still occur). This does not happen often, and when it does just generate a new set of buildings with randomiseCity.py.

General limitations

  • While this software prototype generates virtually unlimited CityGML data for free from scratch and in multiple LODs, which can be used for a multitude of purposes, this is not a commercial procedural modelling engine that can be considered as a complete standalone solution in many production workflows.

Special datasets

I have prepared a number of intentionally impaired datasets suited for different types of experiments, such as overlapping buildings and simulated geometric errors. For the full list visit the data page.

Intentional errors

Contact for questions and feedback

Feel free to contact me should you have questions:

Filip Biljecki

3D geoinformation research group

Delft University of Technology

email: fbiljecki at gmail dot com

Personal webpage

Acknowledgments

  • This research is supported by the Dutch Technology Foundation STW, which is part of the Netherlands Organisation for Scientific Research (NWO), and which is partly funded by theΒ Ministry of Economic Affairs (project code: 11300).

  • People who gave suggestions and reported errors, especially MickaΓ«l Brasebin (IGN France) for the suggestions to make the code compatible with Python3.

More Repositories

1

3dfier

The open-source tool for creating 3D models
C++
514
star
2

AdTree

Accurate, detailed, and automatic modelling of laser-scanned trees
C++
178
star
3

City3D

Large-scale LoD2 Building Reconstruction from Airborne LiDAR Point Clouds
C++
126
star
4

prepair

Automatic repair of single polygons (according to the OGC Simple Features / ISO19107 rules) using a constrained triangulation.
C++
114
star
5

terrainbook

"Computational modelling of terrains" book: source code + PDF
TeX
106
star
6

masbcpp

C++ implementation of the Medial Axis Shrinking Ball algorithm
C++
103
star
7

CityGML2OBJs

An experimental utility to convert CityGML data to OBJ, featuring decoupling of objects and conversion of attributes to colours
Python
93
star
8

val3dity

Validation of 3D primitives according to the international standard ISO19107
C++
92
star
9

azul

3D city model viewer for Mac
C++
89
star
10

City4CFD

Reconstruction of LoD2 3D city models for urban flow simulations
C++
76
star
11

ifc2citygml

Automatic conversion of IFC models 2x3 to CityGML LOD 1/2/3/4
C++
73
star
12

pprepair

Validation and Automatic Repair of Planar Partitions
C++
57
star
13

3DCityDB-Tools-for-QGIS

This repository contains code of a QGIS plugin that facilitates data handling of the CityGML 3D City Database.
PLpgSQL
55
star
14

masbpy

Medial Axis Shrinking Balls - Python implementation of the Shrinking Ball algorithm to construct the Medial Axis Transform
Python
49
star
15

Solar3Dcity

An experimental utility to estimate the yearly solar irradiation of roof surfaces in CityGML
Python
48
star
16

3D_Urban_Mesh_Annotator

A tool for annotating textured urban meshes
C++
43
star
17

3d-building-metrics

Tool to compute shape metrics from 3D geometries for buildings
Jupyter Notebook
32
star
18

SUMS-Semantic-Urban-Mesh-Segmentation-public

SUMS: Semantic Urban Mesh Segmentation.
Python
25
star
19

website

Website for the group
HTML
25
star
20

3dbag-viewer

Vue
22
star
21

PSSNet

PSSNet: Planarity-sensible Semantic Segmentation of Large-scale Urban Meshes
C++
21
star
22

msc_geomatics_thesis_template

A template for the TU Delft MSc Geomatics thesis (P4+P5)
TeX
13
star
23

lod2plus

Automatic generation of simple interiors for CityGML LOD2
C++
13
star
24

geogeeks

The place where geogeeks go to know "how to do X"
HTML
12
star
25

indoorjson

IndoorJSON is like IndoorGML but without the GML
Python
11
star
26

esri_geobim

C++
11
star
27

IfcLocator

JavaScript
10
star
28

Roofline-extraction-from-orthophotos

Roofline extraction from orthophotos
C++
9
star
29

bag3d

Software for generating a 3D version of the BAG dataset and more. Python + PostgreSQL + 3dfier
Python
9
star
30

CityGML-schema-validation

small script to validate a CityGML file against the XSD schemas of CityGML (all versions supported)
Python
7
star
31

prepair-qgis

QGIS plugin for prepair
Python
7
star
32

3dbook

Book for the course GEO1004: 3D modelling of the built environment
TeX
6
star
33

CityJSON2glTF

An experimental python utility to convert CityJSON datasets to glTF 2.0 and schematically validate glTF datasets
Python
5
star
34

cityjson-versioning-prototype

A prototype implementation of interaction with versioned CityJSON files
Python
5
star
35

geo1101.2020.ahn3

An improved AHN3 gridded DTM/DSM done as university project for the MSc Geomatics @ TU Delft
Python
5
star
36

cityjsonToRevit

A plugin for importing CityJSON geometries to Autodesk Revit
C#
5
star
37

city2InfraGML

An experimental python utility to convert CityGML datasets to InfraGML and vice versa.
Python
5
star
38

carriageways-creator

Carriageways Creator
Jupyter Notebook
4
star
39

val3ditypy

Python bindings for the award-winning val3dity software
C++
4
star
40

geovalidation.server

Web server for val3dity/prepair
HTML
4
star
41

Random3DTIN

A python utility to generate terrain models at different LODs in CityGML.
Python
3
star
42

CityGML-QIE-3Dvalidation

repository for the test datasests for the OGC CityGML QIE Experiment #2: 3D geometric validation
HTML
3
star
43

ocm-downloader

A script to download the data of opencitymodel
Python
3
star
44

geo1004_handouts

Handouts for the course GEO1004: 3D modelling of the built environment
TeX
3
star
45

geo2020

Website for the MSc Geomatics graduation thesis (GEO2010+GEO2020)
CSS
3
star
46

geoflow-nodes

Various nodes for geoflow
C++
2
star
47

eNoiseModel

Data model for standardising the input/output data for noise simulations using CNOSSOS-EU
2
star
48

Testbed4UBEM

A Repository of an Urban Energy Modeling testbed based on the OGC CityGML v2.0 standard
2
star
49

valsem

Validation of the semantic of CityGML LOD2 (based on normal orientations)
C++
2
star
50

3dgeoinfo2018

Website for the 3D Geoinfo 2018 conference
HTML
2
star
51

homebrew-software

homebrew formulas for some of our software
Ruby
2
star
52

isochrones-mexico

C++
2
star
53

Symmetrization

C++
2
star
54

matahn

Download tool for AHN2 that delivers a LAZ file with the points inside a bounding box drawn by the user.
Python
2
star
55

git-course-material

TeX
2
star
56

latex-getting-started

Quick LaTeX course
TeX
1
star
57

EnergyADEv1_toCityGMLv3

This repository contains the work for mapping the Energy ADE v1.0 to the CityGML v3.0 data model
1
star
58

InfraJSON

JSON encoding for LandInfra Conceptual Model 1.0.0
Python
1
star
59

3D_Metadata_ADE

CityGML ADE for storing metadata about the 3D city models.
Python
1
star
60

citygml-solidifier

takes a CityGML file with Buildings stored as gml:MultiSurfaces and creates gml:Solids
Python
1
star
61

citygmlinfo

Prints out all sort of useful information about a CityGML file
C++
1
star
62

city3d_valpy

citygml valid
Python
1
star
63

abe-latex

LaTeX template for the TU Delft A+BE PhD thesis series
TeX
1
star
64

cityjson-lcc-reconstructor

A tool to topologically reconstruct a CityJSON model
C++
1
star
65

citygml2poly

Converts the solids of a CityGML file to POLY files.
Java
1
star
66

nl3d

XSLT
1
star
67

website-3d4em

Source code for
HTML
1
star
68

IDEA-Taskforce

Collection of notes from the 3DEI-working group
1
star