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

Random rendered features have mismatched properties #5182

Closed

Description

@1ec5

Random features returned by mbgl::Map::queryRenderedFeatures() have mismatched or missing properties.

When the current style is Mapbox Streets (which uses Mapbox Streets source), calling mbgl::Map::queryRenderedFeatures() with the location of this OSM node at z14 returns a point feature in which the scalerank and type are conflated. Here’s the output from MGLPointFeature.attributes:

{
    ldir = E;
    localrank = 1;
    name = Loveland;
    "name_de" = Loveland;
    "name_en" = Loveland;
    "name_es" = Loveland;
    "name_fr" = Loveland;
    "name_ru" = "\U041b\U0430\U0432\U043b\U0435\U043d\U0434";
    "name_zh" = "\U6d1b\U5f17\U5170\U5fb7";
    scalerank = town;
}

In GL JS v0.18.0, queryRenderedFeatures() doesn’t mismatch any tags, but scalerank is nowhere to be seen:

{
  ldir: "E",
  localrank: 1,
  name: "Loveland",
  name_de: "Loveland",
  name_en: "Loveland",
  name_es: "Loveland",
  name_fr: "Loveland",
  name_ru: "Лавленд",
  name_zh: "洛弗兰德",
  type: "town"
}

Querying rendered features at 39°5′43″ north, 84°31′20″ west (in the 13/2172/3128 tile) yields several features in which the layer, oneway, structure, and type properties are all off by one:

{
    class = motorway;
    layer = true;
    oneway = bridge;
    structure = motorway;
    type = 2;
}

Compare with GL JS:

{
  class: "motorway",
  layer: 2,
  oneway: "true",
  structure: "bridge",
  type: "motorway"
}

/cc @jfirebaugh

Activity

  1. added
    Core
    on May 29, 2016
  2. 1ec5 commented on May 29, 2016

    @1ec5
    ContributorAuthor

    This issue affects all the features in an affected tile, except for rendered symbol features, which appear to be stored in a separate tree.

    Here’s VectorTileLayer::keysMap for the place_label tile layer in the first example above:

    keysMap = size=11 {
      [0] = (first = "ldir", second = 0)
      [1] = (first = "localrank", second = 1)
      [2] = (first = "name", second = 2)
      [3] = (first = "name_de", second = 3)
      [4] = (first = "name_en", second = 4)
      [5] = (first = "name_es", second = 5)
      [6] = (first = "name_fr", second = 6)
      [7] = (first = "name_ru", second = 7)
      [8] = (first = "name_zh", second = 8)
      [9] = (first = "scalerank", second = 10)
      [10] = (first = "type", second = 9)
    }
    
  3. added a commit that references this issue on May 29, 2016
    39cc747
  4. 1ec5 commented on May 31, 2016

    @1ec5
    ContributorAuthor

    I’m still not sure what’s going on w/ the scalerank key. I’d expect it to be present in the tiles, and this bug uncovered its existence, but the value is missing from both GL JS’s parsed tags and mbgl’s parsed tags with the fix in #5183.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Corebug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions