Difference between revisions of "Field Calculator"
m |
m |
||
| Line 39: | Line 39: | ||
<pre>rval& [PROP_ID]</pre> | <pre>rval& [PROP_ID]</pre> | ||
| − | [[Category: | + | [[Category:Scripts]] |
Latest revision as of 16:31, 4 September 2015
Useful functions for the field calculator.
Situs from components (python)[edit]
Pre-logic:
def concat_address(lnum, hnum, sdir, sname, stype):
outstr = lnum
if hnum <> "0":
outstr += "-"+hnum
if sdir.isalpha():
outstr += " "+sdir
outstr += " "+sname+" "+stype
return outstr
field =
concat_address(!LO_ADDRESS!, !HI_ADDRESS!, !STDIR!, !STNAME!, !STTYPE!)
Parcels FACILITYID (python)[edit]
Highlight the new parcels (don't calculate everything) and find the current highest FACILITYID.
Pre-logic:
id = (enter the current highest here) def getid(): global id id += 1 return id
FACILITYID=
getid()
Parcels/CountyParcels PROPERTY (vb)[edit]
Pre-logic:
tval = Len ( [PROP_ID] ) if tval > 4 then rval = "R" elseif tval > 3 then rval = "R0" elseif tval > 2 then rval = "R00" else rval = "R000" end if
PROPERTY =
rval& [PROP_ID]