Skip to main content
Solved

Delete points below a distance from every point within a dataset

  • January 10, 2023
  • 3 replies
  • 276 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

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

3 replies

ctredinnick
Supporter
Forum|alt.badge.img+19
  • Supporter
  • 225 replies
  • 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
  • Author
  • 56 replies
  • January 11, 2023

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
  • Author
  • 56 replies
  • January 11, 2023

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