Skip to content

Cull features from places layer based on grid #1999

@nvkelso

Description

@nvkelso
  • What did you see? There are a ton of locality points in the places layer starting at zoom 8 when they come in from OSM until around zoom 13. We source those from OSM and they have kind_detail values (eg city, town, village) which we map to min_zoom, and most have population values. But there are sometimes hundreds when just a handful can end up being labeled. We can't select by population ranked via zoom because that would leave the more rural areas of the map looking empty. So instead we need to cull features based on a grid that roughly matches how many features we could actually label in a given tile.
  • What did you expect to see? A smaller number of features based on visual layout of what can be labeled. At zoom 8 this might be ~12 features total (for visual layout reasons not just tile size reasons), then zoom 9 to 24 features, zoom 10+ to 36 features? And by zoom 13 no more culling? Maybe this is accomplished with different grid cell sizes at different zooms, too?
  • What map location are you having problems with? Tile 8/227/100 in 256px coordinates
  • Screenshot? This tile from OSM.org shows Tokyo, which has tons of locality points at that zoom.
    image

That same area via Overpass Turbo:

image

Helpful queries:

/*
This has been generated by the overpass-turbo wizard.
The original search was:
“place=town and population=*”
*/
[out:json][timeout:250];
// gather results
(
  // query part for: “place=town and population=*”
  node["place"="city"]({{bbox}});
  way["place"="city"]({{bbox}});
  relation["place"="city"]({{bbox}});
  node["place"="town"]({{bbox}});
  way["place"="town"]({{bbox}});
  relation["place"="town"]({{bbox}});
);
// print results
out body;
>;
out skel qt;



/*
This has been generated by the overpass-turbo wizard.
The original search was:
“place=town and population=*”
[out:json][timeout:250];
// gather results
(
  // query part for: “place=town and population=*”
  node["place"="city"]["population"](if:t["population"]<5000)({{bbox}});
  way["place"="city"]["population"](if:t["population"]<5000)({{bbox}});
  relation["place"="city"]["population"](if:t["population"]<5000)({{bbox}});
  node["place"="town"]["population"](if:t["population"]<5000)({{bbox}});
  way["place"="town"]["population"](if:t["population"]<5000)({{bbox}});
  relation["place"="town"]["population"](if:t["population"]<5000)({{bbox}});
);
// print results
out body;
>;
out skel qt;
*/

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions