Skip to content

Country labels silently fall back to default zooms when the Wikidata join fails #633

Description

@ringsaturn

Location

https://xue.ringsaturn.me/?model=gfs&type=precip#map=1.65/28/128

Screenshots

Image Image

Required information

  • Browser: Safari&Chrome
  • Renderer version: MapLibre GL JS 5.24.0
  • Tileset version and source: hosted Protomaps API, v4
  • Style JSON or NPM version

The basemap generator uses the OSM wikidata tag to join place features with the curated zoom configuration in places.csv.

When a place=country feature temporarily loses its wikidata tag, Places.getZoomsPops() silently skips the curated configuration and retains the default zoom values. This can remove major country labels from low-zoom tiles without producing a visible build error or warning.

This occurred in an OSM data incident affecting five country nodes. The missing tags have since been restored upstream, but the currently hosted Protomaps v4 tiles still demonstrate the failure mode.

The current code only applies a curated configuration when the feature contains a matching Wikidata ID:

private ZoomsPops getZoomsPops(Matcher.SourceFeatureWithComputedTags sf2, String kind, int population) {
var zoomMatches = zoomsIndex.getMatches(sf2);
int minZoom = getInteger(sf2, zoomMatches, "pm:minzoom", 99);
int maxZoom = getInteger(sf2, zoomMatches, "pm:maxzoom", 99);
int kindRank = getInteger(sf2, zoomMatches, "pm:kindRank", 99);
int populationRank = 0;
for (int i = 0; i < popBreaks.length; i++) {
if (population >= popBreaks[i]) {
populationRank = i + 1;
}
}
if (WIKIDATA_CONFIGS.containsKey(sf2.getString("wikidata"))) {
var wikidataConfig = WIKIDATA_CONFIGS.get(sf2.getString("wikidata"));
if (kind.equals("country") || kind.equals("region")) {
minZoom = wikidataConfig.minZoom();
maxZoom = wikidataConfig.maxZoom();
}
if (kind.equals("locality")) {
minZoom = wikidataConfig.minZoom();
populationRank = wikidataConfig.rankMax();
}
}
return new ZoomsPops(minZoom, maxZoom, kindRank, populationRank);

China has this entry in places.csv:

Q148,1,5,-1

However, in the currently hosted v4 tiles:

  • China is absent from the places layer in the relevant z1 tile.
  • The China feature in tile z5/25/12 has kind=country.
  • It has min_zoom=6.
  • It has no wikidata property.

The feature therefore behaves as if the curated Q148 entry did not exist.

List of affected counties:

Country OSM node Wikidata ID Curated zoom range
China 424313582 Q148 z1-z5
Bangladesh 432424937 Q902 z2-z7
Bhutan 424311028 Q917 z3-z8
United Arab Emirates 424310703 Q878 z3-z8
South Africa 424298167 Q258 z1-z6

Upstream status:

The OSM community investigated the incident here:

https://community.openstreetmap.org/t/146752

The five missing Wikidata tags were restored on 2026-08-24:

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions