Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Algorithm for placing labels for objects on a map

Tags:

algorithm

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:

  1. be as close as possible to their respective objects
  2. not overlap with each other
  3. 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.

like image 207
GJ. Avatar asked Feb 27 '11 16:02

GJ.


1 Answers

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.

like image 183
dommer Avatar answered Oct 06 '22 02:10

dommer