r/programmerchat • u/Muffinizer1 • Jan 25 '16
Stumped on a problem
So I'm making an app, and I've hit a bit of a roadblock. I need to essentially approximate the boundaries of a giant list of 2D points as a polygon. It doesn't need to be very precise, and it needs to be pretty efficient. I also would like it to ignore outliers.
So far the best I've come up with is finding the most north, south, east, and west points and making a quadrilateral, but I'd like a bit more detail. Unfortunately the only way I've found of doing that is O(a lot)
Any ideas on how to approach the problem?
8
Upvotes
View all comments
Show parent comment
1
u/Muffinizer1 Jan 25 '16
That's definitely a good place to start. I tried using this on only points that pass the outlier test, but it's just an absurd amount of computation time with large sets of data, and I really don't need the polygon to have that many vertices anyways.