Skip to content

Commit

Permalink
Add rec_centers data + update adopted_plans
Browse files Browse the repository at this point in the history
Also reorganize NEWS
  • Loading branch information
elipousson committed Oct 19, 2023
1 parent c374c4c commit b6c1b39
Show file tree
Hide file tree
Showing 9 changed files with 187 additions and 16 deletions.
41 changes: 34 additions & 7 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,46 @@
# mapbaltimore (development version)

* Add new `buildings_21stc` data (2023-04-28).
* Add new `main_streets` data (2023-10-16).
* Update `baltimore_gis_index` data (2023-05-26).
## New data

* Added `buildings_21stc` (2023-04-28), `main_streets` (2023-10-16), and `rec_centers` (2023-10-19)

## Updated data

* Update `adopted_plans` data (2023-10-19) to reflect new source (adds 1 new plan for 2023).
* Update `baltimore_gis_index` data (2023-05-26) to reflect currently available layers as of the update date.
* Update `parks` data to use new BCRP layer that includes community green spaces and other non-city owned open spaces (2023-10-16).
* Update `mta_bus_stops` to use current winter 2023 service data and correct issue with frequency variable where stops with frequent service had not been identified as such.

## New or modified functions

* Add `get_neighborhood()` and refactor `get_baltimore_area()` for more consistency with `{getdata}` parameter names (2023-05-26).

## other

* Update package logo and switch pkgdown site to rendering with GitHub actions (2023-06-13)
* Update `mta_bus_stops` to use current winter 2023 service data and correct issue with frequency variable where stops with frequent service had not been identified as such.

# mapbaltimore 0.1.1.9000 (2023-03-31)

* Update `baltimore_mihp` and `explore_baltimore` spatial data (2023-03-29).
## New data

* Add new `chap_districts` spatial data (2023-02-10).
* Add new version of `legislative_districts` data and rename prior version as `legislative_districts_2012`.
* Add new `baltimore_gis_index` (2022-10-20) and `respagency_codes` (2023-03-29) reference data.
* Move `forcats`, `ggrepel`, `ggplot2` `maplayer`, `naniar`, `progress`, and `readr` from Imports to Suggests.
* Remove `baltimorecensus` from Imports.

## Updated data

* Update `baltimore_mihp` and `explore_baltimore` spatial data (2023-03-29).

## New or modified functions

* Add `get_baltimore_worker_flows()` (2023-03-31) and `get_baltimore_esri_data()` function.
* Deprecate `get_area_data()` function (2023-03-31).

## Other

* Move `forcats`, `ggrepel`, `ggplot2` `maplayer`, `naniar`, `progress`, and `readr` from Imports to Suggests.
* Remove `baltimorecensus` from Imports.

# mapbaltimore 0.1.1 (2022-10-13)

I haven't been consistent in updating versions but this is a patch update in preparation to address the issue (#3) with version control for package data and starting the deprecation process for general utility functions (#4).
Expand All @@ -27,7 +49,12 @@ Key changes since version 0.1.0.9001 include removing the dependency on `{overed

# mapbaltimore 0.1.0.9001 (2022-01-10)

## Updated data

* Update `neighborhoods` to include a osm_id column + use "Institutional area" as a type value.

## New or modified functions

* Replace hard-coded CRS for `map_area_zoning()`
* Update `get_area_requests()` to support 2022 requests and work w/ modified column names.

Expand Down
32 changes: 31 additions & 1 deletion R/data.R
Original file line number Diff line number Diff line change
Expand Up @@ -791,7 +791,7 @@
#' Combined area plans and LINCS corridor data from the [Baltimore City
#' Department of Planning](https://planning.baltimorecity.gov/).
#'
#' @format A data frame with 58 rows and 5 variables:
#' @format A data frame with 59 rows and 5 variables:
#' \describe{
#' \item{`plan_name`}{Plan or area name}
#' \item{`year_adopted`}{Year adopted or initiated}
Expand Down Expand Up @@ -1139,3 +1139,33 @@
#'}
#' @source <https://services1.arcgis.com/43Lm3JYE3nM91DAF/arcgis/rest/services/MainStreets/FeatureServer/0>
"main_streets"


#' Baltimore City Recreation Centers
#'
#' Currently includes only publicly operated (BCRP) rec centers. Expect to add
#' private operator facilities. Added 2023-10-19.
#'
#' @format A data frame with 48 rows and 18 variables:
#' \describe{
#' \item{`id`}{ID}
#' \item{`name`}{Center name}
#' \item{`name_short`}{Short name}
#' \item{`street_address`}{Street address}
#' \item{`address`}{Full address}
#' \item{`center_amenities`}{Center amenities}
#' \item{`center_assets`}{Center facility assets}
#' \item{`center_category`}{Center category}
#' \item{`center_type`}{Center type}
#' \item{`school_name`}{School name (school-based centers only)}
#' \item{`operator`}{Operator (BCRP only)}
#' \item{`recreation_district`}{BCRP Recreation district}
#' \item{`park_district`}{BCRP Park Maintenance District}
#' \item{`council_district`}{City Council district}
#' \item{`legislative_district`}{Maryland legislative district}
#' \item{`police_district`}{BPD Police district (maybe outdated)}
#' \item{`notes`}{Notes}
#' \item{`geometry`}{POINT geometry with center location}
#'}
#' @source <https://services1.arcgis.com/UWYHeuuJISiGmgXx/arcgis/rest/services/recreationCenter2023/FeatureServer>
"rec_centers"
1 change: 1 addition & 0 deletions _pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ reference:
- ends_with("_21stc")
- '`chap_districts`'
- '`main_streets`'
- '`rec_centers`'
- subtitle: Additional non-spatial reference data
contents:
- '`request_types`'
Expand Down
61 changes: 61 additions & 0 deletions data-raw/baltimore-city_bcrp.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
library(dplyr)
library(stringr)

url <- "https://services1.arcgis.com/UWYHeuuJISiGmgXx/arcgis/rest/services/recreationCenter2023/FeatureServer"

rec_centers_source <- esri2sf::esri2sf(url, crs = 2804)

rec_centers <- rec_centers_source |>
getdata::rename_with_xwalk(
xwalk = tibble::tribble(
~label, ~variable,
"OBJECTID", "OBJECTID",
"street_address", "ADDRESS",
"address", "addressFull",
"center_type", "TYPE",
"school_name", "schoolName",
"center_amenities", "amenity",
"notes", "note",
"CURRENT_", "CURRENT_",
"operator", "OPERATOR",
"inCivicRec", "inCivicRec",
"inDivisionList", "inDivisionList",
"center_assets", "civicRecAsset",
"center_category", "CATEGORY",
"name", "NAME",
"recreation_district", "recDistrict",
"park_district", "parkDstrct",
"council_district", "cnclDistrict",
"legislative_district", "lgsltvDstrct",
"police_district", "policeDstrct",
"id", "GISID",
"geoms", "geoms"
)
) |>
dplyr::mutate(
name_short = name,
# FIXME: Distinguish between community center and rec center names
name = paste0(name, " Rec Center"),
police_district = str_to_sentence(police_district)
) |>
dplyr::relocate(
"id", "name", "name_short",
ends_with("address"), starts_with("center"),
"school_name", "operator", ends_with("district"),
.before = everything()
) |>
dplyr::relocate(
"center_type",
.before = "school_name"
) |>
dplyr::select(!c("CURRENT_", "inCivicRec", "inDivisionList", "OBJECTID")) |>
naniar::replace_with_na(
list(
school_name = "",
center_amenities = "",
notes = ""
)
) |>
sfext::rename_sf_col()

usethis::use_data(rec_centers, overwrite = TRUE)
26 changes: 19 additions & 7 deletions data-raw/data.R
Original file line number Diff line number Diff line change
Expand Up @@ -1365,8 +1365,9 @@ usethis::use_data(buildings_21stc, overwrite = TRUE)

adopted_plans_path <-
# FIXME: The original link for this data no longer works but the new data is missing key information
"https://geodata.baltimorecity.gov/egis/rest/services/Planning/Boundaries_and_Plans/MapServer/72"
# "https://geodata.baltimorecity.gov/egis/rest/services/Planning/Boundaries/MapServer/39"
# "https://geodata.baltimorecity.gov/egis/rest/services/Planning/Boundaries_and_Plans/MapServer/72"
# "https://geodata.baltimorecity.gov/egis/rest/services/Planning/Boundaries/MapServer/39"
"https://geodata.baltimorecity.gov/egis/rest/services/Housing/dmxCityPrograms/MapServer/8"

inspire_path <-
"https://geodata.baltimorecity.gov/egis/rest/services/Planning/Boundaries/MapServer/19"
Expand All @@ -1375,11 +1376,20 @@ inspire <-
sfext::read_sf_ext(url = inspire_path)

adopted_plans <-
sfext::read_sf_ext(url = adopted_plans_path, crs = selected_crs)
sfext::read_sf_ext(url = adopted_plans_path) |>
sf::st_transform(crs = selected_crs)

adopted_plans <- adopted_plans %>%
sfext::rename_sf_col() %>%
dplyr::select(plan_name = area_name, year_adopted = status, url) %>%
dplyr::select(
plan_name = AREA_NAME,
year_adopted = STATUS,
url = URL
) %>%
# dplyr::left_join(
# mapbaltimore::adopted_plans |>
# sf::st_drop_geometry()
# ) |>
dplyr::mutate(
year_adopted = stringr::str_sub(year_adopted, start = -4),
program = dplyr::case_when(
Expand All @@ -1391,9 +1401,10 @@ adopted_plans <- adopted_plans %>%
dplyr::relocate(geometry, .after = program) %>%
dplyr::relocate(program, .after = year_adopted)

lincs_corridors_path <- "https://geodata.baltimorecity.gov/egis/rest/services/Planning/Boundaries_and_Plans/MapServer/37"
lincs_corridors_path <- # "https://geodata.baltimorecity.gov/egis/rest/services/Planning/Boundaries_and_Plans/MapServer/37"
"https://geodata.baltimorecity.gov/egis/rest/services/Housing/dmxCityPrograms/MapServer/34"

lincs_corridors <- esri2sf::esri2sf(lincs_corridors_path) %>%
lincs_corridors <- esri2sf::esri2sf(lincs_corridors_path, crs = selected_crs) %>%
janitor::clean_names("snake") %>%
sf::st_transform(selected_crs) %>%
dplyr::filter(objectid != 4)
Expand All @@ -1412,7 +1423,8 @@ lincs_corridors$url <- c(
lincs_corridors <- lincs_corridors %>%
dplyr::select(-c(objectid, shape_st_length), plan_name, year_adopted, program, url, geometry = geoms)

adopted_plans <- dplyr::bind_rows(adopted_plans, lincs_corridors)
adopted_plans <- dplyr::bind_rows(adopted_plans, lincs_corridors) |>
dplyr::arrange(year_adopted)

usethis::use_data(adopted_plans, overwrite = TRUE)

Expand Down
Binary file modified data/adopted_plans.rda
Binary file not shown.
Binary file added data/rec_centers.rda
Binary file not shown.
2 changes: 1 addition & 1 deletion man/adopted_plans.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

40 changes: 40 additions & 0 deletions man/rec_centers.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b6c1b39

Please sign in to comment.