Select to view content in your preferred language

Select sequentially and populate a field in attribute table: python or model builder?

1697
3
10-31-2016 12:33 PM
BobNoyes
Frequent Contributor

Here is the problem I am hoping to get assistance with. I have a large area of points (covers 9 counties) for which I have created a grid polygon that has 382 boxes . I would like to write a python script or create a model that will select each box of the grid and then using that selected box do a "selection by location" of the point feature class finding the point with the high value in a column in the attribute table. The highest value would get a 1 in a field called "grid_ht".  The code or model would work sequentially through each box of the grid and finding the highest valued point in that location. What I am trying to do is find and mark the highest point (elevation) within each part of the grid. It would need to be able ignore boxes that do not have any point features with their boundaries. Anyone have suggestions?

So:

-  Select Grid ID #1

- Select by location - Summit points

- find highest point in that box and put a 1 in it's Grid_Ht column

- select Grid ID #2

- Select by location - Summit points

- find highest point in that box and put a 1 in it's Grid_Ht column

- Select Grid ID #3 and so on.

0 Kudos
3 Replies
DanPatterson_Retired
MVP Emeritus

which do you like better, spatial join, inersect or select by location? which manual approach do you prefer? there are others

0 Kudos
BobNoyes
Frequent Contributor

Generally I use select by location when working with two different layers. But, that is usually for small numbers of items. In this case it is for 382 or so features so I was hoping to automate it..... Anyway, I can't say I have a preferred method as I am always open to new methods of doing something.

0 Kudos
BobNoyes
Frequent Contributor

...but, I think I see where you are going with this. I will play with the spatial join, haven't really needed to use that in the past.

0 Kudos