Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

RenderLineLayer::render() exception due to missing GeometryTile.iconAltas patterns #13691

Closed
timbaker opened this issue Jan 8, 2019 · 4 comments
Labels
bug Core The cross-platform C++ core, aka mbgl

Comments

@timbaker
Copy link

timbaker commented Jan 8, 2019

This bug is reproducible using commit 4a858eb.

This is the an example of a line-layer style causing the issue:

        {
            "type": "line",
            "paint": {
                "line-pattern": [
                    "step", ["zoom"],
                    "line_solid_6",
                    15, "line_double_14",
                    16, "line_double_16"
                ],

The exception occurs in RenderLineLayer::render() due to geometryTile.getPattern() returning empty results sometimes. GeometryTile.iconAtlas does not include the required pattern images.

          optional<ImagePosition> posA = geometryTile.getPattern(linePatternValue.from);
          optional<ImagePosition> posB = geometryTile.getPattern(linePatternValue.to);

GeometryTileWorker::parse() calls RenderLineLayer::createLayout() which creates a new PatternLayout.
The PatternLayout constructor is returning patternDependencies for a certain zoom level (during the layout stage), but rendering may later be performed at a different zoom level requiring different patterns.

The solution seems to be either:

  1. The PatternLayout constructor would need to return the patterns at every zoom level, or
  2. RenderLineLayer::render() would need to evaluate() again at whatever zoom level GeometryTileWorker::parse() used when it created the PatternLayout.

Note: I'm seeing this using a VectorSource. The TilePyramid appears to contain tiles between zoom levels 11-15 when rendering occurs at zoom=15. So the results of a PatternLayout created for zoom=11 being rendered at zoom=15 results in this error.

@timbaker
Copy link
Author

Here is a style.json, xxx.geojson and sprites/ folder to demonstrate the bug.
I've tested it using mbgl-qt.exe from the Qt SDK. The map data is near lat=-0.05 long=0.05.
There's a maki symbol there, if you zoom out you should see it.

Zooming in/out and scrolling around near zoom=15 should cause exceptions in RenderLineLayer::render().

line-pattern-bug.zip

@brunoabinader brunoabinader added Core The cross-platform C++ core, aka mbgl bug labels Jan 18, 2019
@brunoabinader
Copy link
Member

@timbaker I couldn't reproduce the issue using the latest master (b83030a). Given the initial commit you've suggested, I suppose this has been fixed in #13535 (/cc @ChrisLoer). Could you please verify using the latest master?

@timbaker
Copy link
Author

I get the same error after updating. I think the change made for SymbolBucket here #13667 needs to be done for LineBucket also.

@kkaefer
Copy link
Contributor

kkaefer commented Mar 27, 2019

Fixed in #14230

@kkaefer kkaefer closed this as completed Mar 27, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Core The cross-platform C++ core, aka mbgl
Projects
None yet
Development

No branches or pull requests

3 participants