Use SCPA mailing address fields for label download; drop unit logic
This commit is contained in:
18
app.R
18
app.R
@@ -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),
|
||||||
address_1 = stringr::str_squish(label),
|
mailing_address_2 = ifelse(is.na(mailing_address_2), "", mailing_address_2)
|
||||||
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(
|
||||||
|
|||||||
@@ -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 |>
|
||||||
|
|||||||
Reference in New Issue
Block a user