Opened 8 years ago
Last modified 8 years ago
#1251 new defect/bug
Longer street names do not render
Reported by: | mvglasow (2) | Owned by: | KaZeR |
---|---|---|---|
Priority: | major | Milestone: | |
Component: | core | Version: | git master |
Severity: | normal | Keywords: | |
Cc: | http://wiki.navit-project.org/index.php/user:mvglasow, (2) |
Description
Currently a lot of street names do not render on Navit, even when the street seems long enough to fit a label into. This seems to be more of an issue on high-resolution displays (e.g. Android HDPI) with a theme scaled appropriately (e.g. the 0606.at theme).
It appears that the current algorithm with which Navit renders labels on ways, such as street names, works in a manner similar to this:
- Break the way into segments from one point to the next
- Determine if the segment is long enough to render the label
- If yes, render the label.
This has drawbacks, which become apparent when a road is mapped with a hogh level of detail (i.e. high density of points):
- Short names (e.g. A2) get rendered very frequently – when this road is part of the route, the text almost completely obscures the colored line marking the route. (Style-dependent, of course.)
- Long names do not get rendered at all.
As a suggestion for improvement, I would suggest a label placing algorithm similar to the one in Mapnik:
- Place labels along paths (possibly with a limit on the maximum angle between two adjacent letters)
- Try to render each way label at least once
- Repeat labels on long ways (but with a reasonable amount of space in between)
This will probably be more resource-intensive than the current solution, but at the moment, the vast majority of street names is not rendering – not an acceptable solution.
Change History (1)
comment:1 Changed 8 years ago by mvglasow (2)
- Cc http://wiki.navit-project.org/index.php/user:mvglasow (2) added