Arranging photos on a map
I am trying to create an application where photos are laid out on a map such that they are close to the lat/lon they correspond to, and yet do not overlap with each other.
An example of what I am after: http://snapshot.trulia.com/NY/New_York/#most_expensive
I believe this is a physics-based layout. Any pointers on how something开发者_开发知识库 like this might be accomplished? Any pointers with sample code would be doubly helpful :-)
You can frame this as an optimization problem.
For each given photo, the variables are angle and distance from the photo's desired lat/long "tie" point.
Your fitness function could be the sum of the distances for all the photos. Your optimization algorithm would work to minimize this.
精彩评论