Algorithm for placing labels for objects on a map
I'm looking for an algorithm that could determine the optimal location for placing labels next to objects on a map, at different zoom levels.
The labels should obviously:
- be as close as possible to开发者_如何学编程 their respective objects
- not overlap with each other
- have a reasonable font size in each zoom level
In e.g. Google Earth this is being done in a magnificent way.
Any pointers will be much appreciated, especially to pseudo-code of various approaches or, better yet, to actual code in Python, Javascript, or ActionScript.
Maybe the sliding labels approach, as discussed in this article, will be of help.
Or your could use a simulated annealing approach.
An approach inspired by ant colonies.
A genetic algorithm approach.
A Tabu Search approach.
精彩评论