New answers tagged

3 votes
Accepted

Auto Incrementing ID based on repetitive sequential ID and conditional parameter (ID based on two fields - arcpy) - Update Cursor

If I understand your logic correctly the field calculator expression: remA = 1;remB = 1 def getTSEC(V,TRIGGER): global remA,remB if remA!=V and TRIGGER==2: remB+=1 remA = V return remB '----------...
user avatar
  • 21.7k
1 vote

Auto Incrementing ID based on repetitive sequential ID and conditional parameter (ID based on two fields - arcpy) - Update Cursor

You're code has a lot of random looping that serves no clear purpose. The core issue is that you have no clear algorithm for assigning the contents of Tsec. It's trivially easy to populate based on ...
user avatar
  • 19k
3 votes

How to use ArcPy SearchCursor, with a where clause, to return string formatted response with values

Similar to @timlohnes answer, but using a dictionary for all crop types, instead of a series of hard-coded scalar variables for each crop type. cropDict = {} with arcpy.da.SearchCursor(fc,fields) as ...
user avatar
2 votes

How to use ArcPy SearchCursor, with a where clause, to return string formatted response with values

Are you looking for something like this. Add up all the values for different crops, report it out at the end. I left out the format {} bits as I'm not familiar with that. Tried using brackets and ...
user avatar
  • 1,238
1 vote
Accepted

ArcGIS Pro Field Calculator: Updating each row with a minute added to previous time

First of all as @Vince points out, shapefile format was a poor choice for creating your data in. If you type into the help file "Geoprocessing considerations for shapefile output" you will ...
user avatar
  • 39.7k
0 votes

ArcGIS Pro Field Calculator: Updating each row with a minute added to previous time

In ArcGIS Pro, you can calculate fields based on previous rows both with field calculator and Python. With the field calculator, try to add these lines in the Code Block and make sure to set "...
user avatar
  • 434

Top 50 recent answers are included