
NYC Police Precincts boundary layer (y76i-bdw7)
Source: R/datasets_nyc_nypd.R
morie_datasets_nyc_police_precincts.RdWraps the NYC OpenData "Police Precincts" feed (77 precincts +
the special precinct 22 / Central Park alias = 78 rows in this
fixture). Used as the resolver for the arrest_precinct /
addr_pct_cd / complaint_precinct_code foreign keys on every
NYPD CJ dataset (3NN).
Usage
morie_datasets_nyc_police_precincts(
offline = TRUE,
geometry = FALSE,
max_features = NULL,
resource_id = NULL,
mode = c("soda2", "soda3"),
paginate = FALSE,
page_size = 1000L,
max_pages = 200L,
app_token = NULL
)Arguments
- offline
If
TRUE(default), read the included fixture.- geometry
If
TRUEandoffline = FALSE, include thethe_geomMultiPolygon.- max_features
Optional row cap.
- resource_id
Optional view id override (default
"sp34-6z76").- mode
One of
"soda2"(default JSON resource endpoint) or"soda3"(SoQLqueryendpoint). 3AAA dual-mode dispatch.- paginate
Logical; 3OO/3QQ opt-in pagination via
LIMIT n OFFSET m.- page_size
Per-page row count when paginating.
- max_pages
Safety net.
- app_token
Optional Socrata app token (sent as
X-App-Token).
Details
Attribute schema: precinct (string, "1"-"123"), shape_leng,
shape_area. Live mode also returns the_geom MultiPolygon
when geometry = TRUE.
Examples
df <- morie_datasets_nyc_police_precincts(offline = TRUE)
head(df)
#> precinct shape_leng shape_area
#> 1 1 80093.49 47284748
#> 2 5 18807.08 18094771
#> 3 6 27255.99 22143015
#> 4 7 17287.66 18366632
#> 5 9 19772.51 21395386
#> 6 10 40227.21 27265501