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

Adding rendering for place=quarter #3223

Merged
merged 1 commit into from
May 14, 2018
Merged

Conversation

kocio-pl
Copy link
Collaborator

@kocio-pl kocio-pl commented May 7, 2018

Fixes #798

Changes proposed in this pull request:

  • adding rendering for place=quarter as a name label on z14-z16

Rendering test:

  • Example place (Sielce), compared to place=suburb (Mokotów) and place=neighbourhood (Marcelin):

z14
ochpaaw9

z15
qu2ttl37

z16
tlqypxz0

@kocio-pl
Copy link
Collaborator Author

kocio-pl commented May 8, 2018

Another example (Osse) - this time together with a village (Gąsówka-Osse) and a hamlet (Buczycha):

z14
ixw1jrcg

z15
muogkvfl

z16 (click to see the full size)
7fhhskn4

placenames.mss Outdated
[zoom >= 14] {
text-halo-fill: white;
text-size: 11;
text-wrap-width: 65; // 5.0 em
Copy link
Collaborator

Choose a reason for hiding this comment

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

em can be interpreted a short-hand for the current text-size, which is here 11. So:

  • If text-wrap-width: 65 is what you want, than you have 65 ÷ (11 em⁻¹) ≈ 5.9 em for the comment.
  • If // 5.0 em is what you want, than you have 5.0 em × 11 em⁻¹ = 55 for the “text‑wrap‑width” value.

I would always recommend to start by defining the em values in the comments, and than simply calculate the real values.

placenames.mss Outdated
text-halo-fill: white;
text-size: 11;
text-wrap-width: 65; // 5.0 em
text-line-spacing: -0.65; // -0.05 em
Copy link
Collaborator

@sommerluk sommerluk May 10, 2018

Choose a reason for hiding this comment

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

Indeed, // -0.05 em is reasonable for a text‑wrap‑width of 5.0 em. The absolute value is than −0.05 em × 11 em⁻¹ = −0.55

placenames.mss Outdated
text-size: 11;
text-wrap-width: 65; // 5.0 em
text-line-spacing: -0.65; // -0.05 em
text-margin: 9.1; // 0.7 em
Copy link
Collaborator

Choose a reason for hiding this comment

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

// -0.7 em is good. The absolute value is than 0.7 em × 11 em⁻¹ = 7.7

placenames.mss Outdated
text-margin: 9.8; // 0.7 em
}
[zoom >= 16] {
text-size: 14;
Copy link
Collaborator

Choose a reason for hiding this comment

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

With the em value as starting point, the following text-wrap-width, text-line-spacing and text-margin absolute values would have to be recalculated for 14 em⁻¹.

placenames.mss Outdated
}
[zoom >= 15] {
text-fill: @placenames-light;
text-size: 12;
Copy link
Collaborator

Choose a reason for hiding this comment

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

With the em value as starting point, the following text-wrap-width, text-line-spacing and text-margin absolute values would have to be recalculated for 12 em⁻¹.

@kocio-pl
Copy link
Collaborator Author

@sommerluk Thanks for spotting, this was just a brute force copy-paste with some general tuning. I will update it.

BTW: If you think https://github.com/gravitystorm/openstreetmap-carto/blob/master/CONTRIBUTING.md#multi-line-labels could be improved somehow, please do so.

@kocio-pl
Copy link
Collaborator Author

We could also think about hamlet rendering - it was proposed lately to move it to z14+ and it looks good to me (see #1984). I guess this is not the most important thing that quarter should start earlier than hamlet, but maybe somebody has some comments regarding this?

@kocio-pl
Copy link
Collaborator Author

@sommerluk Code is updated.

@sommerluk
Copy link
Collaborator

text-size, text-wrap-width, text-line-spacing, text-margin: seems fine to me now.

@kocio-pl
Copy link
Collaborator Author

Any other comments or reviews?

@polarbearing
Copy link
Contributor

Rendering is fine for me in general, given the usage.
The tag definition "bigger than place=neighbourhood" is a bit vague, since there is no clear size definition for neighbourhood to start with.
Thus we might also consider not to introduce a new size category and render equally as neighbourhood.

@dieterdreist
Copy link

dieterdreist commented May 14, 2018 via email

@polarbearing
Copy link
Contributor

ok that sounds reasonable.

@sommerluk sommerluk reopened this May 14, 2018
@kocio-pl kocio-pl merged commit cadf491 into gravitystorm:master May 14, 2018
@kocio-pl kocio-pl deleted the quarter branch May 14, 2018 14:19
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.

4 participants