Model generates different results than running subset features tool individually (iterate feature classes)

309
1
03-27-2018 05:23 PM
MitchellKern
New Contributor

I am looking for a way to go through 30 feature classes (each with about 168 x,y points and attribute data of dates and times) and then select a random point from each feature class (for a total of 30 points at the end-1 from each feature class).  I have built the following model:

Folder with 30 feature classes --> iterate feature classes --> OutputClass# --> Subset Features --OutputRandomPoint for outputclass#.

The model kinda works (it gives me 30 points, 1 from each feature class as I asked), but the results are not as random as they should be (some points are at the same position- i.e. same date and time- in each class). I know some overlap may occur (shouldn't be too often), but if I run each feature class individually through the subset features tool (lots of clicking), I get way more random results.  I have tried various sets of data and the model is not as random as individually doing it.  Any idea what is going wrong in my model? I would love to use the model and click twice instead of using the subset feature tool 30 times every week for my points.  

This is my first time building an iterate model so I hope it's something simple.

Side facts:

iterate feature class:  using feature type = point

subset feature:  using training feature subset = 1, and using subset size units = absolute_value

Thanks for the help,

M

0 Kudos
1 Reply
curtvprice
MVP Esteemed Contributor

I would:

1) build a model that does this:

input feature class -> Count rows -> Calculate Value with python expression to get a random Feature ID between 0 and count Rows result - 1 -> Feature Class to Feature Class with a select expression OBJECTID = %randomID% -> output feature class

2) test this, once it works, wrap it with your iterator, and name the output feature class with %n% so the outputs are uniquely named.