OpenHistoricalMap / issues

File your issues here, regardless of repo until we get all our repos squared away; we don't want to miss anything.
Creative Commons Zero v1.0 Universal
19 stars 1 forks source link

Color-code countries at low zoom levels #700

Open 1ec5 opened 8 months ago

1ec5 commented 8 months ago

In OSM World Discord, a mapper suggested shading each administrative area in a different color from its neighbors, as one typically finds on a political map or general-purpose map that isn’t heavily transportation-centric. A choropleth would be useful because the user won’t necessarily be familiar enough with the historic boundaries in a given area to orient themselves like they would using present-day boundaries.

The good news is that the vector tiles already represent boundaries as polygons. The bad news is that the polygons contribute to performance issues and probably need to be eliminated at some zoom levels: #701. But at high zoom levels where we only show countries, we can probably still get away with simplified boundary polygons.

The bad news is that we’ll have to determine the color that each country should be filled with. For a map that depicts a single point in time, the four color theorem guarantees that no two adjacent areas share the same color. We probably have access to tools to calculate the four-color-theorem colors when generating the tiles. However, our tiles use a single feature to represent a boundary over time. Even if a boundary doesn’t change, its neighbors can change. I’m not sure that the four color theorem is proven for the more general case.

vknoppkewetzel commented 8 months ago

I personally do not think we should implement a 4 color country fill at low zooms (or low-zoom) in the current "main" style, although I can see that being useful as a separate style

The case to not do it

I do not think the 4 color theorem would specifically help a user identify different countries at low zooms - if that is the goal, I think there are other ways to support a user identifying and differenting countries at low-zooms.

At low zooms (on an unknown screen size (map extent available), with dynamic styling rather than highly customized styling*), I have trouble seeing how the 4 color theorem would be more helpful than country borders image

In the "super low" zoom above, I see country borders and can differentiate them. I mostly at this low zoom can't differentiate some countries in terms of "what they are"since not all labels show up (a product of standard dynamic zoom level styling to help with legibility and not having too many things stack, as we know of course).

zoom in to z5, still low zoom: image image

In an interactive map, we always have the labeling coming in and out as some countries are biggers than others as noted above, but I still see country boundaries differentiating here.

I think if it is a priority to differentaite even further for a user to immediately identify countries at low zooms we can:

IMO, doing a 4 color country coloration wouldn't remove the issue of people knowing what country specifically is at lower zooms, largely due to the fact that color or existing boundary will show polygons, but they still won't see all the labels at once at low zooms.

If we do it

If we do a four color map to differentiate country polygons, I agree, finding the right colors matters, but I also think only doing them at low zooms wouldn't make sense for a user. If I want to differentiate countries at z5 and am "used to" doing so as a means to determine different countries...: image

... I will also want it at z9/mid level zooms where I still see country borders. And design-wise, it is better to have the cognitive reinforcement of an aid across zoom levels. I think it would be okay to fade out at high zooms. z9/mid level zoom: image

It would be disorienting if it is an aid, to stop it after low zooms and not have it in mid-zooms.

In order to ensure users don't feel disoriented / don't use a visual cognitive aid at mid-level zooms, it would mean doing a bit of redesign across the map , across many data layers that would be affected.

If that seems like the path forward, I think that can be done, we just would be moving away from this main design.

Alternatively, this could be an intentional separate style that is more "reference map focused", maybe a good use of a "political map style" maybe? Then we don't need to be considering all-the-data like in main, but rather, just relevant poltiical info - boundaries, place labels, plus major natural features (ex: mountains/bigger rivers) ex: image

1ec5 commented 8 months ago

I agree that a separate political map style would have more room to use fill colors for this purpose. I assume the main benefit would be not so much to identify countries by their shapes, but rather to associate the parts of a country – think possessions and that sort of thing. Or to take a more local example, most painted playground maps color the Upper and Lower peninsulas of Michigan in the same color. Proponents of D.C. statehood would be miffed to learn that the U.P. beat them to statehood. 😄

Anyhow, I’m not even sure this idea is mathematically feasible.

Bauer33333 commented 8 months ago

The bad news is that we’ll have to determine the color that each country should be filled with. For a map that depicts a single point in time, the four color theorem guarantees that no two adjacent areas share the same color. We probably have access to tools to calculate the four-color-theorem colors when generating the tiles.

The four color theorem does not apply to countries with exclaves, and those are the ones where I see how coloring could come handy. Especially on areas/times like the Holy Roman Empire of German Nation, but there even humans creating a map run into issues assigning the colors.

If there is a separate political map style it could switch between admin levels when zooming, so you get states and municipalities as well.

vknoppkewetzel commented 8 months ago

Or to take a more local example, most painted playground maps color the Upper and Lower peninsulas of Michigan in the same color. Proponents of D.C. statehood would be miffed to learn that the U.P. beat them to statehood. 😄'

I am from WI -I am confused. they should be the same color! I do know many people forget that UP is part of Michigan though haah. I attribute it to people not paying attention to the midwest :(

I like correcting people with the Michigan mitten visual and reminding them that Michigan is actually like one mitten and then the other mitten has to be a flat hand like "rock paper scissors' - paper hand gesture. "mitten + paper" haha.

RIP DC statehood 😢 someday we will get it.... 🤞

vknoppkewetzel commented 8 months ago

If there is a separate political map style it could switch between admin levels when zooming, so you get states and municipalities as well.

a great idea!

jeffreyameyer commented 8 months ago

Not sure if these are helpful, but here are some examples from the OSM ecosystem of colorized countries:

In the past, TileMill had a geography class set of styles that created some nice effects: https://blog.mapbox.com/learn-cartocss-and-compositing-by-customizing-geography-class-671af2c6550b image

Much more recently, these guys have a very cool demo... https://maplibre.org/

Monosnap MapLibre | MapLibre 2024-02-29 10-48-45
sookoll commented 1 month ago

I face similar situation where I need to color historical administrative areas. As I understand there is only land_ohm_centroids and land_ohm_lines source layers, it is currently impossible with style modification only?

1ec5 commented 1 month ago

Do you mean with a MapLibre or Mapbox style that uses the main tileset? If I’m not mistaken, the land_ohm_lines layer used to contain polygons, which were ideal for highlighting a specific country but not for color-coding countries according to the four-color theorem. In https://github.com/OpenHistoricalMap/issues/issues/701#issuecomment-2122871448, we replaced those polygons with closed lines, anticipating that these lines would eventually be split up and deduplicated for performance reasons: #800.

This probably does mean simply styling the existing tiles won’t work for you. Fortunately, you can still get the geometry as a polygon in order to include it on your map (or to use for any other purpose). For example, you can use Overpass turbo to query for the relation by its ID and export a GeoJSON or load the data into QGIS.

sookoll commented 1 month ago

@1ec5 yes this is what I meant. I use Openlayers, but this is irrelevant. I still need to display OHM layer with specific date, as client start adding additional data into OHM. But as I can't restyle countries as polygons, we need to rethink how to solve our requirements.

1ec5 commented 1 month ago

If you’re OK with sharing more details about your project on our forum, folks there could offer some advice or point you in the right direction.

vknoppkewetzel commented 1 month ago

@sookoll 👋 I checked the forum in case you had written anything there yet. There has a bit of changes in the data this year to support improved performance and speed (and it is a lot snappier) but I see where you are coming from.

Do you think styling based on the country name's color or country name's halo color changing is worth pursuing? land_ohm_centroids + place_points (if any labels are in there) could be used in that way since the dates are also associated with the lines.

image