Last active
August 29, 2015 14:14
-
-
Save jmcbroom/e948b50faa725e7ee311 to your computer and use it in GitHub Desktop.
field calculator stuff
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#### for everywhere BUT detroit | |
# in pre-script codeblock | |
rec=0 | |
def autoIncrement(cityid): | |
# get something to add the incremented number to | |
citystart = cityid * 10000 | |
global rec | |
pStart = 1 | |
pInterval = 1 | |
if (rec == 0): | |
rec = pStart | |
else: | |
rec += pInterval | |
final = citystart + rec | |
return final | |
# in the field calculator | |
autoIncrement(CITY_ID) | |
#### for Detroit | |
# in codeblock | |
rec=0 | |
def autoIncrement(neighborhood): | |
# get something to add the incremented number to | |
detstart = (8000 + neighborhood) * 10000 | |
global rec | |
pStart = 1 | |
pInterval = 1 | |
if (rec == 0): | |
rec = pStart | |
else: | |
rec += pInterval | |
final = detstart + rec | |
return final | |
# in the field calculator | |
autoIncrement(SAN00) | |
# refer to http://support.esri.com/en/knowledgebase/techarticles/detail/38517 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment