Assignment 2
Generalisation of a 3D city model
Deadline is 22 March 2023 at 01:45 pm
Late submission? 10% will be removed for each day that you are late.
You’re allowed for this assignment to work in a group of 3 (and thus submit only one solution for all of you). If you prefer to work alone or in pairs, it’s also fine.
The assignment is worth 20% of your final mark.
- Overview
- Definitions of the LoDs
- Methodology/workflow to use
- Report
- Marking
- What to submit and how to submit it
Overview
The aim of this assignment is to generalise a 3D city model, from buildings in LoD2 you need to generate two extra LoDs: LoD1.2 and LoD0.2.
You will have to write a software that reads a CityJSON file that contains buildings in LoD2.x, and you will need to add the two LoDs and output a file containing 3 LoDs for each building.
Definitions of the LoDs
PDF DOI BibTeX
@inproceedings{Biljecki16c, author = {Biljecki, Filip and Ledoux, Hugo and Stoter, Jantien}, booktitle = {Computers, Environment and Urban Systems}, pages = {25--37}, title = {An improved {LOD} specification for {3D} building models}, year = {2016}, vol = {59}, doi = {10.1016/j.compenvurbsys.2016.04.005} }
Methodology/workflow to use
You have to use C++ and eventually the CGAL library to do this assignment. You are not allowed to use other external libraries (or ask on discord for specific ones).
Your code needs to be a single binary/executable that reads one CityJSON file, and outputs a new one containing the added LoDs.
You can use any packages of CGAL.
You can use that starting code, which contains a few examples to help you.
LoD1.2 specifications
The LoD1.2 should be reconstructed as follows:
That is, the ground should be at the height of the ground of the LoD2.2, and the height of the roof should be set at 70% of the difference between the eave and the ridge. Calculating the heights of the eave and the ridge is not an exact science, we ask you to describe in your report how to computed it and why you think it’s robust against different inputs.
The LoD1.2 should be a Solid
and be geometrically valid (verify this with val3dity).
LoD0.2 specifications
The LoD0.2 should contain only the ground surface and be a MultiSurface
embedded in 3D space and having the correct elevation.
It should also be geometrically valid.
Input data to test your program?
In the GitLab folder /data/
there are a few files that you can use to test.
tudcampus.city.json
+limburg.city.json
are both 3DBAG files that I downloaded and I removed the LoD0/1.2/1.3 using cjio (cjio myfile.city.json lod_filter "2.2" upgrade new.city.json
). Theupgrade
operator is because the latest 3DBAG files are still in the v1.1 of CityJSON, and I upgraded them to v2.0;bruxelles.city.json
is a CityGML file of Brussels that is freely available there. To automatically convert it to CityJSON, I followed that tutorial;specialcases_x.city.json
are special cases that I added there for you, so that you consider and are aware of them.
You should test your implementation with more data, here are some sources:
- https://www.cityjson.org/datasets/
- https://3d.bk.tudelft.nl/opendata/opencities/
- https://github.com/OloOcki/awesome-citygml
Requirements for the program
It should take one argument (the input CityJSON file), and output in the same folder as the program a new file called out.city.json
.
The demo code for hw02 shows how this can be done.
Requirements for the CityJSON output
- CityJSON version 2.0 (both for input and output)
- the file should follow the same structure and have all the original content of the input file. The only difference allowed is that the order of the properties doesn’t need to be the same since your library might not allow you to have control over this.
- only
Building
andBuildingPart
are to be generalised, other CityGML classes are to be ignored (but kept in the output files if they are in the input file) - you should add the extra LoDs where the LoD2.x is already present, ie it could be directly for a
Building
or aBuildingPart
. - the file you produce must be schematically valid according to the CityJSON schemas (use
cjval
to verify this).
Some tips
- You need to consider that the buildings in a 3D city model will rarely be geometrically valid (they seldom are in practice), and you cannot assume so. So, your algorithms must deal with this (and not crash because of geometries that are not watertight or self-intersect). Reflect about this in the report.
- The CityJSON file you read as input will be syntactically valid and of version 2.0.
- The validator cjval can be used locally to verify the syntax of the files you create, it’s faster and simpler to use then the web-app.
- CGAL has many packages that can be of great help: explore!
- You can visualise the CityJSON files using ninja.cityjson.org, QGIS (using the CityJSON Loader plugin), or azul (macOS only).
Report
The short report (about 3-4 pages max!) should discuss:
- how you calculated the eave/ridge and other decisions you needed to take,
- the engineering decisions you took (why did you do it this way or not another way?), and
- the difficulties/issues you faced and how you solved them.
Also, a who-did-what? section should be in the report: explain how the tasks were divided among the members of the team. It needs to be relatively equal, and one member cannot only write the report, all have to work on at least one of the 5 attributes.
Marking
Criterion | Points |
---|---|
report (quality/readability/etc) | 3 |
code runs without modifications | 1 |
code outputs schema-valid files | 1 |
LoD0.2 quality | 2 |
LoD1.2 quality | 3 |
What to submit and how to submit it
You must hand in one ZIP containing:
- the code (several files possible) you wrote to do the assignment (
CMakeLists.txt
+*.h
+*.cpp
) - a report in PDF format (not in Microsoft Word please)
- the file
out.city.json
that your program outputs for the inputtudcampus.city.json
The name of the file consists of the studentIDs of the members separated by a “_”, for example 5015199_4018169.zip
.
The structure of the ZIP should be:
5015199_4018169_4123169.zip/
|-- data/
|-- out.city.json
|-- report/
|-- report.pdf
|-- src/
|-- main.cpp
|-- definitions.h
|-- geomtools.h
|-- geomtools.cpp
|-- ... (you can add more here)
|-- CMakeList.txt
Do not submit your assignment by email, but use this DropBox link.
[last updated: 2024-02-29 14:51]