pd_sf: Read a dataset's map layer as an sf object

View source: R/geo.R

pd_sfR Documentation

Read a dataset's map layer as an sf object

Description

Downloads one version's GeoPackage and reads it with 'sf'. Datasets with a location, such as crash points, or a shape, such as ABS boundaries, have one; their coordinates are in the reference system the publisher used, which the GeoPackage names, usually GDA2020 (EPSG:7844).

Usage

pd_sf(slug, version = NULL, cache = NULL)

Arguments

slug

The dataset's slug, as in its page URL 'https://publicdata.au/d/<slug>/'.

version

A version date from [pd_versions()]. The newest when 'NULL'.

cache

Keep the file in [pd_cache_dir()] and reuse it next time. Versions never change, so a kept file never goes stale. Off unless 'options(publicdataau.cache = TRUE)' is set.

Value

An 'sf' tibble with a row per feature. 'attr(x, "publicdata")' is the provenance the file carries: version, licence, attribution, citation and source.

See Also

Other maps: pd_boundaries(), pd_boundary_layers(), pd_join_boundaries()

Examples


storages <- pd_sf("au-water-storages")
sf::st_crs(storages)$epsg


publicdataau documentation built on Oct. 14, 2026, 5:07 p.m.