-1

I have a layer of 1,000 points in ArcGIS Pro. Each point has a 'rank' value in the attribute table between 1 and 5. I want to randomly select 5 points from each 'rank' (25 total points) where no point within 200 meters of another point (regardless of the rank).

How do I do this?

I have considered making different layers for each rank but then the spatial component wouldn't work across layers.

PolyGeo
  • 65,136
  • 29
  • 109
  • 338
Nadav
  • 1

2 Answers2

0

You could use the Generate Near Table tool then delete out the rows where points are less than 200m apart, sort by your rank field and choose your random rows; how you do that could be in several ways but if you had searched this forum you would have come across the Q&A.

Hornbydd
  • 43,380
  • 5
  • 41
  • 81
  • Good chance to delete them all. This is way more complicated task, I call it weeding, i.e. removing worst offender at a time until none found. Similar, but not the same to this https://gis.stackexchange.com/questions/403023/location-optimisation/403252#403252 – FelixIP Jun 12 '23 at 02:44
  • @FelixIP, Good point! I was playing around with a dense set of points but you correctly identify if the points are sparse then the logic I suggest could remove them all! :) – Hornbydd Jun 12 '23 at 08:14
  • 1
    I use this method often to create river cross-sections at 'regular' interval from 1000s of candidates – FelixIP Jun 12 '23 at 08:52
0

Simplest way to do it is using networkx module. Treat your points as nodes of the graph and Near table (with 200 m search radius) as edges.

Remove one 'worst' offender node (the one with most neighbours) from you graph. Repeat until no nodes left. So from this:

enter image description here

you can go to this:

enter image description here

Where distance between nearest points is greater than threshold.

You might not have enough points to randomly pick from if threshold is too big or same class points are clustered close to each other. Picture below shows result for greater threshold distance:

enter image description here

FelixIP
  • 22,922
  • 3
  • 29
  • 61