Skip to contents

Retrieve data

Functions to retrieve Ontario spatial layers from authoritative sources.

retrieve_phu()
Retrieve Public Health Unit boundaries
retrieve_phu_simple()
Retrieve simplified Public Health Unit boundaries
retrieve_phu_pre2025()
Retrieve the pre-2025 simplified Public Health Unit boundaries
retrieve_health_region()
Retrieve Ontario Health Region boundaries
retrieve_municipal()
Retrieve municipal boundaries
retrieve_census()
Retrieve an Ontario 2021 census boundary layer
retrieve_moh_service_locations()
Retrieve MOH service locations
retrieve_airport()
Retrieve airport boundaries
retrieve_conservation_authority()
Retrieve Conservation Authority administrative areas
retrieve_orwn_station()
Retrieve Ontario Railway Network (ORWN) station points
retrieve_waste_management()
Retrieve waste management site boundaries
retrieve_monitoring_stations()
Retrieve monitoring station points
retrieve_monitoring_stations_simple()
Retrieve bundled monitoring station points
retrieve_hive()
Retrieve HIVE Grid boundaries
retrieve_synthetic_raster()
Retrieve a synthetic coarse air-quality raster
retrieve_source()
Retrieve a layer by source registry id

Core spatial linking and crosswalk-building functions.

link()
Link geometries to a target layer by spatial relationship
nearest()
Find the nearest targets to each source geometry
build_link()
Link two layers with no method choice
build_crosswalk()
Build an auditable crosswalk table between two geographic layers
build_intersection()
Build a polygon-to-polygon intersection table
build_nearest_layers()
Build layers for a nearest-neighbour map
build_nearest_pairs()
Build a point-to-point nearest-match table
summarise_by_target()
Summarise an intersection or nearest table by target
extract_polygon_collection()
Reduce GEOMETRYCOLLECTION geometries to their polygon parts

Resolve and identify

Resolve records by identifier or name.

resolve()
Resolve records from a layer by an identifier or name
resolve_postal()
Resolve Ontario postal codes to dissemination areas
resolve_postal_points()
Resolve Ontario postal codes to point coordinates
normalize_postal_code()
Normalize postal codes to the correspondence's own format
guess_name_col()
Guess a name column in an sf/data.frame layer
layer_id_col()
Resolve the id column of a retrieved layer

Map

Draw interactive Leaflet maps.

map_layers()
Map one or more layers on an interactive leaflet map
map_crosswalk()
Map crosswalk source layers
map_nearest()
Map nearest targets and their connections to source points

Source registry

Browse and query the built-in source metadata registry.

list_sources()
List available data sources
get_source()
Get metadata for one data source

Marginalization index

Attach 2021 ON-Marg measures to administrative boundaries.

retrieve_onmarg()
Retrieve Ontario Marginalization Index (ON-Marg) values
add_onmarg()
Attach ON-Marg columns to an administrative boundary layer
onmarg_geographies()
ON-Marg geographies and the boundary layers they attach to

Cache

Inspect and clear the on-disk retrieval cache.

list_cache()
List Cached ONgeoR Data
clear_cache()
Clear Cached ONgeoR Data

Reproducibility

Generate reproducible R scripts from a linking run.

render_reproducer_script()
Render a reproducible R script for a CLI run
render_postal_reproducer_script()
Render a postal-code reproducer script

Data

Built-in datasets bundled with the package.

hive
HIVE Grid (Levels 1-3): a built-in hierarchical boundary dataset