You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are using bounding box center for placing label on map. It is simple and fastest method. But for some natural areas, like islands or lakes its label may be located outside the area. For example "Císařský ostrov" islet in Prague:
It would be great to use some precise method for placing label on areas (rings). We can try to use Polylabel algorithm from Mapbox. This method should be fast, code is available in C++ under terms of ISC license, that should be compatible with LGPL. It should be easy to adapt this code to libosmscout.
Not to degrade performace, this algorithm may be used just for some types. Or label position (visual center) may be computed during import time and stored in database.
The text was updated successfully, but these errors were encountered:
Yes, sounds interesting. I think import time would be wise for calculation. We can add it as an optional point to the polygon (triggered by some flag). Since we have to handle a huge number of polygons on import, we would need a very selective filter to even start the calculation - likely size (bigger buildings and bigger?) and possibly even types?
I also think for relation based polygons there is a way to define the center. So this can be also evaluated?
As far as I know, such center may be defined for administrative regions possibly other relation types, but it is not used for natural objects like lakes, islands...
I have this task on my todo list, but not on the top :-) I would be happy if someone else will make this improvement.
Karry
added
feature
For issues and pull request that request or implement a new feature
renderer
For issues in the content of the rendering engine
labels
Oct 12, 2021
@Karry great addition to the renderer ! And I also love Troja, young I spent a lot of time there with my parents and still go there almost every time I travel to Prague :-)
We are using bounding box center for placing label on map. It is simple and fastest method. But for some natural areas, like islands or lakes its label may be located outside the area. For example "Císařský ostrov" islet in Prague:
It would be great to use some precise method for placing label on areas (rings). We can try to use Polylabel algorithm from Mapbox. This method should be fast, code is available in C++ under terms of ISC license, that should be compatible with LGPL. It should be easy to adapt this code to libosmscout.
Not to degrade performace, this algorithm may be used just for some types. Or label position (visual center) may be computed during import time and stored in database.
The text was updated successfully, but these errors were encountered: