3dcitydb / 3dcitydb-web-map

Cesium-based 3D viewer and JavaScript API for the 3D City Database
Apache License 2.0
377 stars 125 forks source link

Classifying Building (Surfaces) by thematic Data? #76

Closed baum12373 closed 2 years ago

baum12373 commented 2 years ago

Hello,

I set up the 3dcitydb and the 3D web-map-client and it works well. However, I would now also like to color (classify) buildings or their semantic surfaces based on the thematic data I included via the PostgREST API. Kind of like in the picture of the site, without the textures (https://3dcitydb-docs.readthedocs.io/en/version-2022.0/webmap/index.html). Is this possible?

Thanks in advance!

Son-HNguyen commented 2 years ago

Hi, it is currently not possible to dynamically highlight / color buildings on the fly while navigating through the web map client. If you however want to color buildings (and keep the color as it is without changing later), then you could do the following steps:

  1. Select the buildings you want to color in the 3DCityDB Importer/Exporter (using such as SQL filters)
  2. Change the color styles for these buildings in the 3DCityDB Importer/Exporter
  3. Export these buildings as COLLADA/KML/glTF
  4. Repeat steps 1-3 for other buildings
  5. Import these buildings as separate layers in the 3DCityDB Web Map Client

You should now be able to see the buildings in different colors and when needed show/hide specific layers.

baum12373 commented 2 years ago

Thanks a lot! Are there any plans on adding this functionality in the future?

Son-HNguyen commented 2 years ago

Hi, I'm glad it helped. We had done some experiments on this "semantic highlighting" but didn't have the time and resources yet to publish it to the public branch. If you are planning to implement it then we will be more than happy to welcome your contribution. :)

Son-HNguyen commented 2 years ago

In addition to my previous comment about adding different layers to the web map client, you could also:

  1. Enrich your CityGML files with suitable appearances (see documentation) or
  2. Use the tool py3dtilers developed by our colleagues at VCityTeam to manipulate your 3D Tiles from the 3DCityDB. They have some nice demos that might be interesting to you.