Use SCPA mailing address fields for label download; drop unit logic
All checks were successful
Deploy stAndrews / deploy (push) Successful in 5s
All checks were successful
Deploy stAndrews / deploy (push) Successful in 5s
This commit is contained in:
20
app.R
20
app.R
@@ -427,17 +427,19 @@ server <- function(input, output) {
|
||||
prep_mailing <- function(data) {
|
||||
data |>
|
||||
sf::st_drop_geometry() |>
|
||||
dplyr::select(owner_1, owner_2, label, unit) |>
|
||||
dplyr::select(owner_1, owner_2, mailing_address_1, mailing_address_2,
|
||||
mailing_city, mailing_state, mailing_zip_code) |>
|
||||
dplyr::mutate(
|
||||
owner_2 = dplyr::na_if(owner_2, "NA"),
|
||||
owner_2 = ifelse(is.na(owner_2), "", owner_2),
|
||||
address_1 = stringr::str_squish(label),
|
||||
address_2 = ifelse(unit == "", "", paste0("Unit ", unit)),
|
||||
city = "Venice",
|
||||
state = "FL",
|
||||
zip = "34285"
|
||||
owner_2 = ifelse(is.na(owner_2), "", owner_2),
|
||||
mailing_address_2 = ifelse(is.na(mailing_address_2), "", mailing_address_2)
|
||||
) |>
|
||||
dplyr::select(owner_1, owner_2, address_1, address_2, city, state, zip)
|
||||
dplyr::rename(
|
||||
address_1 = mailing_address_1,
|
||||
address_2 = mailing_address_2,
|
||||
city = mailing_city,
|
||||
state = mailing_state,
|
||||
zip = mailing_zip_code
|
||||
)
|
||||
}
|
||||
|
||||
output$download_filtered <- downloadHandler(
|
||||
|
||||
@@ -46,11 +46,10 @@ owners_raw <-
|
||||
mutate(
|
||||
# extract clean street address (before multiple spaces / unit suffix)
|
||||
label = str_trim(str_extract(situs_address, "^\\d+\\s+\\S+\\s+\\S+")),
|
||||
unit = str_trim(str_extract(situs_address, "\\d+\\s*$")),
|
||||
unit = ifelse(is.na(unit), "", unit),
|
||||
location = paste0(label, ", Venice FL")
|
||||
) |>
|
||||
select(account_number, owner_1, owner_2, subdivision, homestead, label, unit, location)
|
||||
select(account_number, owner_1, owner_2, subdivision, homestead, label, location,
|
||||
mailing_address_1, mailing_address_2, mailing_city, mailing_state, mailing_zip_code)
|
||||
|
||||
# join to geometry ----
|
||||
owners <- owners_raw |>
|
||||
|
||||
Reference in New Issue
Block a user