Field Calculator


Deprecated: Constant E_STRICT is deprecated in /home/dogtaton/public_html/giswiki/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Creation of dynamic property PPDStack::$accum is deprecated in /home/dogtaton/public_html/giswiki/includes/parser/Preprocessor_DOM.php on line 803

Deprecated: Constant E_STRICT is deprecated in /home/dogtaton/public_html/giswiki/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /home/dogtaton/public_html/giswiki/vendor/mediawiki/at-ease/src/Functions.php on line 48
From GIS Wiki
Jump to: navigation, search

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]