Skip to main content
Solved

Delete points below a distance from every point within a dataset

  • January 10, 2023
  • 3 replies
  • 224 views

Forum|alt.badge.img

Hello,

I have a point dataset and I want to make an algorithm that operates like this:

(1) Select a point;

(2) Remove all surrounding points within a distance, entered as a fixed parameter (eventually this can be done using a bufferer + spatial filter);

(3) Store the first initial point in a new dataset and repeat the process for the remaining dataset from step (2) to obtain a second point that will be stored with the first one and so on

The final result is to obtain a point dataset where no distance below a threshold exist ALONG WITH preserving the maximum number possible of points

Thank you very much in advance !

 

Best answer by ctredinnick

At a basic level, you can achieve that with the transformer attached. It selects a random point, excludes the points near to it, and loops back around with those which were outside of that distance to be retried until there are none left.

imageI generated a random set of points (below), it does a good job with it, they're all relatively evenly spaced. It doesn't achieve the goal of preserving the max number of points though. Maybe you can iterate to get a higher number, maybe there is an algorithm to do it, but given that the ShortestPathFinder performs random iterations until it stops improving, I suspect this may require the same approach.image

View original
Did this help you find an answer to your question?

3 replies

ctredinnick
Supporter
Forum|alt.badge.img+18
  • Supporter
  • Best Answer
  • January 11, 2023

At a basic level, you can achieve that with the transformer attached. It selects a random point, excludes the points near to it, and loops back around with those which were outside of that distance to be retried until there are none left.

imageI generated a random set of points (below), it does a good job with it, they're all relatively evenly spaced. It doesn't achieve the goal of preserving the max number of points though. Maybe you can iterate to get a higher number, maybe there is an algorithm to do it, but given that the ShortestPathFinder performs random iterations until it stops improving, I suspect this may require the same approach.image


Forum|alt.badge.img

Thank you for the answer, I have tried this custom transform, however, I was getting the message errors in the attached log file along with a snapshot from the workspace.

Screenshot 2023-01-11 114423 


Forum|alt.badge.img

Apparently, it was a problem with the user parameters and i fixed it. Thank you very much !


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings