Toronto PS ArcGIS Hub dataset wrapper. Thin dispatch to
morie_datasets_tps_arcgis_hub_by_id() with the canonical
hub item_id 7a690ba1d7714063983ed78024d5b2af.
Usage
morie_datasets_tps_2012_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_2012_firs(max_features = 5L))
if (!inherits(df, "try-error")) head(df)
#> CONTACTID TPS_PATROL_ZONE NATURE_OF_CONTACT CONTACT_DATE CONTACT_TIME
#> 1 1089053 411 Traffic Stop Caution 2012.01.01 00:17:00
#> 2 1089054 414 General Investigation 2012.01.01 00:20:00
#> 3 1089056 415 Radio Call 2012.01.01 00:36:00
#> 4 1089063 323 Loitering 2012.01.01 01:09:00
#> 5 1089063 323 Loitering 2012.01.01 01:09:00
#> CONTACT_YEAR AGE SEX BIRTH_PLACE SKIN_COLOUR YEAR_MONTH_OF_BIRTH
#> 1 2012 38 Male <NA> White 1973 DEC
#> 2 2012 36 Female <NA> White 1975 AUG
#> 3 2012 62 Male <NA> White 1949 MAY
#> 4 2012 19 Male <NA> Brown 1992 JUN
#> 5 2012 19 Female India Brown 1992 MAR
#> UNIQUE_PERSON_ID HOME_CITY HOME_PATROL_ZONE FID
#> 1 616014 TORONTO NA 1
#> 2 4786246 TORONTO 413 2
#> 3 3043498 TORONTO 415 3
#> 4 2596240 TORONTO 323 4
#> 5 4903308 OTTAWA NA 5
# }
