This package includes functions to generate “rays,” stretches of highways that originate outside of a “city center” or other region but run through it.
This markdown gives detail on the data + code used to generate the ray counts.
For the measures here, city centers are defined as the largest census-defined Place within a commuting zone. Hwys are identified using National Highway Planning Network (NHPN), available at: https://catalog.data.gov/dataset/national-highway-planning-network-nhpn
The columns SIGNT1 and SIGN1 in the NHPN data are used respectively to identify highway type (interstate, state route, etc.) and unique highway (i.e., I76, US-3).
Rays are found by:
?Count.rays for all options.Rays can be generated most easily with the Count.rays function. This will count the number of rays and bundle a map illustrating them if include.map is true.
Warnings are generated from sf functions and are not important in this context.
# rays in Philadelphia formed by Interstates, state routes, and US routes:
phl = suppressWarnings( Count.rays(place.geoid = plc.ids[["Philadelphia"]],
hwys,
always.include = c("I","U","S")
) )
phl$n.rays
#> [1] 19
phl$map
# rays in Chicago formed by Interstates and all non-NA routes that intersect
# interstates
chi = Count.rays(place.geoid = plc.ids[["Chicago"]],
hwys,
always.include = c("I"),
include.intersecting = T
)
#> Warning: attribute variables are assumed to be spatially constant throughout all
#> geometries
#> Warning: attribute variables are assumed to be spatially constant throughout all
#> geometries
#> Warning: attribute variables are assumed to be spatially constant throughout all
#> geometries
chi$n.rays
#> [1] 20
chi$map
# Oklahoma City, with and without Place holes and Highway gaps getting filled
okT = Count.rays(plc.ids["Oklahoma City"]
,hwys
,always.include = c("I", "U", "S")
,remove.holes = T
,fill.gaps = T)
#> Warning: attribute variables are assumed to be spatially constant throughout all
#> geometries
#> Warning: attribute variables are assumed to be spatially constant throughout all
#> geometries
okT$n.rays
#> [1] 16
okT$map
okF = Count.rays(plc.ids["Oklahoma City"]
,hwys
,always.include = c("I", "U", "S")
,remove.holes = F
,fill.gaps = F , verbose = F)
#> Warning: attribute variables are assumed to be spatially constant throughout all
#> geometries
#> Warning: attribute variables are assumed to be spatially constant throughout all
#> geometries
okF$n.rays
#> [1] 17
okF$map