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

Render administrative boundary text labels for relations only #3762

Merged
merged 2 commits into from
Jun 11, 2019

Conversation

jeisenbe
Copy link
Collaborator

@jeisenbe jeisenbe commented Apr 24, 2019

Fixes #3761 and Fixes #2663

Changes proposed in this pull request:

  • Render text labels along borders of admin boundary relations only, not from closed ways
  • Render name labels for country and province/state from relations only, not from closed ways

Explanation:

  • Currently the border lines are only rendered for borders mapped as relations (with osm_id < 0)
  • But the text labels along the borders are rendered for both relations and closed ways, in the case when the closed way is also tagged with a key that is imported as a polygon, such as place=island or landuse=residential.
  • This commit adds a filter for "AND osm_id < 0" to the admin-text layer, so that the text labels do not appear in the rare occasions when an administrative boundary is mapped as a closed way instead of a relation

Test renderings:

Keaukaha Hawaiian Homeland, Hawaii USA

https://www.openstreetmap.org/way/146660105/

  • closed way tagged landuse=residential + boundary=administrative + admin_level=5
    z16 Before
    z16-keaukaha-closed-way-residential
    After
    z16-keaukaha-after

Ilheus Das Cabras, Azores, Portugal

https://www.openstreetmap.org/way/157531901/

  • closed ways tagged natural=coastline+ place=islet + name=Ilheus das Cabras + boundary=administrative + admin_level=4 (the administrative boundary of the Azores province follows the coastline)
  • This renders as if Ilheas das Cabras were the name of a province! The real province name also renders properly from a relation with type=boundary which has this way as a member.
    z16 Before
    z16-ilheus-das-cabras-before
    After
    z16-ilheu-das-cabras-after

z18 Before
z18-ilheus-das-cabras-before
After
z18-ilheus-das-cabras-after

Currently lines are only rendered for borders mapped as relations (i.e. osm_id <0) but the text labels along the borders are rendered for relations and closed ways. This commit adds a filter for "AND osm_id < 0" to the admin-text layer, so that the text labels do not appear in the rare occasions when an administrative boundary is mapped as a closed way instead of a relation
@jeisenbe
Copy link
Collaborator Author

jeisenbe commented May 5, 2019

Is anyone available to review this PR?

I would like to submit other improvements to the administrative boundaries, but I can't until this one is merged.

Copy link
Collaborator

@imagico imagico left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Also fixes #2663.

@matkoniecz
Copy link
Contributor

matkoniecz commented Jun 10, 2019

It also turns #713 into a declined request.

I edited top post to fix https://www.openstreetmap.org/way/146660105/ link

@imagico imagico merged commit 96c64fa into gravitystorm:master Jun 11, 2019
@imagico
Copy link
Collaborator

imagico commented Jun 11, 2019

Just noticed this had not been merged yet, sorry for the delay.

@jeisenbe jeisenbe deleted the admin-text-relations-only branch June 13, 2019 02:33
sommerluk pushed a commit to sommerluk/openstreetmap-carto that referenced this pull request Aug 5, 2019
…ystorm#3762)

* Render text labels along borders of admin boundary relations only

Currently lines are only rendered for borders mapped as relations (i.e. osm_id <0) but the text labels along the borders are rendered for relations and closed ways. This commit adds a filter for "AND osm_id < 0" to the admin-text layer, so that the text labels do not appear in the rare occasions when an administrative boundary is mapped as a closed way instead of a relation

* Render central name labels for country and province/state relations only
sommerluk pushed a commit to sommerluk/openstreetmap-carto that referenced this pull request Aug 5, 2019
…ystorm#3762)

* Render text labels along borders of admin boundary relations only

Currently lines are only rendered for borders mapped as relations (i.e. osm_id <0) but the text labels along the borders are rendered for relations and closed ways. This commit adds a filter for "AND osm_id < 0" to the admin-text layer, so that the text labels do not appear in the rare occasions when an administrative boundary is mapped as a closed way instead of a relation

* Render central name labels for country and province/state relations only
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants