incubator-baremaps
incubator-baremaps copied to clipboard
Make a first experiment with 3d tiles
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:
- I have a simple 3d
tileset.jsonwhich defines an implicit tiling in a quad tree. - Each subtree in the implicit tiling basically sets availability of all tiles and subtrees to a constant of 1.
- 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.
- 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:


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.
@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.
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)
SonarCloud Quality Gate failed. 
1 Bug
0 Vulnerabilities
1 Security Hotspot
10 Code Smells
No Coverage information
1.6% Duplication
SonarCloud Quality Gate failed. 
1 Bug
0 Vulnerabilities
1 Security Hotspot
11 Code Smells
No Coverage information
0.0% Duplication
Catch issues before they fail your Quality Gate with our IDE extension
SonarLint
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
