Skip to content
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

Show administrative boundary text labels from z11 to z16 based on admin_level #3677

Merged
merged 1 commit into from
Feb 15, 2019

Conversation

jeisenbe
Copy link
Collaborator

@jeisenbe jeisenbe commented Feb 7, 2019

Related to #622
Also see #3649

Changes proposed in this pull request:

  • Render admin_level 1 to 4 text labels along the admin boundary lines from z11
  • Redner admin_level 5 to 8 text labels along the border lines from z12 to z15 based on admin_level (5 at z12, 6 and z13, 7 at z14, 8 at z15), and admin_level 9 and 10 will continue to render at z16 and higher.
  • Add a minimum way_pixels limit for admin 1 to 4 which are the same as largest central text label rendering. Thus the text labels will appear along the border lines when the total area is greater than 360,000 pixels for admin_level 1 and 2, and 196,000 way_pixels for admin_level 3 and 4. The limit is 48,000 way_pixels for higher admin_level, which have no other text labels.
  • Remove unnecessary admin_level IN ('0', from query, as this level is not used.

Explanation:

  • Border text labels are currently only shown along the administrative boundaries at z16 and higher. However, protected_areas such as National Parks, and aboriginal lands, have these text labels from z13.
  • It can be difficult to tell the admin_level of a border from the pattern, even for people with some experience with OSM, without the name of the area
  • The French style shows these text labels along the borders at z11 for admin levels 1 to 4, at z13 for levels 5 and 6, and at z15 for the others.
  • Showing these text labels will make it possible to recognize the borders sooner. This is particularly helpful for admin level 5 to 8, which do not have any label at their center, and which can take up quite large areas on the map in many countries.
  • Adding filtering by way_pixels will help prevent displaying the text labels on very small areas. (This is often found with admin_level 8 to 10 in some Asian countries, such as Japan and Indonesia). The limit is 48,000, or one zoom level sooner than the admin_level 4 border labels will be displayed for small areas. This is equivalent to 200 by 240 pixels or 100 by 480 pixels on-screen, that is, 5% to 10% of a typical window size.

Test renderings with links to the current rendering:

Dili, East Timor, z11
Here we see one admin_level=4 with a central label (because it is less than 196000 way_pixels in area), while the others have no central label, but now do have labels along the border (>196k way_pixels)
https://www.openstreetmap.org/#map=11/-8.6666/125.6661
provinces-dili-11 -8 6666 125 6661

Oecusse, Enclave of East Timor in Indonesia, z11
https://www.openstreetmap.org/#map=z11/-9.3115/124.2749
oecusse-z-11 -9 3115 124 2749

Andorra, z11
No border labels are displayed at z11, because the admin_level=2 area is <360000 pixels
https://www.openstreetmap.org/#map=11/42.5096/1.5346
z11-andorra-after

Ashgabat, Turkmenistan, z11
https://www.openstreetmap.org/#map=11/37.9504/58.1925
ashgabat-11 37 9504 58 1925-after

Port Moresby, Papua New Guinea, z11
https://www.openstreetmap.org/#map=11/-9.5168/147.2635
port-moresby-11 -9 5168 147 2635

Port Moresby, z12
port-moresby-12 -9 4386 147 2552

Liechtenstein, z13
https://www.openstreetmap.org/#map=13/47.2027/9.5424
oberland-unterland-z-13 47 2027 9 5424

Yogyakarta, Indonesia, z14
z14-yogyakarta-after-40k

Koutio, New Caledonia, z15
https://www.openstreetmap.org/#map=15/-22.2183/166.4791
koutio-new-caledonia-15 -22 2183 166 4791-after

… z11 to z16

Add way_pixels limits for admin 1 to 4 same as largest central text label rendering, at 48,000 way_pixels for higher admin_level which have no other text labels
@jeisenbe
Copy link
Collaborator Author

jeisenbe commented Feb 7, 2019

Note that some of the test images above were made with the 2x2 tile metatiles, rather than with the 8x8 metatiles used for production, hence some of the labels are repeated more often than they should.

For review, I'd recommend setting metatile: 8 in the local config

@jeisenbe
Copy link
Collaborator Author

jeisenbe commented Feb 9, 2019

These test images show why the way_pixel minimum is needed. The current rendering attempts to place labels even on very small polygons. In urban areas many of these labels will be blocked by the presence of residential road name labels at z16 and z17

(In Indonesia, the admin_level=9 and =10 levels are usually "RW #" and "RT #" respectively)

Jakarta, Indonesia
https://www.openstreetmap.org/#map=17/-6.11420/106.91999
z17 current - very busy, although many of the admin_level=10 "RT #" labels are not rendered due to collisions with other labels
z17-jakarta-violet-borders
z17 After - only the admin_level=8 and 9 text labels are shown; the admin_level=10 areas are all very small
z17-jakarta-border-labels-zoom-17 -6 11420 106 91999

z18 current - now most of the "RT" level labels are shown, but it's too busy
z18-jakarta-violet-borders
z18 After - only the admin_level=9 and lower labels are shown
z18-jakarta-border-labels-zoom-18 -6 11457 106 91949

z19 current
z19-jakarta-violet-borders
z19 After
z19-jakarta-border-label-zoom-19 -6 11396 106 91833

View with inspector, z16:

z16 after

@matthijsmelissen
Copy link
Collaborator

See also #3101, we probably want to solve this as well.

@jeisenbe
Copy link
Collaborator Author

jeisenbe commented Feb 12, 2019 via email

@matthijsmelissen matthijsmelissen merged commit 6ecdb84 into gravitystorm:master Feb 15, 2019
@matthijsmelissen
Copy link
Collaborator

Thanks, good job!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants