BetaNYC’s Research and Data Assistance Request service received the following request from New Yorkers for Parks:
Hi BetaNYC team! Would you be able to help us with a list of NYC Parks that allow personal vehicles to drive through them, prioritizing parks where pedestrians’ and cyclists’ experience in the park is shaped by vehicles (vs. Central Park transverse example, which is separated from people)? […] Not sure how to go about this except by looking at a map, park by park and would love BetaNYC’s support.
Only two New York City parks have banned vehicle traffic: Central Park in Manhattan and Prospect Park in Brooklyn1. It appears there is no official list of parks that do permit vehicles in parks. A tentative list of parks that do may be derived from the assumption that any park that contains a road segment suitable for vehicle traffic, with the exception of Central Park and Prospect Park, allows vehicle traffic.
Code
# Notebook setup# Use quarto render to generate a static site in /docs# Set github pages to deploy from main branch, /docs# Insure packages are installed by checking required packages against installed packagesreqd_pkgs <-c("flextable","sf","tidyverse","mapgl","htmltools","officer","forcats","socratadata","mapgl","mapview","DBI","RPostgres")install.packages(setdiff( reqd_pkgs,rownames(installed.packages()) ),repos ="https://cloud.r-project.org")lapply(reqd_pkgs, library, character.only =TRUE) |>invisible()# If needed, ensure that the Quarto render and RStudio read the same environment varsreadRenviron(".Renviron")# Start Postgres via Docker, wait for healthchecksystem("docker compose up -d --wait")# Set up connection from envcon <-dbConnect(RPostgres::Postgres())# Enable PostGISinvisible(dbExecute(con, "CREATE EXTENSION IF NOT EXISTS postgis"))# Get cil_table()source("cil_table.R")
The Parks Properties dataset description carries the caveat:
This dataset identifies property managed partially or solely by NYC Parks. This data has been produced in whole or part using secondary data. Data accuracy is limited by the scale and accuracy of the original sources. Site-specific conditions should be field-verified.
At least two ambiguities are described above. One is the official-unofficial nature of the data. It’s provided to NYC Open Data by the Department of Parks, but it’s comprised of secondary data (at least in part, or maybe in whole – another ambiguity. Does the Department of Parks not know what properties are under their jurisdiction?). The other is that it’s unclear what types of properties are included in the dataset. Are they all parks? A mixture of parks and something else? We can take a look at the unique combinations of class, subcategory, and typecategory:
PARK is the only class of property in the dataset. Based on the combinations of subcategory and typecategory, it may be possible to determine which properties may be excluded from our list of parks, but for now we’ll consider each feature in the dataset to be a park.
NYC Street Centerline
The centerline dataset is described as:
The NYC Street Centerline (CSCL) is a road-bed representation of New York City streets containing address ranges and other information such as traffic directions, road types, segment types.
This brief description implies that this dataset is entirely composed of streets, i.e. surfaces for vehicles to travel. However, taking a look at the rw_type reveals that not to be the case2:
We’ll want to exclude segments where rw_type is 6 to keep paths/trails from counting as a site for vehicular traffic. It’s possible that other roadway types should be excluded, but for now, only Path/Trail will be.
Considerations
One consideration for this analysis are large parks spanning city streets. Take, for example, McCarren Park in Greenpoint, Brooklyn, which is comprised of five separate areas:
If our consideration of a park that permits vehicle traffic is strict, McCarren Park will not qualify unless there are road segments within any of the separate areas. In order to capture the broader definition used by New Yorkers for Parks of “parks where pedestrians’ and cyclists’ experience in the park is shaped by vehicles”, we can use the convex hull operation, which is analogous to the area enclosed by wrapping a rubber band around multi-part areas:
Care must be taken with this approach, though, as the operation may introduce roads into the resulting area that as an artifact. See above along the southwest border of the park where North 12th Street now falls within the new park area, where it didn’t overlap before.
All to say: This more inclusive definition of park area by necessity introduces false positives into the list. Manual review is required
Methodology
Fetch road segments which are not Path/Trail
Fetch parks properties
Get convex hull of property boundaries to enclose disjoint parks
Use spatial inner join with ST_INTERSECTS spatial predicate to identify parks with intersecting street segments
# Transform to state plane (ft), write to dbst_write(st_transform(centerline, 2263), con, "centerline", delete_layer =TRUE, quiet =TRUE)st_write(st_transform(parks, 2263), con, "parks", delete_layer =TRUE, quiet =TRUE)invisible(dbExecute(con, "DROP TABLE IF EXISTS parks_ch"))# Compute convex hulls into new table for fast query (rather than as CTE)invisible(dbExecute(con, " CREATE TABLE parks_ch AS SELECT gispropnum, signname, ST_ConvexHull(ST_MakeValid(geom)) AS geom FROM parks"))# Create spatial indexinvisible(dbExecute(con, "CREATE INDEX ON parks_ch USING GIST (geom)"))# Analyze parks tableinvisible(dbExecute(con, "ANALYZE parks_ch"))# Query, write result to R objectparks_with_roads_all <-dbGetQuery(con, " SELECT p.gispropnum, p.signname, c.physicalid, c.rw_type FROM parks_ch p JOIN centerline c ON ST_Intersects(p.geom, c.geom) ORDER BY p.gispropnum")dbDisconnect(con)# Filter parks, roads based on query resultspark_list <- parks |>filter(gispropnum %in% parks_with_roads_all$gispropnum)road_list <- centerline |>filter(physicalid %in% parks_with_roads_all$physicalid)
With this approach, 481 of 2,059 NYC parks are found to have overlapping roads. They are displayed below:
Code
maplibre(bounds = park_list |>st_buffer(500),style =carto_style("positron")) |>add_source(id ="parks-src",data =select(park_list, gispropnum, signname), # only the columns the map needstolerance =0# no simplification at any zoom ) |># Transparent fill layer for tooltip add_fill_layer(id ="parks-hover",source ="parks-src",fill_color ="#3258a3",fill_opacity =0,tooltip ="signname" ) |>add_line_layer(id ="parks-with-roads",source ="parks-src",line_color ="#3258a3",line_opacity =0.85 )
As noted earlier, the approach used to identify roads splitting up multi-part parks necessarily introduces false positives. The list of 481 needs to be manually reviewed.
Consider the case of Hoffman Park in Queens: The convex hull boundary (red) overlaps with the ramps on and off of the Long Island Expressway from Woodhaven Boulevard, whereas the actual boundary (blue) does not: