Search code examples
google-mapsgeolocationgeometryshapesarea

compute a shape from a list of geographical coordinates


I have an App that displays thousands of Pin annotations on a google map using geo coordinates (lat/long in degree). In some circumstances I would like to replace the Pin annotations with an overlay that will represent the shape of my geographical area covered by my thousands of Pin.

I'm looking for an algorithm where the input is the list of geo coordinate of my Pin annotations and the output will be an ordered list of geo coordinates that I will use to create the overlay on the google map. For sure the best would be java/objective-C code if it exists :-)

I looked on internet and found articles related to Graham convex hull algorithm but it seems not so easy to use and I don't know if it really works with Lat/Long?

Any help will be really appreciated. Regards,

Sébastien.


Solution

  • i believe this is what you're looking for:

    http://en.wikipedia.org/wiki/Gift_wrapping_algorithm