qgis / QGIS

QGIS is a free, open source, cross platform (lin/win/mac) geographical information system (GIS)
https://qgis.org
GNU General Public License v2.0
10.09k stars 2.93k forks source link

Tileset.json 3DTiles - missing reading first 'content' #56240

Open P-SLISSE opened 5 months ago

P-SLISSE commented 5 months ago

What is the bug or the crash?

Hi, I will relate this issue when displaying a tileset.json of 3DTiles. In my case, the first mesh described in the tileset.json is not loaded and displayed.

My file tileset.json is as below : { "root": { "content":{"uri":"mesh_841454.b3dm","boundingVolume":{ "region": [0.13402710163190884041, 0.84709452949130803479, 0.13720856653717769524, 0.84931381311471787487, -70.871250336943944603, 342.0626754313605602]}}, "boundingVolume": { "region": [0.13402710163190884041, 0.84709452949130803479, 0.13720856653717769524, 0.84931381311471787487, -70.871250336943944603, 342.0626754313605602]}, "refine":"REPLACE", "geometricError":269.378387 ,"children":[ { "content":{"uri":"7618_83.json","boundingVolume":{ "region": [0.13402710163190884041, 0.84709452949130803479, 0.13720856653717769524, 0.84931381311471787487, -70.871250336943944603, 342.0626754313605602]}}, "boundingVolume": { "region": [0.13402710163190884041, 0.84709452949130803479, 0.13720856653717769524, 0.84931381311471787487, -70.871250336943944603, 342.0626754313605602]}, "refine":"REPLACE", "geometricError":269.378387 } ] } ,"asset":{"version": "1.0"} }

As you can see, right after the 'root', a 'content' is set. Unfortunately, QGis want first of all a description of the boundingVolume. So in my case, the first mesh content is not used, and only considered as a boundingVolume. As a result, the mesh is missing in the 3D display. (see the image below)

My solution (in short term) is to add a boundingVolume description right after 'root' (as below in bold italic) (don't forget to close ]} at the end of the file)

{ "root": { "boundingVolume": { "region": [0.13120213627584770277, 0.84528027577822373306, 0.13722016590576699424, 0.84954370748110430434, -1607.1293324211301297, 458.26676828767278948]}, "geometricError":524.376831, "refine":"REPLACE", "children":[ { "content":{"uri":"mesh_841454.b3dm","boundingVolume":{ "region": [0.13402710163190884041, 0.84709452949130803479, 0.13720856653717769524, 0.84931381311471787487, -70.871250336943944603, 342.0626754313605602]}}, "boundingVolume": { "region": [0.13402710163190884041, 0.84709452949130803479, 0.13720856653717769524, 0.84931381311471787487, -70.871250336943944603, 342.0626754313605602]}, "refine":"REPLACE", "geometricError":269.378387 ,"children":[ { "content":{"uri":"761883.json","boundingVolume":{ "region": [0.13402710163190884041, 0.84709452949130803479, 0.13720856653717769524, 0.84931381311471787487, -70.871250336943944603, 342.0626754313605602]}}, "boundingVolume": { "region": [0.13402710163190884041, 0.84709452949130803479, 0.13720856653717769524, 0.84931381311471787487, -70.871250336943944603, 342.0626754313605602]}, "refine":"REPLACE", "geometricError":269.378387 } ] } **]}_** ,"asset":{"version": "1.0"} }

Do you mind it is possible to take account of this issue and to display the mesh even if there is no boundingVolume description right after 'root' ?

(The tileset.json is writen by the software Skyline Photomesh.)

Steps to reproduce the issue

image

Versions

Version de QGIS 3.34.3-Prizren Révision du code 47373234ac Version de Qt 5.15.3 Version de Python 3.9.18 Version de GDAL/OGR 3.8.3 Version de Proj 9.3.1 Version de la base de données du registre EPSG v10.098 (2023-11-24) Version de GEOS 3.12.1-CAPI-1.18.1 Version de SQLite 3.41.1 Version de PDAL 2.6.0 Version du client PostgreSQL 15.2 Version de SpatiaLite 5.1.0 Version de QWT 6.1.6 Version de QScintilla2 2.13.4 Version de l'OS Windows 10 Version 2009

Extensions Python actives CityJSON-loader 0.8.1 localiserparcelle 3.6.0 profiletool 4.2.6 StreetView 3.2 valuetool 3.0.17 db_manager 0.1.20 grassprovider 2.12.99 MetaSearch 0.3.6 processing 2.12.99

Supported QGIS version

New profile

Additional context

No response

nyalldawson commented 5 months ago

@P-SLISSE is the original version of this service available anywhere for testing?

P-SLISSE commented 5 months ago

Hi @nyalldawson The TestSample tileset is available at https://s3.eu-west-2.wasabisys.com/ems-sgct-photomaillage/ODACIT/QGis3DNyall/TilesetCONTENT/tileset.json It can be downloaded with this url since 31/03/24 : https://partage.strasbourg.eu/share-access/sharings/-qn8zYYt.75555LOj

  1. When displaying in 2D and 3D views, the first lower resolution level is used (mesh_21.b3dm) image

  2. When zooming in, the second resolution level is used, which is 4 meshes (0_167/mesh_24.b3dm; 0_167/mesh_161853.b3dm; 0_167/mesh_836494.b3dm; 0_167/mesh_841453.b3dm) All this 4 meshes are set in the 0_167.json file image

  3. When zooming in, the third resolution level start to be used. Here comes the issue. As you can see, there is an empty area, which correspond to the first 'content' in 7618/tileset.json image The file 7618/mesh_841454.b3dm is not displayed in the views In my understanding, it is used only as a boundingVolume, as I explained before. It only behave this way when 'content' is set right after 'root'. It seems that QGis wanted first a boundingVolume description between 'root' and the first 'content'

You have the sample available for testing.