Skip to contents

Walks the ArcGIS REST /query endpoint for the category's FeatureServer layer, accumulates all features in memory, and writes a single CSV file to cache_dir. Returns the CSV path.

Usage

morie_tps_fetch_category(
  category,
  cache_dir = NULL,
  where = "1=1",
  overwrite = FALSE,
  max_records_per_page = 2000L
)

Arguments

category

One of morie_tps_list_categories().

cache_dir

Directory to write the CSV into. Defaults to tempdir() (CRAN-safe; the Python default of ~/.cache/morie/tps requires R_user_dir opt-in in R).

where

ArcGIS SQL where clause (default "1=1").

overwrite

If FALSE and the output exists, return it without re-downloading.

max_records_per_page

Pagination size (server caps at 2000).

Value

Path to the written CSV file.