Skip to content

Commit

Permalink
Clean ccao script
Browse files Browse the repository at this point in the history
  • Loading branch information
wrridgeway committed Dec 12, 2024
1 parent 253a71d commit b54f6f5
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 16 deletions.
22 changes: 9 additions & 13 deletions etl/scripts-ccao-data-raw-us-east-1/spatial/spatial-ccao.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,16 @@ output_bucket <- file.path(AWS_S3_RAW_BUCKET, "spatial", "ccao")

# Read privileges for the this drive location are limited.
# Contact Cook County GIS if permissions need to be changed.
file_path <- "//gisemcv1.ccounty.com/ArchiveServices" # nolint
file_path <- "//gisemcv1.ccounty.com/ArchiveServices/" # nolint

sources_list <- bind_rows(
list(
# NEIGHBORHOOD
"neighborhood" = c(
"url" = paste0(
"https://gitlab.com/ccao-data-science---modeling/packages/ccao",
"/-/raw/master/data-raw/nbhd_shp.geojson"
),
"boundary" = "neighborhood",
"year" = "2021"
)
)
sources_list <- data.frame(
# NEIGHBORHOOD
"url" = paste0(
"https://gitlab.com/ccao-data-science---modeling/packages/ccao",
"/-/raw/master/data-raw/nbhd_shp.geojson"
),
"boundary" = "neighborhood",
"year" = "2021"
)

# Function to call referenced API, pull requested data, and write it to S3
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,6 @@ for (year in years) {
st_transform(4326) %>%
mutate(geometry_3435 = st_transform(geometry, 3435))

geoparquet_to_s3(osm_roads, remote_file)
geoarrow::write_geoparquet(osm_roads, remote_file)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,6 @@ for (year in years) {
st_transform(4326) %>%
mutate(geometry_3435 = st_transform(geometry, 3435))

geoparquet_to_s3(osm_roads, remote_file)
geoarrow::write_geoparquet(osm_roads, remote_file)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ walk(years, \(x) {
mutate(year = as.character(x))

# Save the shapefile as a GeoParquet file
geoparquet_to_s3(shapefile_data, remote_file_path)
geoarrow::write_geoparquet(shapefile_data, remote_file_path)
} else {
message(paste("No shapefile found for year", x, "."))
}
Expand Down

0 comments on commit b54f6f5

Please sign in to comment.