Skip to contents

Spatial companion to fetch_facilities(). New Hampshire's reachable public facilities geometry is the NHDES LeadInSchools facility point layer filtered to AGENCY = 'DOE'. This is a lead-testing facility layer, not a complete current school directory, so use source_agency, source_url, and vintage caveats when mapping.

Usage

fetch_facility_gis(
  layer = "school_points",
  sf = TRUE,
  use_cache = TRUE,
  source = NULL,
  max_age_days = NULL,
  refresh = FALSE
)

Arguments

layer

Which layer to fetch. Currently "school_points".

sf

If TRUE (default), return an sf object when available.

use_cache

If TRUE (default), use cached NHDES ArcGIS downloads when fresh.

source

Requested acquisition mode: "package" (default) or explicit "live" where a runtime producer exists. Retained-only surfaces reject live requests; refresh their files through the documented manual harvest.

max_age_days

Maximum reusable live-cache age in elapsed 24-hour days.

refresh

Force live retrieval. Valid only in live mode.

Value

An sf object or data frame with latitude/longitude/WKT.

Details

With sf = TRUE and the Suggested sf package installed, returns an sf POINT object. With sf = FALSE (or if sf is not installed), returns a plain data frame with latitude, longitude, and wkt. Rows with source-null coordinates remain present with missing geometry.

Examples

if (FALSE) { # \dontrun{
pts <- fetch_facility_gis("school_points")
df <- fetch_facility_gis("school_points", sf = FALSE)
head(df[, c("facility_name", "city", "latitude", "longitude")])
} # }