AnsweredAssumed Answered

Iterate through rows, select row, select by location, update cursor

Question asked by COReGISAdmin on Nov 19, 2019
Latest reply on Dec 10, 2019 by COReGISAdmin

Hello. 

 

Python 3.6.8, ArcGIS Pro, file geodatabase.

I have a feature class Applications which is the result of a previous script. Fields I am interested in are Status (string), Rank (integer), Area.Shape.  One of the features in Applications already has a Status = "Confirmed". It's the row with the highest Rank. Other Status values are null, "Failed", "Pending".

 

Below is a mixture of aspiration of the script and a proposed method although I have to admit this is stretching the limits of my current python. I am not sure this process is possible after looking a other scripts that use da.updatecursor?

 

I would like to -

Create Pending_Applications layer from Applications feature class where Status = "Pending"

Create Confirmed_Applications layer from Applications feature class where Status = "Confirmed". 

 

Iterate in order of Rank field the Pending_Applications- select the record of the current row

If the selected feature intersects the Confirmed_Applications layer update the Status field to "Defeated"

 

else if it does not intersect Confirmed_Applications update the Status field to "Confirmed" (if sum of Area.Shape of the Confirmed_Applications + the Area.Shape of the current row =< 8,000)

 

else update the Status field to "Capped Out" (if sum of Area.Shape of the Confirmed_Applications + the Area.Shape of the current row > 8,000) update the Status field to "Capped Out".

 

Once a row is updated would the next iteration re-read the Confirmed_Applications layer again with additional features where the Status had been updated to "Confirmed" in previous iterations?

Many tanks.

Marc

Outcomes