1

Hello this is more general question. I am writing program that will provide visualization of air traffic forecasts. I have a polygon made of few GPS x,y coordinates and I also have dataset of points that are in that polygon and It would look like this. Polygon with already existing points in it

My task now is to generate new points in that polygon but in a way that those new points will be distributed ,,evenly,, I mean it in a way that I would like those new points generated in those empty areas of that polygon. Here is a picture of what I had in mind. New points are represented as blue points. What I want

I was told this task should be done by clustering, I learned what clustering does with datasets and how it works kinda. However I am unable apply that on my problem, I just cant wrap that around my head. So my question is: Would this be possible to do through clustering, through k-means or DBSCAN or other method? I already tried some basic stuff, but I cant do it, so I just wanted to ask generally If I can even do it through clustering or if I should just use some other function for this.

Martin Kavka
  • 49
  • 1
  • 3
  • How about finding the clusters in the original then randomly dropping points, keep a point only if they are in the polygon and not in a cluster. You need some kind of test for the end state I would think. – wwii Mar 11 '23 at 14:48
  • Or make a field of points then throw out any that would be in one of the original clusters. – wwii Mar 11 '23 at 14:54
  • so I since I have 12 points in that polygon, I would make 12 clusters with those 12 points as the centers. Then I would just randomly generate points in that polygon and make two conditions. One that would check if that point is in polygon and the other if its out of other clusters. Do I understand you well ? – Martin Kavka Mar 12 '23 at 11:11
  • It was just a thought on how clusters might be used since that is what you have to do. I don't know how practical it might be. You would have to define what evenly distributed means. I see maybe 4 clusters in the original with a pretty high concentration in two of them. Might be able to tweak cluster parameters to make just two for the original but how would you know they would work on a different polygon and set of points. Seems like when you are done with this you will have a pretty good feel for how clusters work and what they are good for. – wwii Mar 12 '23 at 14:29
  • For me this would be a trial and error kind of thing, lots of work. Maybe someone will chime in with a different idea on how to use clusters to solve the problem. If using clusters is a mandate then the mandating authority knows it is doable, or it is a learning exercise. Go back to them and ask how to approach it. – wwii Mar 12 '23 at 14:34

1 Answers1

1

This following technique is a little harder to implement from scratch, but ensures that each subsequent generated point occupies the center of the (roughly) largest empty region, resulting in a full and balanced spread of points over the polygon.

  1. Compute the Largest Empty Circle (LEC) for set the obstacle geometries, which initially comprise the polygon's edges and the initial point set.
  2. Add the center point of the resulting LEC to the set of obstacles.
  3. Recompute the LEC for the updated set of obstacles.
  4. Repeat steps 2-3 as many times as needed to achieve the desired number of additional points.

For the illustration below I'm using the JTS LargestEmptyCircle (Java) implementation.

enter image description here

micycle
  • 3,328
  • 14
  • 33