A.1 King County Lookup Lists

Introduction

The maintainers of King County’s Assessor datasets use several different codified abbreviations for the categorical features in the dataset.

For example, the following abbreviations are used to indicate the tax status of a parcel:

ABBREVIATION CATEGORY
T Taxable
X Exempt
O Operating

Most codes are provided in the metadata guide document Lookup.zip , but some are listed in the metadata tables on the GIS Data Portal .

Features contained in the metadata guide are extracted directly from that document. Categorical features contained in the GIS Data Portal are usually presented as text strings in the following format:
"T = Taxable; X = Exempt; O = Operating"

The following function is used to parse a string formatted this way:

parse_lookup_string <- function(string, col_sep, row_sep){
  str_split(string, pattern = row_sep) %>% 
    flatten() %>% 
    keep(~ str_detect(.x,"")) %>%  
    str_replace_all("\\\n","") %>% 
    map_chr(c) %>% 
    map_df(~.x %>% str_split(pattern = col_sep) %>% as.data.frame %>% t %>% as_data_frame ) %>%  
    set_rownames(NULL) %>% 
    mutate_all(as.character) %>%  
    pmap(~ set_names(..2, ..1)) %>% 
    unlist()
}
string <- 
"
T = Taxable; X = Exempt; O = Operating
"

tax_reason_named_list <- parse_lookup_string(string, col_sep = "\\s=\\s",row_sep = ";\\s") 

The named list objects created in this section are used to de-code the various codification schemes used in the King County data. A code value is passed to the named list and the corresponding category or description is returned:

# Option 1
code_value <- "X"

tax_reason_named_list[code_value]
       X 
"Exempt" 
# Option 2
tax_reason_named_list["O"]
          O 
"Operating" 


A.1.1 Lookup Table Categorical Features

Description

King County provides a Lookup Table to decode features from the Assesor datasets and this analysis makes use of the following features from that Table:

  • Present Use
  • add others here

Processing Steps

Summary
  1. Create lu: A tibble object containing the King County Lookup document information.
  2. Create pu (add others here): Filter lu by LU_TYPE to select a single lookup category, then exact LU_DESCRIPTION and LU_ITEM in a named vector object.
  3. Upload each object to Drive.
Step 1
lu_fp <- root_file("./1-data/2-external/EXTR_LookUp.csv")

lu <- 
  make_or_read(lu_fp,
               {
                 dr_id <- as_id("0B5Pp4V6eCkhrSThkY055LUdxakE")
                 
                 drive_read(dr_id = dr_id,
                            path = lu_fp,
                            read_fun = read_csv,
                            .tempfile = FALSE,
                            progress = FALSE)
               },
               {read_csv(lu_fp,progress = FALSE)})
Step 2
# PRESENT USE
pu <- 
  lu %>%
  rename_all(to_screaming_snake_case) %>% 
  filter(LU_TYPE %in% 102) %>% 
  select(LU_DESCRIPTION, LU_ITEM) %>% 
  pmap(~purrr::set_names(..1,..2)) %>% 
  unlist

data.frame(DESCRIPTION = pu) %>% kable(format = "html")
DESCRIPTION
0 NA
101 Retail Store
104 Retail(Big Box)
105 Retail(Discount)
106 Office Building
11 Apartment
118 Office Park
122 Medical/Dental Office
126 Condominium(Office)
130 Farm
137 Greenhse/Nrsry/Hort Srvc
138 Mining/Quarry/Ore Processing
140 Bowling Alley
141 Campground
142 Driving Range
143 Golf Course
145 Health Club
146 Marina
147 Movie Theater
149 Park, Public(Zoo/Arbor)
150 Park, Private(Amuse Ctr)
152 Ski Area
153 Skating Rink(Ice/Roller)
156 Sport Facility
157 Art Gallery/Museum/Soc Srvc
159 Parking(Assoc)
16 Apartment(Mixed Use)
160 Auditorium//Assembly Bldg
161 Auto Showroom and Lot
162 Bank
163 Car Wash
165 Church/Welfare/Relig Srvc
166 Club
167 Conv Store without Gas
168 Conv Store with Gas
17 Apartment(Co-op)
171 Restaurant(Fast Food)
172 Governmental Service
173 Hospital
179 Mortuary/Cemetery/Crematory
18 Apartment(Subsidized)
180 Parking(Commercial Lot)
182 Parking(Garage)
183 Restaurant/Lounge
184 School(Public)
185 School(Private)
186 Service Station
188 Tavern/Lounge
189 Post Office/Post Service
190 Vet/Animal Control Srvc
191 Grocery Store
193 Daycare Center
194 Mini Lube
195 Warehouse
2 Single Family(Res Use/Zone)
20 Condominium(Residential)
202 High Tech/High Flex
210 Industrial Park
216 Service Building
223 Industrial(Gen Purpose)
245 Industrial(Heavy)
246 Industrial(Light)
247 Air Terminal and Hangers
25 Condominium(Mixed Use)
252 Mini Warehouse
261 Terminal(Rail)
262 Terminal(Marine/Comm Fish)
263 Terminal(Grain)
264 Terminal(Auto/Bus/Other)
266 Utility, Public
267 Utility, Private(Radio/T.V.)
271 Terminal(Marine)
272 Historic Prop(Residence)
273 Historic Prop(Office)
274 Historic Prop(Retail)
275 Historic Prop(Eat/Drink)
276 Historic Prop(Loft/Warehse)
277 Historic Prop(Park/Billbrd)
278 Historic Prop(Transient Fac)
279 Historic Prop(Rec/Entertain)
280 Historic Prop(Misc)
29 Townhouse Plat
299 Historic Prop(Vacant Land)
3 Duplex
300 Vacant(Single-family)
301 Vacant(Multi-family)
309 Vacant(Commercial)
316 Vacant(Industrial)
323 Reforestation(RCW 84.28)
324 Forest Land(Class-RCW 84.33)
325 Forest Land(Desig-RCW 84.33)
326 Open Space(Curr Use-RCW 84.34)
327 Open Space(Agric-RCW 84.34)
328 Open Space Tmbr Land/Greenbelt
330 Easement
331 Reserve/Wilderness Area
332 Right of Way/Utility, Road
333 River/Creek/Stream
334 Tideland, 1st Class
335 Tideland, 2nd Class
336 Transferable Dev Rights
337 Water Body, Fresh
339 Shell Structure
340 Bed & Breakfast
341 Rooming House
342 Fraternity/Sorority House
343 Gas Station
38 Mobile Home Park
4 Triplex
48 Condominium(M Home Pk)
49 Retirement Facility
5 4-Plex
51 Hotel/Motel
55 Rehabilitation Center
56 Residence Hall/Dorm
57 Group Home
58 Resort/Lodge/Retreat
59 Nursing Home
6 Single Family(C/I Zone)
60 Shopping Ctr(Nghbrhood)
61 Shopping Ctr(Community)
62 Shopping Ctr(Regional)
63 Shopping Ctr(Maj Retail)
64 Shopping Ctr(Specialty)
7 Houseboat
8 Mobile Home
9 Single Family(C/I Use)
96 Retail(Line/Strip)
Step 3
args_df <- 
  tribble( 
    ~ obj,               ~ name,
       pu, "kc-present-use.rds"           
  )

save_and_upload <- function(obj, name){
 
  folder <- as_id("0B5Pp4V6eCkhrZ3NHOEE0Sl9FbWc")
 
  tmp <- tempfile()

  write_rds(obj,tmp)

  drive_upload(tmp, folder, name = name)
   
}

pmap(args_df, ~ save_and_upload(..1,..2)) 


A.1.2 King County Jurisdictions

Description

Jurisdiction planning to annex this area.

Processing Steps

Summary
  1. Create string: The contents of the JURISDICTION table copy-and-pasted in the R environment.
  2. Create juris: A named vector of the jurisdictions and their abbreviations.
  3. Upload to Drive
Step 1
string <- 
"NULL   NULL
AL  Algona
AU  Auburn
BD  Black Diamond
BE  Bellevue
BO  Bothell
BU  Burien
CA  Carnation
CH  Clyde Hill
CO  Covington
DM  Des Moines
DU  Duvall
EN  Enumclaw
FW  Federal Way
HP  Hunts Point
IS  Issaquah
KE  Kent
KI  Kirkland
KM  Kenmore
LF  Lake Forest Park
ME  Medina
MI  Mercer Island
MT  Milton
MV  Maple Valley
NB  North Bend
NC  Newcastle
NP  Normandy Park
PA  Pacific
RM  Redmond
RN  Renton
SE  Seattle
SH  Shoreline
SK  Skykomish
SM  Sammamish
SN  Snoqualmie
ST  SeaTac
TU  Tukwila
WO  Woodinville
YP  Yarrow Point"
Step 2
juris <- 
  string %>% 
  parse_lookup_string(col_sep = "\t",row_sep ="\n" )

data.frame(DESCRIPTION = juris) %>% kable(format = "html")
DESCRIPTION
NULL NULL
AL Algona
AU Auburn
BD Black Diamond
BE Bellevue
BO Bothell
BU Burien
CA Carnation
CH Clyde Hill
CO Covington
DM Des Moines
DU Duvall
EN Enumclaw
FW Federal Way
HP Hunts Point
IS Issaquah
KE Kent
KI Kirkland
KM Kenmore
LF Lake Forest Park
ME Medina
MI Mercer Island
MT Milton
MV Maple Valley
NB North Bend
NC Newcastle
NP Normandy Park
PA Pacific
RM Redmond
RN Renton
SE Seattle
SH Shoreline
SK Skykomish
SM Sammamish
SN Snoqualmie
ST SeaTac
TU Tukwila
WO Woodinville
YP Yarrow Point
Step 3
folder <- as_id("0B5Pp4V6eCkhrZ3NHOEE0Sl9FbWc")

tmp <- tempfile()

write_rds(juris,tmp)

drive_upload(tmp, folder,name = "kc-jurisdictions.rds")


A.1.3 King County Tax Value Reasons

Description

The reason for a difference between appraised and taxable values.

Processing Steps

Summary
  1. Create string: The contents of the Real Property Account metadata table pasted into the R environment.
  2. Create tax_reason: Pass string to the parse_lookup_string() function.
  3. Upload tax_reason to Google Drive.
Step 1
string <- "
FS = senior citizen exemption
EX = exempt
OP = operating
NP = non profit exemption
CU = open space exemption
HI = home improvement exemption
HP = historic property exemption
MX = more than one reason applies
"
Step 2
tax_reason <- 
  string %>% 
  parse_lookup_string(col_sep = "\\s=\\s", row_sep = "\n")


data.frame(DESCRIPTION = tax_reason) %>% kable(format = "html")
DESCRIPTION
FS senior citizen exemption
EX exempt
OP operating
NP non profit exemption
CU open space exemption
HI home improvement exemption
HP historic property exemption
MX more than one reason applies
Step 3
folder <- as_id("0B5Pp4V6eCkhrZ3NHOEE0Sl9FbWc")

tmp <- tempfile()

write_rds(tax_reason,tmp)

drive_upload(tmp, folder,name = "kc-tax-reason.rds")


A.1.4 King County Tax Status

Description

The status of the parcel’s taxation. The categories are: Taxable,Exempt, or Operating.

Processing Steps

Summary
  1. Create string: The contents of the Real Property Account metadata table pasted into the R environment.
  2. Create tax_status: Pass string to the parse_lookup_string() function.
  3. Upload tax_status to Google Drive.
Step 1
string <- "
T = Taxable; X = Exempt; O = Operating
"
Step 2
tax_status <- 
  string %>% 
  parse_lookup_string(col_sep = "\\s=\\s", row_sep = ";\\s")

data.frame(DESCRIPTION = tax_status) %>% kable(format = "html")
DESCRIPTION
T Taxable
X Exempt
O Operating
Step 3
folder <- as_id("0B5Pp4V6eCkhrZ3NHOEE0Sl9FbWc")

tmp <- tempfile()

write_rds(tax_status,tmp)

drive_upload(tmp, folder,name = "kc-tax-status.rds",)