Algorithm for placing labels for objects on the map

I am looking for an algorithm that could determine the optimal location for placing labels next to objects on the map at different zoom levels.

Labels must be explicit:

  • be as close as possible to their respective objects
  • do not overlap
  • have a reasonable font size at every zoom level.

In particular. Google Earth does it in a great way.

Any pointers would be highly appreciated, especially for pseudo-codes of various approaches or, even better, for real code in Python, Javascript or ActionScript.

+4
source share
1 answer

Perhaps the tagging label approach described in this article will be useful.

Or you can use simulated annealing .

Colony- inspired approach ant .

A approach to the genetic algorithm .

A Approach to the search tab .

+5
source

Source: https://habr.com/ru/post/1341527/


All Articles