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

Street names rendering improvements #644

Closed
pbmorton opened this Issue Jul 6, 2015 · 19 comments

Comments

Projects
None yet
6 participants
@pbmorton

pbmorton commented Jul 6, 2015

Using mapsforge 0.5.1 sample App. If you change one rule in rendertheme-v4.xml to the following (the only change in this rule is zoom-min=15 changed to zoom-min=13):

<rule e="way" k="highway" v="secondary_link|primary_link|trunk_link|motorway_link|secondary|primary" zoom-min="13">
<pathText k="name" display="always" priority="-6" font-style="bold" font-size="12" fill="#000000" stroke="#FFFFFF" stroke-width="2.0"/>
</rule>

You should see highway names on the map at zoom 13 and 14. But they do not appear until zoom=15, even though the highways are visible at zooms 13 and 14.

@devemux86

This comment has been minimized.

Show comment
Hide comment
@devemux86

devemux86 Jul 6, 2015

Collaborator

Line labels are a special case.
Besides all common placement rules they obey, internally each label needs to "fit" in the line segment it's supposed to appear.

Collaborator

devemux86 commented Jul 6, 2015

Line labels are a special case.
Besides all common placement rules they obey, internally each label needs to "fit" in the line segment it's supposed to appear.

@pbmorton

This comment has been minimized.

Show comment
Hide comment
@pbmorton

pbmorton Jul 7, 2015

Thanks. From your response it seems this is expected behaviour. I think you should consider changing this behaviour in future. At zoom=13 (for example) a map may only show major highways and it would be useful to display the names of the highways. Forcing a user to zoom in to get the names to appear, then zoom out again to use the map, is not user friendly in my opinion. It is inconsistent too as other features like rivers display names at zoom=13. What do you think about changing this in future?

pbmorton commented Jul 7, 2015

Thanks. From your response it seems this is expected behaviour. I think you should consider changing this behaviour in future. At zoom=13 (for example) a map may only show major highways and it would be useful to display the names of the highways. Forcing a user to zoom in to get the names to appear, then zoom out again to use the map, is not user friendly in my opinion. It is inconsistent too as other features like rivers display names at zoom=13. What do you think about changing this in future?

@devemux86

This comment has been minimized.

Show comment
Hide comment
@devemux86

devemux86 Jul 7, 2015

Collaborator

I agree that this is not the best behavior and we should review it (though I don't know if it's technically possible).

Collaborator

devemux86 commented Jul 7, 2015

I agree that this is not the best behavior and we should review it (though I don't know if it's technically possible).

@devemux86

This comment has been minimized.

Show comment
Hide comment
@devemux86

devemux86 Jul 7, 2015

Collaborator

BTW have you played with render theme directives, like priority and display?

Collaborator

devemux86 commented Jul 7, 2015

BTW have you played with render theme directives, like priority and display?

@pbmorton

This comment has been minimized.

Show comment
Hide comment
@pbmorton

pbmorton Jul 7, 2015

I did play around with the display and priority directives but could not make the labels visible.

pbmorton commented Jul 7, 2015

I did play around with the display and priority directives but could not make the labels visible.

@eartrumpet

This comment has been minimized.

Show comment
Hide comment
@eartrumpet

eartrumpet Jul 14, 2015

The only way to make highway names visible at lower zoom levels (sometimes, if the highway has short segments and a long name, this means ZL 16-18!) is to use caption instead of pathText - with other annoyances involved.

This is one of the last major disadvantages of mapsforge which regularly creates support questions.

Can this be fixed with the label layer? OSMAnd for example has pathTexts winding along the highway, which would be desireable too.

eartrumpet commented Jul 14, 2015

The only way to make highway names visible at lower zoom levels (sometimes, if the highway has short segments and a long name, this means ZL 16-18!) is to use caption instead of pathText - with other annoyances involved.

This is one of the last major disadvantages of mapsforge which regularly creates support questions.

Can this be fixed with the label layer? OSMAnd for example has pathTexts winding along the highway, which would be desireable too.

@devemux86

This comment has been minimized.

Show comment
Hide comment
@devemux86

devemux86 Jul 14, 2015

Collaborator

Can this be fixed with the label layer?

Have you tried it?

Collaborator

devemux86 commented Jul 14, 2015

Can this be fixed with the label layer?

Have you tried it?

@eartrumpet

This comment has been minimized.

Show comment
Hide comment
@eartrumpet

eartrumpet Jul 14, 2015

At the moment it makes no difference, and it seems to me that pathText is still rendered on the map layer.

Right now pathText is rendered on every possible segment, if you zoom in far enough, which isn't desireable as well (especially with possible solution like truncating or just writing the name longer than the segment) .
Also only once per tile if it's a long straight segment which passes several tiles (for example on aerial ways).

Could moving to label layer it might be possible to limit it to once per name value? Then it might make sense to just write the whole name, even if it's longer than a segment.

Edit: Maybe it makes sense to have pathText once per tile, as for longer routes/roads. So showing the name value without limiting it to the segment length only once per tile may be a good compromise.

eartrumpet commented Jul 14, 2015

At the moment it makes no difference, and it seems to me that pathText is still rendered on the map layer.

Right now pathText is rendered on every possible segment, if you zoom in far enough, which isn't desireable as well (especially with possible solution like truncating or just writing the name longer than the segment) .
Also only once per tile if it's a long straight segment which passes several tiles (for example on aerial ways).

Could moving to label layer it might be possible to limit it to once per name value? Then it might make sense to just write the whole name, even if it's longer than a segment.

Edit: Maybe it makes sense to have pathText once per tile, as for longer routes/roads. So showing the name value without limiting it to the segment length only once per tile may be a good compromise.

@Klaus-Tockloth

This comment has been minimized.

Show comment
Hide comment
@Klaus-Tockloth

Klaus-Tockloth Feb 8, 2016

emux already referenced it ... so only to keep the context ... here's the relevant screenshot (which shows a lot of missing street labels).

bildschirmfoto 2016-02-07 um 20 18 09

It seems that the rules for supressing the street labels are to strict. IMHO it's important to increase the number of labels shown, even if they are not rendered perfectly (or have some glitches).

Klaus

Klaus-Tockloth commented Feb 8, 2016

emux already referenced it ... so only to keep the context ... here's the relevant screenshot (which shows a lot of missing street labels).

bildschirmfoto 2016-02-07 um 20 18 09

It seems that the rules for supressing the street labels are to strict. IMHO it's important to increase the number of labels shown, even if they are not rendered perfectly (or have some glitches).

Klaus

@devemux86 devemux86 changed the title from mapsforge highway names disappear at lower zoom levels to Not all street labels are shown on the map Feb 8, 2016

@ludwigb

This comment has been minimized.

Show comment
Hide comment
@ludwigb

ludwigb Feb 14, 2016

Collaborator

I changed the algorithm a bit:

  • moving street names into the middle of a segment
  • reduce margins where I think they were overly cautions or even double calculated
  • reduce margin value

Overall we get more street names with a more pleasing layout.

Collaborator

ludwigb commented Feb 14, 2016

I changed the algorithm a bit:

  • moving street names into the middle of a segment
  • reduce margins where I think they were overly cautions or even double calculated
  • reduce margin value

Overall we get more street names with a more pleasing layout.

@devemux86

This comment has been minimized.

Show comment
Hide comment
@devemux86

devemux86 Feb 14, 2016

Collaborator

+1

Are we certain the labels are in segments center? (they seem a bit off)

Also the skipPixels - specially now with arbitrary value - what's exactly its purpose?

Collaborator

devemux86 commented Feb 14, 2016

+1

Are we certain the labels are in segments center? (they seem a bit off)

Also the skipPixels - specially now with arbitrary value - what's exactly its purpose?

@ludwigb

This comment has been minimized.

Show comment
Hide comment
@ludwigb

ludwigb Feb 14, 2016

Collaborator

skipPixels is used to avoid repeating the street name all the time if there
is space. Previously it was dependent on the name length, which to me does
not make much sense.

actually, just double checking: the calculations might be total rubbish,
will have to check tomorrow or so again. But at least we do not have them
stuck at the beginning of the road anymore.

Thanks for checking....

On 14 February 2016 at 21:35, Emux notifications@github.com wrote:

+1

Are we certain the labels are in segments center, they seem a little off.

Also the skipPixels - specially now with arbitrary value - what's exactly
its purpose?


Reply to this email directly or view it on GitHub
#644 (comment)
.

Collaborator

ludwigb commented Feb 14, 2016

skipPixels is used to avoid repeating the street name all the time if there
is space. Previously it was dependent on the name length, which to me does
not make much sense.

actually, just double checking: the calculations might be total rubbish,
will have to check tomorrow or so again. But at least we do not have them
stuck at the beginning of the road anymore.

Thanks for checking....

On 14 February 2016 at 21:35, Emux notifications@github.com wrote:

+1

Are we certain the labels are in segments center, they seem a little off.

Also the skipPixels - specially now with arbitrary value - what's exactly
its purpose?


Reply to this email directly or view it on GitHub
#644 (comment)
.

@devemux86

This comment has been minimized.

Show comment
Hide comment
@devemux86

devemux86 Feb 14, 2016

Collaborator

Another thought is whether we need to make skipPixels dependent on display model scale factor now.

Collaborator

devemux86 commented Feb 14, 2016

Another thought is whether we need to make skipPixels dependent on display model scale factor now.

@ludwigb

This comment has been minimized.

Show comment
Hide comment
@ludwigb

ludwigb Feb 14, 2016

Collaborator

possibly, I was wondering what unit that actually is.

On 14 February 2016 at 22:06, Emux notifications@github.com wrote:

Another thought is if we need to make skipPixels dependent on display
model scale factor now.


Reply to this email directly or view it on GitHub
#644 (comment)
.

Collaborator

ludwigb commented Feb 14, 2016

possibly, I was wondering what unit that actually is.

On 14 February 2016 at 22:06, Emux notifications@github.com wrote:

Another thought is if we need to make skipPixels dependent on display
model scale factor now.


Reply to this email directly or view it on GitHub
#644 (comment)
.

@lincomatic

This comment has been minimized.

Show comment
Hide comment
@lincomatic

lincomatic Apr 22, 2016

Contributor

This new code shows more streets, which is great, but at the same time, there are more duplicate names on the same street.

Old code:
image

New code:
image

Contributor

lincomatic commented Apr 22, 2016

This new code shows more streets, which is great, but at the same time, there are more duplicate names on the same street.

Old code:
image

New code:
image

@ludwigb

This comment has been minimized.

Show comment
Hide comment
@ludwigb

ludwigb Apr 22, 2016

Collaborator

yes, that is what the code does: it relaxes the space restrictions for
street names a bit, so sections that were not considered long enough now
sometimes display a street name

On 23 April 2016 at 07:21, lincomatic notifications@github.com wrote:

This new code shows more streets, which is great, but at the same time,
there are more duplicate names on the same street.

Old code:
[image: image]
https://cloud.githubusercontent.com/assets/1422186/14757227/fd179e70-08a5-11e6-89cb-aed72de61741.png

New code:
[image: image]
https://cloud.githubusercontent.com/assets/1422186/14757240/2acfadb2-08a6-11e6-85b0-b4b23fe50a3a.png


You are receiving this because you commented.
Reply to this email directly or view it on GitHub
#644 (comment)

Collaborator

ludwigb commented Apr 22, 2016

yes, that is what the code does: it relaxes the space restrictions for
street names a bit, so sections that were not considered long enough now
sometimes display a street name

On 23 April 2016 at 07:21, lincomatic notifications@github.com wrote:

This new code shows more streets, which is great, but at the same time,
there are more duplicate names on the same street.

Old code:
[image: image]
https://cloud.githubusercontent.com/assets/1422186/14757227/fd179e70-08a5-11e6-89cb-aed72de61741.png

New code:
[image: image]
https://cloud.githubusercontent.com/assets/1422186/14757240/2acfadb2-08a6-11e6-85b0-b4b23fe50a3a.png


You are receiving this because you commented.
Reply to this email directly or view it on GitHub
#644 (comment)

@lincomatic

This comment has been minimized.

Show comment
Hide comment
@lincomatic

lincomatic Apr 26, 2016

Contributor

I fixed a bug in c8f705f . The street names were not centered. Compare the screen shot below with the one above:
image

In WayDecorator.java, the line:

LineSegment actuallyUsedSegment = drawableSegment.subSegment(offset, wayNameWidth - WAYNAME_SAFETY_MARGIN * 2);

should be:

LineSegment actuallyUsedSegment = drawableSegment.subSegment(offset+WAYNAME_SAFETY_MARGIN, wayNameWidth - WAYNAME_SAFETY_MARGIN * 2);

Contributor

lincomatic commented Apr 26, 2016

I fixed a bug in c8f705f . The street names were not centered. Compare the screen shot below with the one above:
image

In WayDecorator.java, the line:

LineSegment actuallyUsedSegment = drawableSegment.subSegment(offset, wayNameWidth - WAYNAME_SAFETY_MARGIN * 2);

should be:

LineSegment actuallyUsedSegment = drawableSegment.subSegment(offset+WAYNAME_SAFETY_MARGIN, wayNameWidth - WAYNAME_SAFETY_MARGIN * 2);

@lincomatic

This comment has been minimized.

Show comment
Hide comment
@lincomatic

lincomatic Apr 26, 2016

Contributor

Sorry, my previous comment was referencing lines in stale code. I submitted a PR with the latest dev code #829

Contributor

lincomatic commented Apr 26, 2016

Sorry, my previous comment was referencing lines in stale code. I submitted a PR with the latest dev code #829

@devemux86 devemux86 changed the title from Not all street labels are shown on the map to Street names rendering improvements Apr 26, 2016

@devemux86 devemux86 added this to the 0.6.1 milestone May 15, 2016

@devemux86

This comment has been minimized.

Show comment
Hide comment
@devemux86

devemux86 May 15, 2016

Collaborator

Closing this part of improvements. Additional can be monitored in new issue.

Collaborator

devemux86 commented May 15, 2016

Closing this part of improvements. Additional can be monitored in new issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment