Coder Social home page Coder Social logo

qgis-xyz-tiles's Introduction

qgis-xyz-tiles

A processing algorithm to generate xyz tiles from map/layer extent. Note: for QGIS 3.8 and above, you do not need this plugin. The functionality is available from core processing toolbox. This plugin is a stop-gap for QGIS 3.4 LTR users.

qgis-xyz-tiles's People

Contributors

klakar avatar nurenda avatar peterpetrik avatar saberraz avatar varmar05 avatar wonder-sk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

qgis-xyz-tiles's Issues

race conditions affecting MBTilesWriter

your plugin included in QGIS 3.10 for linux seems to be plagued by race conditions when it becomes executed in multiple threads.

the issue doesn't appear in case of the DirectoryWriter, but the MBTilesWriter will hardly work at all and produce corrupt files with lots of missing tiles and other defects...

as a symptom of this particular issue, you should often see error messages like this:

ERROR 5: /tmp/test7.mbtiles: Access window out of range in RasterIO().  Requested (-569088,-368384) of size 256x256 on raster of 512x512.

the strange negative numbers are a side effect of unexpected changed values of the self._first_tile variable resp. colliding zoom factors which are running in parallel and overwrite the expected state one another...

i did try to fix the issue by replacing self._first_tile and self._zoom_ds with dictionaries indexed by the zoom factor to reduce the observable collisions. this had some positive effect, but it doesn't completely fix the issues. :(

unfortunately i do not know, how to fix this kind of thread lock requirements in case of QGIS plugins in a more adequate manner.

the versions of my affected debian linux installation:

QGIS-Version: 3.10.0-A Coruña
QGIS-Codeversion: 6c816b4204
Qt-Version: 5.11.3
GDAL-Version: 2.4.2
GEOS-Version: 3.8.0-CAPI-1.13.1 
PROJ-Version: Rel. 5.2.0, September 15th, 2018
Verarbeite Algorithmus…
Algorithmus XYZ-Kacheln erzeugen (MBTiles) startet…
Eingabeparameter:
{ 'BACKGROUND_COLOR' : QColor(0, 0, 0, 0), 'DPI' : 96, 'EXTENT' : '1716053.858612443,1721455.9642655044,5951485.136729757,5955838.399322829 [EPSG:3857]', 'METATILESIZE' : 4, 'OUTPUT_FILE' : '/tmp/test7.mbtiles', 'QUALITY' : 75, 'TILE_FORMAT' : 0, 'ZOOM_MAX' : 16, 'ZOOM_MIN' : 12 }

Using 8 CPU Threads:
Pushing all tiles at once: 11 tiles.
Ausführung nach 2.34 Sekunden abgeschlossen
Ergebnisse:
{'OUTPUT_FILE': '/tmp/test7.mbtiles'}

Labels missing from tiles

Running QGIS 3.6.3 and Tiles XYZ 0.6
OS Ubuntu 18.04

It looks like there's a significant number of labels missing in the generated tiles.
In QGIS it looks as below:
Skärmbild_2019-06-03_20-59-11
While the export to XYZ tiles have a lot of labels missing (below):
Skärmbild_2019-06-03_21-02-50

I've noted the "fix" to remove partial labels, but to my eye this looks like a substantial amount of additional labels that are missing.

One of my problems (my mistake) early on was that I had my project in meters and this changed the style for a lot of symbols when rendering the tiles. The labels also have size settings in map-units, if that may have something to do with this problem (haven't had time to examine this yet).

It would of course be preferred to not have ANY labels partially rendered.

Might it be possible to render a larger area, including all labels over the tile edges, and then clip them to the correct tile size? It will take more processing time, but if it is an option in the tool, that would be really useful when rendering from vector source.

Thanks!

'TilesXYZAlgorithmDirectory' object has no attribute 'parameterAsBoolean'

Hi,

Thank you for the plugin!

After the last update (v0.3) I'm not able to run tiles generation. Here is the log:

QGIS version: 3.6.3-Noosa
QGIS code revision: 0c5774c068
Qt version: 5.11.2
GDAL version: 2.4.1
GEOS version: 3.7.2-CAPI-1.11.0 b55d2125
PROJ version: 520
...
Traceback (most recent call last):
File "C:/Users/tsymbarovich_pr/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\tiles_xyz\tiles_xyz_algorithm.py", line 485, in processAlgorithm
is_tms = self.parameterAsBoolean(parameters, self.TMS_CONVENTION, context)
AttributeError: 'TilesXYZAlgorithmDirectory' object has no attribute 'parameterAsBoolean'

"sqlite3.OperationalError: database is locked"

QGIS version | 3.6.1-Noosa
Plugin installed just now.

Processing algorithm…
Algorithm 'Generate XYZ tiles (MBTiles)' starting…
Input parameters:
{ 'DPI' : 150, 'EXTENT' : '532566.3961918731,604272.4545227268,5911272.408939038,5965051.952687179 [EPSG:25832]', 'OUTPUT_FILE' : '/home/test/test.mbtiles', 'TILE_FORMAT' : 0, 'ZOOM_MAX' : 16, 'ZOOM_MIN' : 1 }

Generating tiles for zoom level: 1
Generating tiles for zoom level: 2
Generating tiles for zoom level: 3
Generating tiles for zoom level: 4
Generating tiles for zoom level: 5
Generating tiles for zoom level: 6
Generating tiles for zoom level: 7
Generating tiles for zoom level: 8
Generating tiles for zoom level: 9
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
Traceback (most recent call last):
File "/home/me/.local/share/QGIS/QGIS3/profiles/default/python/plugins/tiles_xyz/tiles_xyz_algorithm.py", line 384, in processAlgorithm
self.generate(writer, parameters, context, feedback)
File "/home/me/.local/share/QGIS/QGIS3/profiles/default/python/plugins/tiles_xyz/tiles_xyz_algorithm.py", line 260, in generate
writer.write_tile(tile, tile_img)
File "/home/me/.local/share/QGIS/QGIS3/profiles/default/python/plugins/tiles_xyz/tiles_xyz_algorithm.py", line 339, in write_tile
self._init_zoom_layer(tile.z)
File "/home/me/.local/share/QGIS/QGIS3/profiles/default/python/plugins/tiles_xyz/tiles_xyz_algorithm.py", line 331, in _init_zoom_layer
self._execute_sqlite("UPDATE metadata SET value='{}' WHERE name='bounds'".format(bounds))
File "/home/me/.local/share/QGIS/QGIS3/profiles/default/python/plugins/tiles_xyz/tiles_xyz_algorithm.py", line 312, in _execute_sqlite
conn.execute(cmd)
sqlite3.OperationalError: database is locked

Execution failed after 39.49 seconds

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

Database is locked

Traceback (most recent call last):
File "C:/Users/user/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\tiles_xyz\tiles_xyz_algorithm.py", line 384, in processAlgorithm
self.generate(writer, parameters, context, feedback)
File "C:/Users/user/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\tiles_xyz\tiles_xyz_algorithm.py", line 260, in generate
writer.write_tile(tile, tile_img)
File "C:/Users/user/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\tiles_xyz\tiles_xyz_algorithm.py", line 339, in write_tile
self._init_zoom_layer(tile.z)
File "C:/Users/user/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\tiles_xyz\tiles_xyz_algorithm.py", line 331, in _init_zoom_layer
self._execute_sqlite("UPDATE metadata SET value='{}' WHERE name='bounds'".format(bounds))
File "C:/Users/user/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\tiles_xyz\tiles_xyz_algorithm.py", line 312, in _execute_sqlite
conn.execute(cmd)
sqlite3.OperationalError: database is locked

mbtiles generated with the tool doesn't work with GeoODK (no images table)

mbtiles file generated with the tool doesn't work in GeoODK app. The reason is the absence of images table. See error screenshots below
2019-07-18

-- This is how the file composition look like
xyz

-- File composition of mbtiles from other sources that work looks like this

xyz2

Any suggested solution to resolve this will be highly appreciated.

Thanks

Point symbols may get cut off at the edges

Especially when point marker symbols are relatively large, it may happen that at the edge of tiles the symbol is rendered only in one tile, giving incorrect rendering output. It happens also with lines/polygons, but it is less pronounced (only visible if the line/fill symbol has wide outline).

An example can be seen here (mainly the symbols without labels):

Changing JPG quality and DPI has no effect at all

I've done several runs with MBTiles of the same area at zoom levels 12-14 with different JPG qualities (75-100) and DPI settings (96-300). None of these changes had any effect at all, neither on the visible quality and resolution nor on the size of the destination file (which just proves my visual judgment). The quality was always as bad as with the 75 % and 96 dpi.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.