~/notes/openfreemap-building-ids-repeat

Vector-tile building ids are not unique

Highlighting "the same building" by id lit up neighbours across the street. Filter by distance as well.

· 1 min read · written in English

On this site's /earth page, clicking a building highlights it. Highlighting every feature with the same id from the building layer also lit up unrelated buildings nearby: ids in the tiles are not unique across tiles or even within one.

What worked:

  1. queryRenderedFeatures(point, { layers: ['bld'] }) at the click.
  2. Take the centroid of the picked piece.
  3. Collect pieces with the same id and within ~60 m of that centroid.