How can I randomly select a number of point features and retain their attributes?

18852
22
Jump to solution
06-01-2016 08:55 AM
DarinJensen
New Contributor

I have >1m points in California and I want to randomly select ~10% and retain their attributes. "Create random points" doesn't work because it is creating, not selecting. I found a python script but can't make it work. Does anyone know a way using existing tools?

22 Replies
DarrenWiens2
MVP Honored Contributor

I believe you'd never be guaranteed to get 10% of the points using this method because some of the new random points would be closest to duplicate original points, or vice versa. But perhaps you could provide an example.

edit: fitting to the previous discussion, this would be an example of sampling with replacement.

0 Kudos
TimothyStoebner
Esri Contributor

By using your existing data as the constraint. the random points are created at the same location as existing points. It's also why I suggested using select by location as an alternative to spatial join, that way when your selection count equals the random count you know you don't have any duplicates or missing points.

Also, you could check for duplicate IDs in your joined output to find duplicate originals.

hope this helps.

DarrenWiens2
MVP Honored Contributor

Aha, I stand corrected. I thought you were suggesting to use a polygon covering all points as the constraining feature class. I didn't realize you could use points as a constraint. Good answer.

0 Kudos