Use SCPA mailing address fields for label download; drop unit logic
All checks were successful
Deploy stAndrews / deploy (push) Successful in 5s

This commit is contained in:
2026-03-09 15:33:15 -04:00
parent ec55035e63
commit 4a3b2b8c27
2 changed files with 13 additions and 12 deletions

20
app.R
View File

@@ -427,17 +427,19 @@ server <- function(input, output) {
prep_mailing <- function(data) { prep_mailing <- function(data) {
data |> data |>
sf::st_drop_geometry() |> 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( dplyr::mutate(
owner_2 = dplyr::na_if(owner_2, "NA"), owner_2 = ifelse(is.na(owner_2), "", owner_2),
owner_2 = ifelse(is.na(owner_2), "", owner_2), mailing_address_2 = ifelse(is.na(mailing_address_2), "", mailing_address_2)
address_1 = stringr::str_squish(label),
address_2 = ifelse(unit == "", "", paste0("Unit ", unit)),
city = "Venice",
state = "FL",
zip = "34285"
) |> ) |>
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( output$download_filtered <- downloadHandler(

View File

@@ -46,11 +46,10 @@ owners_raw <-
mutate( mutate(
# extract clean street address (before multiple spaces / unit suffix) # extract clean street address (before multiple spaces / unit suffix)
label = str_trim(str_extract(situs_address, "^\\d+\\s+\\S+\\s+\\S+")), 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") 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 ---- # join to geometry ----
owners <- owners_raw |> owners <- owners_raw |>