I'm attempting to write a Python expression for field calculator that will auto increment an integer ID field, but only using numbers that fall within certain ranges.

I work in a versioned environment so each GIS editor uses specific "hundreds" ranges to prevent duplicates.

For example my ranges are numbers in the 200s and 700s. So if I look up the last used ID value, and it is 10695, this script will begin autoincrementing at 10700. Or as another example, if the last used ID was 10796, this script would start with 10797 and autoinc. 10798, 10799, then skip to 11200.

The basic autoincrement script for field calculator only works if the calculated ID values happen to start and end within my range. I able to write some basic logic in a Python IDE that achieves the first calculation but struggling to get it to successfully increment.

New contributor
Luc GIS Nerd is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
  • 1
    Welcome to GIS SE. As a new user, please take the Tour. Coding questions here are expected to contain code. This doesn't really seem like a Calculate Field task, and seems more suited to a DA UpdateCursor, but either way, we need to see what you've got, and a description of the problem encountered. Please Edit the Question.
    – Vince
    Commented Jul 11 at 1:43