Skip to content

tiles option leads to rendering artefacts #34

Open
@Klaus-Tockloth

Description

@Klaus-Tockloth

The usage of the tiles option (e.g. --tiles 2) leads to rendering artefacts.

bildschirmfoto 2018-11-27 um 07 10 17

If the aim is to create one large image (e.g. 25000x25000 pixels) the tiles option isn't necessary at all. mapnik has (as far as I know) no size limit. It seems that the problem comes in with the resize function (which seems to be limited [16384?]):

...
    # for layer processing we need to create the Map object
    m = mapnik.Map(100, 100)  # temporary size, will be changed before output
    mapnik.load_map_from_string(m, style_xml.encode("utf-8"), False, style_path)
    m.srs = proj_target.params()
...
    # export image
    m.aspect_fix_mode = mapnik.aspect_fix_mode.GROW_BBOX
    m.resize(size[0], size[1])
    m.zoom_to_box(bbox)

A possible solution to avoid the rendering artefacts (if the aim is to create one large image) is to avoid tiling and resizing.

...
    # for layer processing we need to create the Map object
    m = mapnik.Map(size[0], size[1])
    mapnik.load_map_from_string(m, style_xml.encode("utf-8"), False, style_path)
    m.srs = proj_target.params()
...
    # export image
    m.aspect_fix_mode = mapnik.aspect_fix_mode.GROW_BBOX
    m.zoom_to_box(bbox)
...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions