QGIS icon indicating copy to clipboard operation
QGIS copied to clipboard

mbtiles generates random tiles with black background

Open AaronJohnsonSpambox opened this issue 2 years ago • 3 comments

What is the bug or the crash?

When trying to generate a topo map using Generate XYZ tiles (MBTiles). Several of the tiles at zoom level 15 or 16 have a black background even though they are PNGs and I use the default transparent background. I discovered the bug on a much more detailed topographic dataset and have pared it down to a much simpler one that still shows the problem.

MB Tiles output: Results: QGIS version: 3.26.2-Buenos Aires QGIS code revision: feec3d3b12f Qt version: 5.15.3 Python version: 3.9.5 GDAL version: 3.5.1 GEOS version: 3.10.3-CAPI-1.16.1 PROJ version: Rel. 9.0.1, June 15th, 2022 PDAL version: 2.4.2 (git-version: 6cb4e7) Algorithm started at: 2022-09-10T11:25:46 Algorithm 'Generate XYZ tiles (MBTiles)' starting… Input parameters: { 'BACKGROUND_COLOR' : QColor(0, 0, 0, 0), 'DPI' : 96, 'EXTENT' : '4114751.886400000,4201829.355200000,-380132.886800000,-316419.954400000 [EPSG:3857]', 'METATILESIZE' : 4, 'OUTPUT_FILE' : 'C:/temp/test.mbtiles', 'QUALITY' : 75, 'TILE_FORMAT' : 0, 'ZOOM_MAX' : 16, 'ZOOM_MIN' : 10 }

Using 12 CPU Threads: Generating tiles for zoom level: 10 Generating tiles for zoom level: 11 Generating tiles for zoom level: 12 Generating tiles for zoom level: 13 Generating tiles for zoom level: 14 Generating tiles for zoom level: 15 Generating tiles for zoom level: 16 Execution completed in 36.76 seconds Results: {'OUTPUT_FILE': 'C:/temp/test.mbtiles'}

Loading resulting layers Algorithm 'Generate XYZ tiles (MBTiles)' finished

Steps to reproduce the issue

Unzip and open the attached project topo.zip and run the Generate XYZ tiles (MBTiles) command:

Input parameters: { 'BACKGROUND_COLOR' : QColor(0, 0, 0, 0), 'DPI' : 96, 'EXTENT' : '4114751.886400000,4201829.355200000,-380132.886800000,-316419.954400000 [EPSG:3857]', 'METATILESIZE' : 4, 'OUTPUT_FILE' : 'C:/temp/test.mbtiles', 'QUALITY' : 75, 'TILE_FORMAT' : 0, 'ZOOM_MAX' : 16, 'ZOOM_MIN' : 10 }

Once finished, add the resulting test.mbtiles result to the project and if you zoom into level 15 / 16, and pan around you'll usually see something like this:

Screenshot 2022-09-10 112714

Versions

QGIS version 3.26.2-Buenos Aires QGIS code revision feec3d3b12f Qt version 5.15.3 Python version 3.9.5 GDAL/OGR version 3.5.1 PROJ version 9.0.1 EPSG Registry database version v10.064 (2022-05-19) GEOS version 3.10.3-CAPI-1.16.1 SQLite version 3.38.1 PDAL version 2.4.2 PostgreSQL client version unknown SpatiaLite version 5.0.1 QWT version 6.1.6 QScintilla2 version 2.13.1 OS version Windows 10 Version 2009

Active Python plugins db_manager 0.1.20 grassprovider 2.12.99 MetaSearch 0.3.6 processing 2.12.99 sagaprovider 2.12.99

Supported QGIS version

  • [X] I'm running a supported QGIS version according to the roadmap.

New profile

  • [X] I tried with a new QGIS profile

Additional context

No response

AaronJohnsonSpambox avatar Sep 10 '22 16:09 AaronJohnsonSpambox

I can confirm this behavior using tilesxyzmbtiles processing in QGIS 3.28.2

{
  "area_units": "m2",
  "distance_units": "meters",
  "ellipsoid": "EPSG:7019",
  "inputs": {
    "BACKGROUND_COLOR": "rgba( 0, 0, 0, 0.00 )",
    "DPI": 96,
    "EXTENT": "685164.8273,719222.6358,7044827.5740,7077232.0603 [EPSG:2154]",
    "METATILESIZE": 4,
    "OUTPUT_FILE": "[...]/run_lvl_18.mbtiles",
    "QUALITY": 75,
    "TILE_FORMAT": 0,
    "ZOOM_MAX": 18,
    "ZOOM_MIN": 18
  }

qgis_bug_black_tiles

Jean-Roc avatar Jan 11 '23 14:01 Jean-Roc

I have this problem as well

image

QGIS version 3.28.3-Firenze QGIS code revision c12bcb2f76c Qt version 5.15.3 Python version 3.9.5 GDAL/OGR version 3.6.2 PROJ version 9.1.1 EPSG Registry database version v10.076 (2022-08-31) GEOS version 3.11.1-CAPI-1.17.1 SQLite version 3.39.4 PDAL version 2.4.3 PostgreSQL client version unknown SpatiaLite version 5.0.1 QWT version 6.1.6 QScintilla2 version 2.13.1 OS version Windows 10 Version 2009

pfbreton-perso avatar Mar 23 '23 17:03 pfbreton-perso

Same here, both with QGIS 3.22.16 and 3.32.0

danzig666 avatar Jul 02 '23 12:07 danzig666

Issue is also happening for me with version 3.32.1

Smurfj3 avatar Aug 24 '23 00:08 Smurfj3

Fixed by #54321.

alexbruy avatar Oct 27 '23 12:10 alexbruy