New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add state labels at low zoom levels #969
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Results evaluating commit 5721a87 (merged with base a4671b8 as 681a6fc). See run details. PostgreSQL DB size in MB: 2665 ⇒ 2666 (0.0% change)
expand for details...
|
TomPohys
approved these changes
Sep 2, 2020
@jsanz thanks, it looks amazing. |
TomPohys
added a commit
to openmaptiles/osm-bright-gl-style
that referenced
this pull request
Sep 2, 2020
Split state labels out into new layer This PR complements the [open PR in OpenMapTiles](openmaptiles/openmaptiles#969) to increase the number of state labels rendered at low zoom levels. In this style in particular the state labels are part of the `place-other` layer. I included `state` in the filter, and duplicated the layer definition up in the list to give them more relevancy, between country and city layers. The rest of the definition is the same, so no visual distinction between state labels and small features below the city level.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #953
Motivation
If we check Bright, Positron, or Dark styles, they all show a huge lack of data about states and regions. At zoom 2, for big countries like Canada, Brazil, China or Australia there are big patches of white space (aka cartographer's horror vacui 😅)
At zoom 3 state labels start appearing, along with relevant cities. It's arguable if cities provide more geospatial context to readers than state names (I would prefer states over cities, though), but that would be a discussion for the styles repositories. My concern is that the current pipeline, at low zoom levels (2 to 5) gives too few labels. Compare US versus Oceania:
Data pipeline
A quick check to OSM data returns there are around 1700 nodes with
place=state
. That's the main condition to generate theosm_state_point
table in theplace
layer.There's later an update on that table that augments the dataset with ranking information coming from the Natural Earth regions dataset, removing all points that are not considered important. This currently leaves around 200 labels in this table.
BTW, there are around 5000 regions in the world, and they change every year. In fact, Natural Earth dataset is quite outdated. At Elastic, we've been improving it fo our own users, fixing around a hundred countries' data. You can learn about the work we did on these slides from a presentation @nickpeihl did recently.
Tile processing
With the data stored in
osm_state_point
, the SQL layer function controls which data is delivered to final users per zoom level. ThisWHERE
condition leaves for zoom 3 only state labels ranked as1
. For example, Australia states are ranked as 3 so they need to wait to zoom level 5.Proposal
The current proposal is to remove the rank filtering of the data on the table and leave to styles to decide if they want to render state labels from zoom 2. I feel we would also want to increase the quality of the ranking data to provide even more data, but I leave that outside of the scope of this change.
The change in the final planet
mbtiles
file size for this change in the layer function is minimal as discussed at #953, but will also need accompanying changes in styles that render data from this table to adjust the amount of information they want to show at low zoom levels. I'm opening a PR also to theOSM Bright
style to adapt it to this change.Some screenshots of the default situation with a raw style
After applying the proposal, at zoom level 2 will show the ~200 label points.
I understand the spread of labels is quite odd, and maybe we can work more on this PR to help including more labels. Maybe we can include again the country filter, to just get labels for the big countries of the world were states are large enough to need representation, in comparison for example with European countries where equivalent hierarchy boundaries are way smaller. Maybe that criteria can be something parametrizable using Natural Earth augmented data like area or population.
Please let me know what you think.