basemaps icon indicating copy to clipboard operation
basemaps copied to clipboard

Too large font for places_region

Open Edefritz opened this issue 2 years ago • 10 comments

Description As far as I understand, the places_region layer renders names of states/regions. While this works well for US states, it creates comparatively huge labels for regions in other parts of the world. The region labels are larger than the country labels and somehow make the map appear cluttered.

I think this is both, a data and a style "issue".

There also seems to be a bug as US state labels seem to disappear after z7 but the state labels in other parts of the world remain rendered: https://maps.protomaps.com/#map=7.52/42.67/-107.473&theme=light&renderer=maplibregl&tiles=https://build.protomaps.com/20231120.pmtiles https://maps.protomaps.com/#map=9.64/52.7965/13.1533&theme=light&renderer=maplibregl&tiles=https://build.protomaps.com/20231120.pmtiles

@nvkelso left a comment writing that eventually the source for this layer should transition to Natural Earth data anyway. But in the meantime I would suggest to reduce the font size so the map remains

Location Looks ok: https://maps.protomaps.com/#map=5.28/37.241/-83.096&theme=light&renderer=maplibregl&tiles=https://build.protomaps.com/20231120.pmtiles Not so much: https://maps.protomaps.com/#map=5.28/52.416/12.78&theme=light&renderer=maplibregl&tiles=https://build.protomaps.com/20231120.pmtiles

Screenshots Screenshot 2023-11-17 at 15 04 17

Screenshot 2023-11-17 at 14 55 22

I'm not sure how to best address this. I feel changing the style to something like this already looks much tidier:

    {
      id: "places_region",
      type: "symbol",
      source: source,
      "source-layer": "places",
      filter: ["==", "pmap:kind", "region"],
      layout: {
        "symbol-sort-key": ["get", "pmap:min_zoom"],
        "text-field": [
          "step",
          ["zoom"],
          ["get", "name:short"],
          6, // only show full name from zoom 6
          ["get", "name"],
        ],
        "text-font": ["Noto Sans Regular"],
        "text-size": ["interpolate", ["linear"], ["zoom"], 3, 11, 7, 16], // max font size for labels capped at 16
        "text-radial-offset": 0.2,
        "text-anchor": "center",
        "text-transform": "uppercase",
      },
      paint: {
        "text-color": t.state_label,
        "text-halo-color": t.state_label_halo,
        "text-halo-width": 2,
      },
    },

Admittedly, this whole issue might be more of a personal preference thingy :)

Edefritz avatar Nov 17 '23 14:11 Edefritz

Thanks for the detailed report and suggested change - FYI the build server now only keeps the last week of daily builds and then every Monday build only. I edited your links to point to a Monday build. Agree that changing the font size here would be an improvement - I'm fine with changing it globally, though do we forsee any need for "grading" the sizes differently for only US, Australia ("big regions") ? @nvkelso

bdon avatar Nov 28 '23 03:11 bdon

Uff, those labels are huge (and shouldn't be). Let's fix that! I'm fine with a simple style text size adjustment now, can you PR this?

The US labels are dropping out because we're using the Natural Earth max zoom property to cull them from tiles and the philosophy is to show them for a few zooms then remove them. But you're right they should still remain a few more zooms. We can override that in the Protomaps basemap ETL until Natural Earth updates.

For the Poland labels in your 2nd screenshot we should do a better job reducing the string length by removing the placetype text (Województwo), too. That's will be a separate data ETL logic change than the style.

To @bdon's comment, some states are larger than others (though generally it's better to treat all states in the same country at the same ranking so labeling is more consistent, even if Rhode Island is a lot smaller than New York). Natural Earth doesn't currently indicate an "area rank" (or list the area in square meters) in the admin-1-states-provinces theme, but I might consider that in the next version. The min_zoom is supposed to capture some of this already. I wonder if the style can be extended to make use of the feature's min_zoom when setting the text sizes? Or we call it good with the smaller text sizes overall combined with sometimes showing a country's admin-1 state labels a zoom or two later?

nvkelso avatar Nov 28 '23 06:11 nvkelso

Cantons in Switzerland have a larger text size than the country label:

image

https://maps.protomaps.com/#map=7.81/46.809/8.478&theme=light&renderer=maplibregl&tiles=https://build.protomaps.com/20231130.pmtiles

wipfli avatar Nov 30 '23 15:11 wipfli

I think it would actually be best to turn off Kanton labels in Switzerland, and the same for German Bundesländer. The units are just too small here in Europe and we don't have enough space on the map for meaningful label placement for both sub-national states and city labels...

wipfli avatar Dec 12 '23 15:12 wipfli

Brings me to another question: Can we have some country / sub-country specific logic?

wipfli avatar Dec 12 '23 15:12 wipfli

Country / sub-country specific logic is blocked on https://github.com/protomaps/basemaps/issues/44.

In the meantime we can improve the data joins between Natural Earth, OSM, and Wikidata, and change how the min_zoom ranges are curated per country.

nvkelso avatar Dec 12 '23 18:12 nvkelso

Uff, those labels are huge (and shouldn't be). Let's fix that! I'm fine with a simple style text size adjustment now, can you PR this?

Sorry about the late response. Here are my proposed changes for the mean time: https://github.com/protomaps/basemaps/pull/192

This is also the style we're currently using in production and I think the results are pretty good in comparison. But as already mentioned above, this is just a work around until the issues can be resolved more consistently on a data level.

Edefritz avatar Dec 19 '23 10:12 Edefritz

Thanks for the patch, let's keep this open until we can address locale specific logic

bdon avatar Dec 27 '23 13:12 bdon

Here's the result of one of the visual tests that this change effects (looks better now):

https://maps.protomaps.com/visualtests/?name=world

bdon avatar Jan 02 '24 02:01 bdon

For visual consistency I think place=state should only be included for the largest few countries. According to Wikipedia, the list of countries by area is

image

Probably one should use the area value in the projection used for display, i.e., web-mercator. Kazakhstan for example is only 16 percent larger than DRC, but looks like twice as large in a MapLibre map...

wipfli avatar May 04 '24 06:05 wipfli