Bug report #17514

QGIS 3D view - Setting DEM for terrain elevation cause canvas to go blank

Added by Jeremy Palmer almost 3 years ago. Updated almost 3 years ago.

Status:Closed
Priority:Normal
Assignee:Martin Dobias
Category:3D
Affected QGIS version:master Regression?:No
Operating System:MacOSX Easy fix?:No
Pull Request or Patch supplied:No Resolution:fixed/implemented
Crashes QGIS or corrupts data:No Copied to github as #:25411

Description

Steps to reproduce:

1. Loaded WMTS layer () and
2. DEM into QGIS project (few tiles in VRT from https://data.linz.govt.nz/layer/51768-nz-8m-digital-elevation-model-2012/)
3. Loaded 3D view, can see both layers on canvas
4. Open 3D view configure and set Terrain Elevation to DEM layer. Click OK
5. Canvas goes white/blank. No scrolling or zooming to extent allows you to see anything

Using QGIS 2.99 installed by Mac hombrew:

QGIS version
2.99.0-Master
QGIS code revision
394c531
Compiled against Qt
5.9.2
Running against Qt
5.9.2
Compiled against GDAL/OGR
2.2.2
Running against GDAL/OGR
2.2.2
Compiled against GEOS
3.6.2-CAPI-1.10.2
Running against GEOS
3.6.2-CAPI-1.10.2 4d2925d6
PostgreSQL Client Version
10.0
SpatiaLite Version
4.3.0a
QWT Version
6.1.3
PROJ.4 Version
493
QScintilla2 Version
2.10.1
This copy of QGIS writes debugging output.

Associated revisions

Revision d03b6f43
Added by Martin Dobias almost 3 years ago

Fix world origin and camera position on terrain change (fixes #17514)

This makes "zoom full" in 3D view working again after modification of terrain generator.
Also we update the camera position so it looks at the same spot as it was before.

Revision ebde3be2
Added by Martin Dobias almost 3 years ago

[3d] Reproject DEM for terrain if the DEM has different CRS (fixes #17514)

History

#1 Updated by Jeremy Palmer almost 3 years ago

Note this was done using the NZTM projection (EPSG:2193). Both layers had this source projection.

#2 Updated by Martin Dobias almost 3 years ago

What WMTS layer did you use? (seems missing in ticket description)

Using just a DEM terrain tile works for me. Can you confirm that without the extra WMTS layer the 3D view works fine?

#4 Updated by Jeremy Palmer almost 3 years ago

Can you confirm that without the extra WMTS layer the 3D view works fine?

With just the DEM layer added to the project and having the elevation terrain set in the 3D map I see nothing on the cavnas. But should I?

#5 Updated by Martin Dobias almost 3 years ago

Used the NZTM tilegrid from https://tiles.maps.linz.io/nz_aerialimagery_basemap/WMTSCapabilities.xml

Thanks - I can reproduce your problem now.

With just the DEM layer added to the project and having the elevation terrain set in the 3D map I see nothing on the cavnas. But should I?

Yes - you should be able to see the DEM layer in the 3D view...

#6 Updated by Jeremy Palmer almost 3 years ago

Yes - you should be able to see the DEM layer in the 3D view...

Thanks after a restart of QGIS it came back. Very strange. I'm also getting cashes after long usage, but can't reproduce the crashes yet.

#8 Updated by Martin Dobias almost 3 years ago

  • % Done changed from 0 to 100
  • Status changed from Open to Closed

#9 Updated by Jeremy Palmer almost 3 years ago

Thanks Martin!

#10 Updated by Jeremy Palmer almost 3 years ago

  • Status changed from Closed to Reopened

I've re-opened this. I've noticed this issue still occurs if the WMTS layer and the Raster DEM as in different coordinate reference systems. In this case WMTS EPSG:2193 and DEM as EPSG:3857.

#11 Updated by Martin Dobias almost 3 years ago

Could you please describe how do you get the issue? And what is your project CRS? Does the DEM layer need to get involved at all?

The only problem I can see is that if I use EPSG:3857 as project CRS and load a map layer in EPSG:2193, the 3D view will get into some trouble with reprojection of raster layer from EPSG:2193 to EPSG:3857... due to the +/- 180 degrees longitude issues I think. The issue applies to 2D map view as well, if I zoom out a lot.

#12 Updated by Giovanni Manghi almost 3 years ago

  • Status changed from Reopened to Feedback

#13 Updated by Jeremy Palmer almost 3 years ago

Steps to reproduce:

1. Open QGIS and create blank project
2. Open layer: https://tiles.maps.linz.io/nz_aerialimagery_basemap/WMTSCapabilities.xml and add NZTM (EPSG:2193) tilegrid
3. Add DEM layer (few tiles in VRT from https://data.linz.govt.nz/layer/51768-nz-8m-digital-elevation-model-2012/) - EPSG 3857
4. Open new 3D map view
5. Open new 3D map view config and set terrain elevation to DEM layer. Click Ok
6. Screen goes blank, click reset view to see content again - map views ok.
7. Open new 3D map view config again, change a terrain setting (e.g Vertical scale). Click Ok
8. Screen goes blank

After the second config change you can't even reset the view to see the map.

#14 Updated by Giovanni Manghi almost 3 years ago

  • Status changed from Feedback to Open

#15 Updated by Martin Dobias almost 3 years ago

  • Status changed from Open to Closed

#16 Updated by Giovanni Manghi almost 3 years ago

  • Resolution set to fixed/implemented

Also available in: Atom PDF