Determine outer boundries of polygon from lat/lng point array
Posted
by DustinDavis
on Stack Overflow
See other posts from Stack Overflow
or by DustinDavis
Published on 2010-06-02T17:28:12Z
Indexed on
2010/06/02
17:34 UTC
Read the original article
Hit count: 196
geospatial
|kml
I have a large array of lat/lng points. Could be up to 20k points. I'm plotting them using KML. What I want to do is to take only the outter most points and use them to draw a polygon instead. I already know how to draw a polygon in kml, I just need to figure out how to select only the outer most points of the group.
Any ideas? I'd like to have at least 5 points to the polygon but no more than 25 points total.
So far i've come up with checking for top most and bottom most points (basically crearing a square) using < & > logic.
The points will be in america & canada only if that matters.
Thanks for any help.
© Stack Overflow or respective owner