QGIS and Tile Export

    For several years I have been engaged in panning and keeping up to date the ridge schemes of two mountain regions. Dzhungar Ala Tau and Central Tien Shan.

    Initially, I drew everything in the Ocad program. This is a special program for drawing orienteering maps. The project was divided into dozens of sheets. Then these sheets were exported to pictures, stitched and cut into tiles. Tiles loaded on ftp.

    Here is an example of what happens in QGis.

    And here’s how it happened in Ocad.

    And once I met QGIS.

    The program impressed me. A nice renderer. Not as expressive as in OCAD, but the quality suited me. The ability to work directly with geodata. The ability to work with the entire project as a whole, without breaking it into pieces.
    All this prompted to transfer the entire project to QGIS.

    But now I regret it a little.
    The QGIS renderer is not suitable for generating tiles.
    Of course, there are two QTiles and QMetaTiles plug-ins for QGIS 2. I adapted them for QGIS 3.

    I’ll tell you more about unrecoverable jambs that prevent the generation of tile maps in QGIS.
    The export is made using the QTiles plugin.

    Jamb №1. When the renderer calculates which objects fall within its scope (in QGIS This is called canvas), it does not take into account the size of the characters of the objects.

    Example 1a Point object


    As you can see, the vertex icon was cut off. On the bottom tile, the renderer made it, but on the top one, not. Because the center of the top did not fall into the boundaries of the tile.

    Example 1b. Linear object

    Thick line passes near the border of the tile. It hit the bottom tile partially. The top tile did not hit at all.

    The line does not have to go along the border of tiles. There may still be such an artifact

    Kosyak number 2. Arrangement of inscriptions.

    Example 2a A short inscription on the linear object

    Renderer derived the name on each tile.

    Example 2b Long inscription on a linear object



    at Z15 inscription is, because it completely breaks the tile border.
    On the Z16, the inscriptions are no longer there, because the long inscription does not fit into the boundaries of the tile.

    Imagine that you want to draw a map of the world, and on it on the entire continent in large letters to write "EURASIA". Nothing will come of it. The inscription will appear only on those zooms where it is placed in the entire tile.

    Example 2c The inscription on the object point

    I turned on the option «Show partial labels»



    at Z16 renderer shows only part of the inscription, to get into the tile. When rendering a neighboring tile, it is over, he forgets about it.

    If the option “Show partial labels” is turned off, then there will be no label on the Z16 at all.

    Two methods are designed to deal with these problems

    . 1. Metataling
    2. Metatatling buffer zones

    Not every tile is rendered individually, but a group of several tiles. Say, 4x4, and then cut into smaller pieces.

    Buffer zones
    An area is rendered larger than a tile or meta file, and then the necessary piece is cut out of it.

    Both methods do not correct the above-mentioned jambs, but shift them by several zoom levels below. The same shoals appear already on the borders of tiles, and on the borders of metatails or buffer zones.

    Example 2d. Point Object
    I do export by plugin QMetaTiles. Metatail size 2x2. This means that the area is rendered in 2x2 tiles, and then cut into pieces.

    Z16 image

    Indeed. The inscription is no longer cut off, because it fits entirely into the 2x2 tile area. But on the border of the metatail, the object itself was clipped. The same will be with the linear object.
    The problem moved one zoom level down.

    Jamb number 3. Jumping labels
    Example 3a
    The aligner each time selects the most advantageous position for the next label. Moreover, the location of the labels depends on the position of the canvas. Move it a couple of millimeters, and all the inscriptions will be completely different.

    This means that when rendering one metatail and the buffer zone around it, the inscription can be in one place, and when rendering the next metatail - completely in another.

    I export a piece of the map into tiles. Inscriptions occupy one order.

    Then I shift the canvas a bit and do the export again. Inscriptions already occupy a completely different order. At the same time, such artifacts appear.

    What to do with it all?

    Metatayling and buffer areas do not solve the problems described above, but push them to lower zoom levels.

    1. When the renderer calculates which objects it should draw, it should take into account not only the geodata of the objects, but their symbolism.

    For example, for all objects, the renderer should store BBOX, which the object occupies after individual rendering. When rendering a scene, you must consider the intersection of the canvas with the individual BBOXs of the rendered objects.

    At the same time, it is desirable that BBOX also contains labels attached to the object.

    2. The location of the labels should not depend on the location of the canvas. Then, with partial export, the inscription fragments will be well sewn. There will be no need for metatailing and buffer zones.

    Unfortunately, at the moment the export of tiles from QGIs is just awful, and when it will be fixed it is not clear.

    Maybe there is someone here taking part in the development of QGis?

    Also popular now: