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.28k stars 2.96k forks source link

Error on adding tileset.json #55182

Closed steelraiden closed 9 months ago

steelraiden commented 9 months ago

What is the bug or the crash?

User Feedback

Error on adding tileset.json

Report Details

Python Stack Trace

Windows fatal exception: access violation

Thread 0x00001b44 (most recent call first):
<no Python frame>
Windows fatal exception: access violation

Thread 0x00001b44 (most recent call first):
<no Python frame>

Stack Trace


QgsGltfUtils::extractTileTranslation :
QgsTiledSceneLayerRenderer::renderTileContent :
QgsTiledSceneLayerRenderer::renderTile :
QgsTiledSceneLayerRenderer::renderTiles :
QgsTiledSceneLayerRenderer::render :
QgsMapRendererParallelJob::renderLayerStatic :
QgsProfilePlotRenderer::replaceSourceInternal :
QgsMapRendererParallelJob::renderingFinished :
QgsMapRendererParallelJob::takeLabelingResults :
QtConcurrent::ThreadEngineBase::run :
QThreadPoolPrivate::reset :
QThread::start :
BaseThreadInitThunk :
RtlUserThreadStart :

QGIS Info QGIS Version: 3.34.0-Prizren QGIS code revision: ffbdd67881 Compiled against Qt: 5.15.3 Running against Qt: 5.15.3 Compiled against GDAL: 3.7.2 Running against GDAL: 3.7.2

System Info CPU Type: x86_64 Kernel Type: winnt Kernel Version: 10.0.22621

Steps to reproduce the issue

  1. Go to Layer
  2. Click on Add Layer
  3. Click on Add Vector Layer
  4. Click on "Scene" type
  5. Click on File
  6. Click on "..."
  7. Search for a file named "tileset.json"
  8. Click on "Add"

Versions

Versione di QGIS 3.34.0-Prizren Revisione codice QGIS ffbdd67881 Versione Qt 5.15.3 Versione Python 3.9.5 Versione GDAL/OGR 3.7.2 Versione PROJ 9.3.0 Versione database del Registro EPSG v10.094 (2023-08-08) Versione GEOS 3.12.0-CAPI-1.18.0 Versione SQLite 3.41.1 Versione PDAL 2.5.5 Versione client PostgreSQL 15.2 Versione SpatiaLite 5.1.0 Versione QWT 6.1.6 Versione QScintilla2 2.13.4 Versione SO Windows 10 Version 2009

Plugins Python attivi citydb-tools 0.8.4 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 9 months ago

Can you share the tileset?

steelraiden commented 9 months ago

sure

tileset.json

nyalldawson commented 9 months ago

I'll need more then just the json file -- can you share the whole data set please?

steelraiden commented 9 months ago

the dataset in pretty huge, do you think I can cut something off the tileset.json file? Or maybe I can share just a bunch of referenced files?

Jean-Roc commented 9 months ago

@steelraiden let's do it the other way, have you tried a public tileset with the same result ?

steelraiden commented 9 months ago

ok I did some tests.

  1. I downloaded the "public tileset" without any other files and it loaded without errors.
  2. I downloaded a random b3dm file from https://webimaging.lillemetropole.fr/externe/maillage/2020_mel_5cm/Data/, reloaded the layer and it worked fine (I can see an image)
  3. I took my tileset.json and put in another folder, alone. I loaded it in qgis and it worked fine.
  4. I took a random b3dm file, put in the correct folder, reloaded the layer and it loaded fine, but I couldn't see any image. So I zoomed out (a lot) until crash happened.

Here's the attached file 0f.zip

folder structure tileset.json --+ 0f --+ --+ 8-39-52.b3dm

nyalldawson commented 9 months ago

Here's a self-contained version of the dataset which crashes.

dataset.zip

There's something odd in the 3d data here though. https://github.com/qgis/QGIS/pull/55212 fixes the crash, but the scene in the b3dm file does not have a valid mesh associated with it. There IS mesh data in the b3dm content, but it's not associated with the scene.

@wonder-sk do you have any insights here? The first issue (that the default scene is missing) seems OK with the GLTF spec -- see https://github.com/KhronosGroup/glTF/issues/815 . But the second is weird -- should we overstep here and just try to find the mesh even when the scene isn't linked to it?

wonder-sk commented 9 months ago

I think my preference would be to get people to fix their data :grin:

steelraiden commented 9 months ago

I think my preference would be to get people to fix their data 😁

I would do too, but in my case I'm a private developer who works for the government of my country and I received this dataset used by them in ArcGIS. When I saw the opportunity to view this specific data in QGIS I was hyped. I maybe can ask my "customer" to review the data; in that case could you give me what is technically wrong in the dataset?

nyalldawson commented 9 months ago

@wonder-sk Think I've got it -- we should be iterating over the scene's nodes children too, which is where the node with the mesh is referenced from

nyalldawson commented 9 months ago

Ok, this is fully fixed by https://github.com/qgis/QGIS/pull/55212 now