incubator-baremaps icon indicating copy to clipboard operation
incubator-baremaps copied to clipboard

Make a first experiment with 3d tiles

Open Drabble opened this issue 2 years ago • 6 comments

As described in #568. We should start to experiment generating 3d tiles from OSM data to apply extrusion on buildings and render them in Cesium.

I have made a first experiment with the most simple setup:

  1. I have a simple 3d tileset.json which defines an implicit tiling in a quad tree.
  2. Each subtree in the implicit tiling basically sets availability of all tiles and subtrees to a constant of 1.
  3. Each tile's content is a GLTF file which contains the extruded OSM buildings. To get the buildings I query a PostGIS database that already contains all of the OSM data. Then I tessellate them using JTS and extrude them manually.
  4. Finally I use JglTF to generate the GLTF binary. I serve everything with a simple JAX-RS web server.

On the JAX-RS server, I serve a simple index.html file that uses Cesium to render the 3d tiles.

Here is a preview:

image

image

https://user-images.githubusercontent.com/3996615/210795879-5cb3a039-2e98-4b5c-86a2-52237174afe5.mp4

Any input or improvement is welcome. The goal of this work is to make experimentations to discover the 3d tiles and GLTF specifications. I have learnt a lot of interesting things by working on this example and there is so much more that could be done.

One thing that would be interesting to explore is to use the ADD refinement type instead of the REPLACE refinement type. See here. This way we could additively load new buildings instead of overwriting them at each tile level.

Other possibilities include:

  • Adding terrain under the buildings and render them on a height map.
  • Applying some textures on the buildings maybe
  • Adding roof shapes based on OSM roof shape tags
  • Embedding 3d meshes such as the eiffel tower from OSM metadata as well.

There are endless possibilities and optimisations. If anyone is interested, I would be happy to discuss it.

Drabble avatar Jan 04 '23 16:01 Drabble

@javagl I had a good time working with JglTF, even if this is a very raw and basic example. I see that you have been actively contributing to 3d-tiles as well. Thank you so much for all of your hard work and your contributions to the 3d-tiles community. I hope we'll be able to improve this example in the future to make a better use of all the amazing features of these specifications.

Drabble avatar Jan 05 '23 14:01 Drabble

Thanks for the heads-up. I'll definitely have a closer look at the implementation (and the broader context of baremaps) here. (BTW: If you have any feedback or suggestions about JglTF from your perspective, feel free to bring it up as an issue there)

javagl avatar Jan 05 '23 17:01 javagl

SonarCloud Quality Gate failed.    Quality Gate failed

Bug C 1 Bug
Vulnerability A 0 Vulnerabilities
Security Hotspot E 1 Security Hotspot
Code Smell A 10 Code Smells

No Coverage information No Coverage information
1.6% 1.6% Duplication

sonarqubecloud[bot] avatar May 26 '23 19:05 sonarqubecloud[bot]

SonarCloud Quality Gate failed.    Quality Gate failed

Bug C 1 Bug
Vulnerability A 0 Vulnerabilities
Security Hotspot E 1 Security Hotspot
Code Smell A 11 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

idea Catch issues before they fail your Quality Gate with our IDE extension sonarlint SonarLint

sonarqubecloud[bot] avatar Nov 27 '23 09:11 sonarqubecloud[bot]

Quality Gate Failed Quality Gate failed

Failed conditions
1 Security Hotspot
C Reliability Rating on New Code (required ≥ A)

See analysis details on SonarCloud

Catch issues before they fail your Quality Gate with our IDE extension SonarLint

sonarqubecloud[bot] avatar Mar 25 '24 15:03 sonarqubecloud[bot]