Bug report #21958

Updated by Saber Razmjooei over 5 years ago

GDAL/OGR: 2.4.0
QGIS: master

I am trying to create an mbtiles file using xyz tile generator. If the output file is not defined (i.e. not pointing to an existing mbtiles file), I get this:

@Traceback (most recent call last):
File "/usr/local/src/QGIS_master/build/output/python/plugins/processing/algs/qgis/TilesXYZ.py", line 335, in processAlgorithm
writer = MBTilesWriter(output_file, tile_params, wgs_extent, min_zoom, max_zoom)
File "/usr/local/src/QGIS_master/build/output/python/plugins/processing/algs/qgis/TilesXYZ.py", line 158, in __init__
ds.ExecuteSQL("INSERT INTO metadata(name, value) VALUES ('{}', '{}');".format('minzoom', min_zoom))
AttributeError: 'NoneType' object has no attribute 'ExecuteSQL'


Execution failed after 0.01 seconds@

The algorithm creates an empty mbtiles file. When I run gdalinfo, I get this:

@ERROR 1: Cannot find min and max zoom_level
gdalinfo failed - unable to open 'OUTPUT_FILE.mbtiles'.@

If I point the output file to overwrite an existing mbtiles, I get this error:

@Traceback (most recent call last):
File "/usr/local/src/QGIS_master/build/output/python/plugins/processing/algs/qgis/TilesXYZ.py", line 335, in processAlgorithm
writer = MBTilesWriter(output_file, tile_params, wgs_extent, min_zoom, max_zoom)
File "/usr/local/src/QGIS_master/build/output/python/plugins/processing/algs/qgis/TilesXYZ.py", line 154, in __init__
ds = driver.Create(filename, 1, 1, 1, options=['TILE_FORMAT=%s' % tile_format] + options)
File "/usr/lib/python3/dist-packages/osgeo/gdal.py", line 1736, in Create
return _gdal.Driver_Create(self, *args, **kwargs)
RuntimeError


Execution failed after 0.02 seconds@ seconds
@

Back