Toronto PS ArcGIS Hub dataset wrapper. Thin dispatch to
morie_datasets_tps_arcgis_hub_by_id() with the canonical
hub item_id de8ba3b4899b48bc8fbf4421f4945ed6.
Usage
morie_datasets_tps_2009_firs(
format = "json",
where = "1=1",
max_features = NULL,
layer_idx = 0L,
offline = TRUE,
dest = NULL
)Arguments
- format
One of
"json"(default),"geojson","csv","shapefile","fgdb".- where
SoQL-style
WHEREfilter passed to FeatureServer?where=(default"1=1").- max_features
Optional cap on returned rows. Passed as
resultRecordCountto FeatureServer; ignored for binary formats.- layer_idx
Integer index of the FeatureServer layer to pull (default
0L, the first layer).- offline
Logical; if
TRUE, the hub_id is resolved via the included catalog (no network needed for the resolution step). DefaultTRUE– you can run this against the 71 catalog entries without network. Live data fetches always hit the network regardless of this argument; "offline" here only affects the hub_id -> FeatureServer URL lookup.- dest
Optional path for binary downloads (
format %in% c("shapefile", "fgdb")); defaults totempfile().
Value
A data.frame / GeoJSON list / file path; see
morie_datasets_tps_arcgis_hub_by_id() for per-format semantics.
Examples
# \donttest{
df <- try(morie_datasets_tps_2009_firs(max_features = 5L))
if (!inherits(df, "try-error")) head(df)
#> CONTACTID TPS_PATROL_ZONE NATURE_OF_CONTACT CONTACT_DATE CONTACT_TIME
#> 1 258006 322 Traffic Stop 2009.01.01 01:23:00
#> 2 258007 331 Traffic Stop 2009.01.01 01:19:00
#> 3 258009 145 General Investigation 2009.01.01 00:13:00
#> 4 258010 144 Sex Related 2009.01.01 01:40:00
#> 5 258013 133 General Investigation 2009.01.01 04:30:00
#> CONTACT_YEAR AGE SEX BIRTH_PLACE SKIN_COLOUR YEAR_MONTH_OF_BIRTH
#> 1 2009 30 Male <NA> <NA> 1978 OCT
#> 2 2009 48 Male <NA> White 1960 DEC
#> 3 2009 38 Male <NA> White 1970 AUG
#> 4 2009 29 Male Guyana Black 1979 APR
#> 5 2009 34 Male <NA> White 1974 OCT
#> UNIQUE_PERSON_ID HOME_CITY HOME_PATROL_ZONE FID
#> 1 277043 MARKHAM 421 1
#> 2 277044 TORONTO NA 2
#> 3 277046 TORONTO 145 3
#> 4 277047 SCARBOROUGH 423 4
#> 5 277048 TORONTO 133 5
# }
